Added user name check for blanks
SVN revision: 1645
This commit is contained in:
+15
-1
@@ -10869,13 +10869,27 @@ int save_user_config(LOGBOOK * lbs, char *user, BOOL new_user, BOOL activate)
|
||||
int i, self_register;
|
||||
PMXML_NODE node, subnode;
|
||||
|
||||
/* check for user name */
|
||||
if (!isparam("new_user_name") || *getparam("new_user_name") == 0) {
|
||||
sprintf(str, loc("Please enter \"%s\""), loc("Login name"));
|
||||
show_error(str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* check for full name */
|
||||
if (!isparam("new_full_name") || isparam("new_full_name") == 0) {
|
||||
if (!isparam("new_full_name") || *getparam("new_full_name") == 0) {
|
||||
sprintf(str, loc("Please enter \"%s\""), loc("Full name"));
|
||||
show_error(str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* check for blank character in user name */
|
||||
strlcpy(str, getparam("new_user_name"), sizeof(str));
|
||||
if (strchr(str, ' ')) {
|
||||
show_error(loc("User name may not contain blanks"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* check self register flag */
|
||||
self_register = 0;
|
||||
if (getcfg(lbs->name, "Self register", str, sizeof(str)))
|
||||
|
||||
Reference in New Issue
Block a user