mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 19:52:48 +00:00
Set username to default to the category name if it isn't overridden by a usernmae= setting in users.conf
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -705,7 +705,13 @@ static struct user *build_user(struct ast_config *cfg, const char *name, const c
|
|||||||
for (i = 0; i < PP_VAR_LIST_LENGTH; i++) {
|
for (i = 0; i < PP_VAR_LIST_LENGTH; i++) {
|
||||||
tmp = ast_variable_retrieve(cfg, name, pp_variable_list[i].user_var);
|
tmp = ast_variable_retrieve(cfg, name, pp_variable_list[i].user_var);
|
||||||
|
|
||||||
if (i == PP_TIMEZONE) {
|
/* If we didn't get a USERNAME variable, set it to the user->name */
|
||||||
|
if (i == PP_USERNAME && !tmp) {
|
||||||
|
if ((var = ast_var_assign(pp_variable_list[PP_USERNAME].template_var, user->name))) {
|
||||||
|
AST_LIST_INSERT_TAIL(user->headp, var, entries);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
} else if (i == PP_TIMEZONE) {
|
||||||
/* perfectly ok if tmp is NULL, will set variables based on server's time zone */
|
/* perfectly ok if tmp is NULL, will set variables based on server's time zone */
|
||||||
set_timezone_variables(user->headp, tmp);
|
set_timezone_variables(user->headp, tmp);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user