|
|
|
@ -1,5 +1,33 @@
|
|
|
|
#include "ubl-settings-usergroups.h"
|
|
|
|
#include "ubl-settings-usergroups.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void on_login_insert_custom_restricted_check(GtkEditable *editable, const gchar *text, gint length, gint *position){
|
|
|
|
|
|
|
|
gchar *new_text = g_new(gchar, length + 1);
|
|
|
|
|
|
|
|
memset(new_text,0,length+1);
|
|
|
|
|
|
|
|
gint i, j = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < length; i++) {
|
|
|
|
|
|
|
|
if ((text[i]>='a'&&text[i]<='z')||(text[i]>='0'&&text[i]<='9')||strchr("_-",text[i])) {
|
|
|
|
|
|
|
|
new_text[j] = text[i];
|
|
|
|
|
|
|
|
j++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (j < length) {
|
|
|
|
|
|
|
|
g_signal_handlers_block_by_func(editable, G_CALLBACK(on_login_insert_custom_restricted_check), NULL);
|
|
|
|
|
|
|
|
gtk_editable_insert_text(editable, new_text, j, position);
|
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func(editable, G_CALLBACK(on_login_insert_custom_restricted_check), NULL);
|
|
|
|
|
|
|
|
g_signal_stop_emission_by_name(editable, "insert-text");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_free(new_text);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void yon_gtk_login_block_symbols(GtkEntry *target){
|
|
|
|
|
|
|
|
g_return_if_fail(GTK_IS_ENTRY(target));
|
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(target),"insert-text",G_CALLBACK(on_login_insert_custom_restricted_check),NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_parameter_changed(GtkWidget *,ubl_settings_usergroups_user_window *window){
|
|
|
|
void on_parameter_changed(GtkWidget *,ubl_settings_usergroups_user_window *window){
|
|
|
|
char *user_shell=NULL;
|
|
|
|
char *user_shell=NULL;
|
|
|
|
char *user_home=NULL;
|
|
|
|
char *user_home=NULL;
|
|
|
|
@ -130,6 +158,7 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
|
|
|
|
window->MainNotebook=yon_gtk_builder_get_widget(builder,"MainNotebook");
|
|
|
|
window->MainNotebook=yon_gtk_builder_get_widget(builder,"MainNotebook");
|
|
|
|
window->expiration_unix=NULL;
|
|
|
|
window->expiration_unix=NULL;
|
|
|
|
window->last_uid=NULL;
|
|
|
|
window->last_uid=NULL;
|
|
|
|
|
|
|
|
yon_gtk_entry_block_symbols(GTK_ENTRY(window->userUserNameEntry),":");
|
|
|
|
|
|
|
|
|
|
|
|
time_t t = time(NULL);
|
|
|
|
time_t t = time(NULL);
|
|
|
|
struct tm tm = *localtime(&t);
|
|
|
|
struct tm tm = *localtime(&t);
|
|
|
|
|