diff options
Diffstat (limited to 'mbbsd/passwd.c')
-rw-r--r-- | mbbsd/passwd.c | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c index 161239bd..05363661 100644 --- a/mbbsd/passwd.c +++ b/mbbsd/passwd.c @@ -11,14 +11,6 @@ #define cuser pwcuser #endif -void -passwd_force_update(int flag) -{ - if(!currutmp || (currutmp->alerts & ALERT_PWD) == 0) - return; - currutmp->alerts &= ~flag; -} - int initcuser(const char *userid) { @@ -26,60 +18,27 @@ initcuser(const char *userid) return usernum; } -// XXX I don't like the stupid synchronization here, -// but simply following previous work here... int passwd_sync_update(int num, userec_t * buf) { - int alerts; - if (num < 1 || num > MAX_USERS) return -1; // money update should be done before everything. buf->money = moneyof(num); - - if(usernum == num && currutmp && ((alerts = currutmp->alerts) & ALERT_PWD)) - { - userec_t u; - if (passwd_sync_query(num, &u) != 0) - return -1; - - if(alerts & ALERT_PWD_BADPOST) - cuser.badpost = buf->badpost = u.badpost; - if(alerts & ALERT_PWD_PERM) - cuser.userlevel = buf->userlevel = u.userlevel; - if(alerts & ALERT_PWD_JUSTIFY) - { - memcpy(buf->justify, u.justify, sizeof(u.justify)); - memcpy(cuser.justify, u.justify, sizeof(u.justify)); - memcpy(buf->email, u.email, sizeof(u.email)); - memcpy(cuser.email, u.email, sizeof(u.email)); - } - currutmp->alerts &= ~ALERT_PWD; - - // ALERT_PWD_RELOAD: reload all! No need to write. - if (alerts & ALERT_PWD_RELOAD) - { - memcpy(&cuser, &u, sizeof(u)); - return 0; - } - } - if (passwd_update(num, buf) != 0) return -1; return 0; } -// XXX I don't like the stupid synchronization here, -// but simply following previous work here... int passwd_sync_query(int num, userec_t * buf) { if (passwd_query(num, buf) < 0) return -1; + buf->money = moneyof(num); return 0; } |