我在一些使用 FireBird 2.6x 的站点,看到有这样的问题:
就是在用户注册后,每隔半年,用户再登录,就没有了通过身份认证而获得的权限.
需要重新填写注册单一次并由站长进行身份认证.由此还可能带来一些其它的问题.
除了 SYSOP 和 guest 这两个账号,其它任何账号都将被系统强制重新注册.
令这个有点奇怪的系统设定无效虽然很简单,但是我还是写写吧:
在 main.c 和 register.c 中把相关代码块注释掉了:
>main.c 的 user_login 函数中:
/* ppfoong - 每 REG_EXPIRED 天重新进行身份确认 */
/*if (HAS_PERM(PERM_LOGINOK) && Leeward 99.02.01 disable 半年重注册
strcmp(currentuser.userid,"SYSOP") &&
strcmp(currentuser.userid,"guest"))
{
struct stat st;
time_t now;
int expired = 0;
now = time(0);
setuserfile(fname,"mailcheck");
if (stat(fname,&st) == -1 || now - st.st_mtime >= REG_EXPIRED*86400)
{
setuserfile(fname,"register");
if (stat(fname,&st) == 0)
{
if (now - st.st_mtime >= REG_EXPIRED*86400)
{
setuserfile(fname,"register.old");
if (stat(fname,&st) == -1
|| now - st.st_mtime >= REG_EXPIRED*86400)
expired = 1;
else expired = 0;
}
}
}
if (expired)
{
strcpy(currentuser.email,"");
strcpy(currentuser.address,"");
currentuser.userlevel &= ~(PERM_LOGINOK|PERM_PAGE);
mail_file("etc/expired",currentuser.userid,"更新个人资料说明。");
}
}*/
>register.c 的 invalid_realmail 函数中:
/*sethomefile(fname,userid,"register"); Leeward 99.02.01 disable 半年重注册
if (stat(fname,&st) == 0)
{
if (now - st.st_mtime >= REG_EXPIRED*86400)
{
sethomefile(fname,userid,"register.old");
if (stat(fname,&st) == -1 || now - st.st_mtime >= REG_EXPIRED*86400)
return 1;
}
}*/
--
修改:Leeward FROM bbs.huizhou.gd.
FROM 202.101.112.202