Add config file command "chmail" that will ask the user to change his email

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@419 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2008-01-13 18:28:50 +00:00
parent 2d0a128be7
commit 0ee48979db
4 changed files with 6 additions and 0 deletions

View File

@ -93,6 +93,7 @@ unlink { yylval.i = DGLCMD_UNLINK; return TYPE_DGLCMD1; }
setenv { yylval.i = DGLCMD_SETENV; return TYPE_DGLCMD2; } setenv { yylval.i = DGLCMD_SETENV; return TYPE_DGLCMD2; }
exec { yylval.i = DGLCMD_EXEC; return TYPE_DGLCMD2; } exec { yylval.i = DGLCMD_EXEC; return TYPE_DGLCMD2; }
chpasswd { yylval.i = DGLCMD_CHPASSWD; return TYPE_DGLCMD0; } chpasswd { yylval.i = DGLCMD_CHPASSWD; return TYPE_DGLCMD0; }
chmail { yylval.i = DGLCMD_CHMAIL; return TYPE_DGLCMD0; }
DEFINE { return TYPE_DEFINE_GAME; } DEFINE { return TYPE_DEFINE_GAME; }

View File

@ -104,6 +104,7 @@ typedef enum
DGLCMD_UNLINK, /* unlink foo */ DGLCMD_UNLINK, /* unlink foo */
DGLCMD_EXEC, /* exec foo bar */ DGLCMD_EXEC, /* exec foo bar */
DGLCMD_SETENV, /* setenv foo bar */ DGLCMD_SETENV, /* setenv foo bar */
DGLCMD_CHMAIL, /* chmail */
DGLCMD_CHPASSWD /* chpasswd */ DGLCMD_CHPASSWD /* chpasswd */
} dglcmd_actions; } dglcmd_actions;

View File

@ -200,6 +200,9 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me)
case DGLCMD_CHPASSWD: case DGLCMD_CHPASSWD:
if (loggedin) changepw(1); if (loggedin) changepw(1);
break; break;
case DGLCMD_CHMAIL:
if (loggedin) change_email();
break;
} }
free(p1); free(p1);
free(p2); free(p2);

View File

@ -76,6 +76,7 @@ lockfile = "/dgl-lock"
# setenv "foo "bar" = sets environment variable "foo" to "bar" # setenv "foo "bar" = sets environment variable "foo" to "bar"
# exec "foo" "bar" = execute "foo" with "bar" as it's param # exec "foo" "bar" = execute "foo" with "bar" as it's param
# chpasswd = do the change password prompting, if logged in # chpasswd = do the change password prompting, if logged in
# chmail = do the change email prompting, if logged in
# #
# The commands will be done inside the chroot and with the uid and gid # The commands will be done inside the chroot and with the uid and gid
# defined above. # defined above.