作者归档:shenxiao

修改 ucenter

uc_client\model\user.php

function check_emailformat($email) {
return strlen($email) > 6 && strlen($email) <= 64 && preg_match("/^([A-Za-z0-9\-_.+]+)@([a-z0-9\-]+[.][a-z0-9\-.]+)$/", $email); } 数据库email长度调整 2个表

ucenter

增加邮箱查询用户接口

uc_client\client.php

function uc_get_user_by_email($username) {
$return = call_user_func(UC_API_FUNC, ‘user’, ‘get_user_by_email’, array(‘username’=>$username));
return UC_CONNECT == ‘mysql’ ? $return : uc_unserialize($return);
}

uc_client\control\user.php

function onget_user_by_email() {
$this->init_input();
$username = $this->input(‘username’);
$status = $_ENV[‘user’]->get_user_by_email($username);
if($status) {
return array($status[‘uid’],$status[‘username’],$status[’email’]);
} else {
return 0;
}
}