Authored by 於志远

Merge branch 'master' of http://git.yoho.cn/web/sso

[memcache]
servers = memcache01.passport.yoho.cn:11111,memcache02.passport.yoho.cn:11111
servers = memcache01.sso.yohoops.org:11111,memcache02.sso.yohoops.org:11111
[memcached]
servers = memcache01.passport.yoho.cn:11111,memcache02.passport.yoho.cn:11111
servers = memcache01.sso.yohoops.org:11111,memcache02.sso.yohoops.org:11111
... ...
... ... @@ -103,7 +103,7 @@ class Controller_Associate extends Controller_Abstract
break;
}
// 执行登录操作,写入Cookie及Session
Facade_Auth::login($data['uid']);
Facade_Auth::login($data['uid'], false, false);
/* 保存第三方应用授权过用户的访问信息 */
$token = $this->_request->post('token', false);
... ...
... ... @@ -26,7 +26,7 @@ class Controller_Login extends Controller_Abstract
//$result = Facade_Auth::checkLogin($account, $password);
//@file_put_contents('/tmp/sso',date('Y-m-d H:i:s', time()).'|'.$account.'|'.$password."\n", FILE_APPEND);
$area = trim($this->_request->area) ;
$result = Facade_Auth::checkLogin($account, $password, true, 0 , true, $area);
$result = Facade_Auth::checkLogin($account, $password, false, 0 , false, $area);
if ( isset($result['uid']) )
{
//构造信息返回
... ...
... ... @@ -149,7 +149,13 @@ class Facade_Auth
*/
public static function isMobile($mobile)
{
return preg_match('/^1[3|4|5|7|8][0-9]\d{8}$/', $mobile);
//999开头测试手机号直接通过验证
if(is_numeric($mobile) && strpos($mobile, '999') === 0){
$ret = true;
}else{
$ret = preg_match('/^1[3|4|5|7|8][0-9]\d{8}$/', $mobile);
}
return $ret;
}
/**
... ... @@ -602,7 +608,7 @@ class Facade_Auth
}
//获取用户口令信息
$auth = self::service()->getAuthByTypeAndAidNocache($auth_type, $account);
$auth = self::service()->getAuthByTypeAndAid($auth_type, $account);
//检测口令是否存在
if (!$auth)
{
... ...
... ... @@ -52,8 +52,11 @@ class Lib_Plugin_Log extends Framework_YPlugin
$output = isset($params['res']) ? (string) $params['res'] : '';
$query = array();
Facade_Log::add($key, $actionName, $input, $output);
//注释掉日志
// Facade_Log::add($key, $actionName, $input, $output);
if(defined('SSO_LOG') && SSO_LOG){
@file_put_contents('/Data/logs/php/sso-abstruct-'.date('Y-m-d').'.log', '时间['.date('H:i:s').']-动作:'.$actionName.' 入参:'.$input.' 出参:'.$output."\n", FILE_APPEND);
}
}
}
}
... ...
<?php
ini_set('display_errors','On');
ini_set('error_reporting ','E_ALL');
//ini_set('display_errors','On');
//ini_set('error_reporting ','E_ALL');
ini_set('display_errors', 'Off');
ini_set("log_errors" , "On");
define('APP_DIR', dirname(__DIR__));
// 定义应用常量
... ...