summaryrefslogtreecommitdiffstats
path: root/mbbsd/user.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-03-03 20:48:41 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-03-03 20:48:41 +0800
commitaf16dfc53f004ad3515296daff9156ec0751b0b5 (patch)
treef69dc74bd928ef447b24ccc95e14001db89cf3b2 /mbbsd/user.c
parent59865815bbd0227f71941e82c37e5fe1d34c1b1f (diff)
downloadpttbbs-af16dfc53f004ad3515296daff9156ec0751b0b5.tar
pttbbs-af16dfc53f004ad3515296daff9156ec0751b0b5.tar.gz
pttbbs-af16dfc53f004ad3515296daff9156ec0751b0b5.tar.bz2
pttbbs-af16dfc53f004ad3515296daff9156ec0751b0b5.tar.lz
pttbbs-af16dfc53f004ad3515296daff9156ec0751b0b5.tar.xz
pttbbs-af16dfc53f004ad3515296daff9156ec0751b0b5.tar.zst
pttbbs-af16dfc53f004ad3515296daff9156ec0751b0b5.zip
- add option "default to backup" (from PttSuggest@ptt2)
- user/reg: prevent ambigious regcode. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3962 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/user.c')
-rw-r--r--mbbsd/user.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mbbsd/user.c b/mbbsd/user.c
index d0ea5875..91f5f0cf 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -343,6 +343,7 @@ void Customize(void)
DBCSAWARE_FLAG,
DBCS_NOINTRESC,
#endif
+ DEFBACKUP_FLAG,
0,
};
@@ -354,6 +355,7 @@ void Customize(void)
"自動偵測雙位元字集(如全型中文)",
"禁止在雙位元中使用色碼(去一字雙色)",
#endif
+ "預設備份信件與其它記錄", //"與聊天記錄",
0,
};
@@ -536,14 +538,15 @@ makeregcode(char *buf)
{
char fpath[PATHLEN];
int fd, i;
- const char *alphabet = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
+ // prevent ambigious characters: oOlI
+ const char *alphabet = "qwertyuipasdfghjkzxcvbnmoQWERTYUPASDFGHJKLZXCVBNM";
/* generate a new regcode */
buf[13] = 0;
buf[0] = REGCODE_INITIAL[0];
buf[1] = REGCODE_INITIAL[1];
for( i = 2 ; i < 13 ; ++i )
- buf[i] = alphabet[random() % 52];
+ buf[i] = alphabet[random() % strlen(alphabet)];
getregfile(fpath);
if( (fd = open(fpath, O_WRONLY | O_CREAT, 0600)) == -1 ){
@@ -1810,7 +1813,8 @@ u_register(void)
break;
} while( 1 );
- if (strcmp(inregcode, getregcode(regcode)) == 0) {
+ // make it case insensitive.
+ if (strcasecmp(inregcode, getregcode(regcode)) == 0) {
int unum;
delregcodefile();
if ((unum = searchuser(cuser.userid, NULL)) == 0) {