|
|
|
|
@ -102,8 +102,15 @@ if (main_config.sync_users){
|
|
|
|
|
for (int i=0;i<main_config.sync_size;i++){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(main_config.sync_users[i],&size,":");
|
|
|
|
|
if (!yon_char_is_empty(parsed[1])){
|
|
|
|
|
if (parsed[1][0]==' '&&parsed[1][1]=='.'&&parsed[1][2]==' ')
|
|
|
|
|
free(parsed[1]=yon_char_divide(parsed[1],3));
|
|
|
|
|
|
|
|
|
|
system (yon_char_is_empty(parsed[1])? samba_sync_command(parsed[0]) : samba_sync_password_command(parsed[0],parsed[1]));
|
|
|
|
|
system (samba_sync_password_command(parsed[0],parsed[1]));
|
|
|
|
|
} else {
|
|
|
|
|
system ( samba_sync_command(parsed[0]));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
yon_char_parsed_free(parsed,size);
|
|
|
|
|
}
|
|
|
|
|
@ -866,7 +873,7 @@ void on_password_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
if (!yon_char_is_empty(pasted_hash)){
|
|
|
|
|
gtk_entry_set_text(entry,pasted_hash);
|
|
|
|
|
} else {
|
|
|
|
|
char *password = yon_char_new((char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)));
|
|
|
|
|
char *password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry));
|
|
|
|
|
if (yon_char_is_empty(password)){
|
|
|
|
|
yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"password_empty",EMPTY_IMPORTANT_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
return;
|
|
|
|
|
@ -885,6 +892,7 @@ void on_password_accept(GtkWidget *self, dictionary *dict){
|
|
|
|
|
free(password);
|
|
|
|
|
password=pasw;
|
|
|
|
|
}
|
|
|
|
|
password = yon_char_append(" . ",password);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(entry),password);
|
|
|
|
|
} else {
|
|
|
|
|
yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"password_mismatch",PASSWORD_MISMATCH_LABEL,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
@ -1335,10 +1343,35 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
on_subwindow_close(self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_toggle_button_set_active_from_combo_box(GtkComboBox *self,GtkToggleButton *target){
|
|
|
|
|
if (gtk_combo_box_get_active(self)<=1){
|
|
|
|
|
gtk_toggle_button_set_active(target,0);
|
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(target),0);
|
|
|
|
|
void on_toggle_button_set_active_from_combo_box(GtkComboBox *self,ubl_settings_usergroups_user_window *window){
|
|
|
|
|
char *passw = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordEntry));
|
|
|
|
|
if (gtk_combo_box_get_active(self)<=1||(passw[0]!=' '&&passw[1]!='.'&&passw[2]!=' ')){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck),0);
|
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(window->userSyncSAMBACheck),0);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBAPasswordCheck),0);
|
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(window->userSyncSAMBAPasswordCheck),0);
|
|
|
|
|
}else {
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck),0);
|
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(window->userSyncSAMBACheck),1);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBAPasswordCheck),0);
|
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(window->userSyncSAMBAPasswordCheck),1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_password_user_changed(GtkComboBox *self,ubl_settings_usergroups_user_window *window){
|
|
|
|
|
char *passw = (char*)gtk_entry_get_text(GTK_ENTRY(window->userPasswordEntry));
|
|
|
|
|
if ((passw[0]!=' '&&passw[1]!='.'&&passw[2]!=' ')){
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck),0);
|
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(window->userSyncSAMBACheck),0);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBAPasswordCheck),0);
|
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(window->userSyncSAMBAPasswordCheck),0);
|
|
|
|
|
} else {
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBACheck),0);
|
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(window->userSyncSAMBACheck),1);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userSyncSAMBAPasswordCheck),0);
|
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(window->userSyncSAMBAPasswordCheck),1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1452,8 +1485,9 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userSyncSAMBAPasswordCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userSyncSAMBACheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userSyncSAMBACheck),"toggled",G_CALLBACK(on_toggle_button_set_active_from_toggle_button_inversed),window->userSyncSAMBAPasswordCheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userSyncSAMBAPasswordCheck),"toggled",G_CALLBACK(on_toggle_button_set_active_from_toggle_button_inversed),window->userSyncSAMBACheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordCombo),"changed",G_CALLBACK(on_toggle_button_set_active_from_combo_box),window->userSyncSAMBAPasswordCheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordCombo),"changed",G_CALLBACK(on_toggle_button_set_active_from_combo_box),window->userSyncSAMBACheck);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordCombo),"changed",G_CALLBACK(on_toggle_button_set_active_from_combo_box),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordCombo),"changed",G_CALLBACK(on_toggle_button_set_active_from_combo_box),window);
|
|
|
|
|
g_signal_connect(G_OBJECT(window->userPasswordEntry),"changed",G_CALLBACK(on_password_user_changed),window);
|
|
|
|
|
return window;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|