第一步: 动易2006 to phpcms 【http://soft.phpcms.cn/2007/0524/down_114.html】 第二步:phpcms to ecms 4.6 (届时的4.7应该类似)【http://bbs.phome.net/showthread-36-30019-0.html】 除了会员有点问题,其他基本都过来了。 关键的第三步:因为原动易会员密码使用16位md5,经上两步转换至ecms后会发生密码错误。
两个办法解决问题: 1. 将e/class/user.php中的$user_dopass=0; 改成 $user_dopass=3; //密码保存形式,0为md5,1为明码,2为双重加密,3为16位md5 这样旧会员可以正常登录,新注册会员也同样使用16位md5密码加密。 缺点:密码依然采用16位加密,以后如果再要数据转换时问题依然存在
2. 保持e/class/user.php中的$user_dopass=0; 不变;
查找 $num=$empire->gettotal("select count(*) as total from ".$user_tablename." where ".$user_username."='$utfusername' and ".$user_password."='".$password."' limit 1"); 在其上面添加 $ur=$empire->fetch1("select ".$user_password." from ".$user_tablename." where ".$user_username."='$utfusername'"); if(strlen($ur[$user_password])==16) {$password=substr($password,8,16);} 查找 $num=$empire->gettotal("select count(*) as total from ".$user_tablename." where ".$user_username."='$username' and ".$user_password."='".$oldpassword."'"); 在其上面添加 $ur=$empire->fetch1("select ".$user_password." from ".$user_tablename." where ".$user_username."='$username'"); if(strlen($ur[$user_password])==16 && strlen($oldpassword)==32) {$oldpassword=substr($oldpassword,8,16);}
OK,旧会员可以继续使用16位md5登录,修改密码后,则转换为32位。新注册会员直接为32位。 缺点:如果旧会员不修改密码,则一直为16位,仍然对以后数据转换不变。
综合,个人推荐第2种方法,因为32位可以很容易转换为16位,substr(string,8,16),而反之则几乎不可能。
|