getConf('pam.passport.oidc.info');
$oidctype = $oidcInfo['oidctype'] ? strtoupper($oidcInfo['oidctype']) : '第三方';
$str = '';
$rs = kernel::single('erpapi_router_request')->set('account','account')->user_loginUrl([]);
if($rs['rsp'] == 'succ') {
$str = ''.$oidctype.'信任登陆';
}
return $str;
}
public function login($auth, &$usrdata)
{
}
/**
* callback
* @return mixed 返回值
*/
public function callback() {
$sdf = ['code'=>$_GET['code']];
$_GOTO = kernel::base_url(1).'/index.php?ctl=passport';
if(empty($_GET['code'])) {
die('');
}
kernel::single('base_session')->start();
$rs = kernel::single('erpapi_router_request')->set('account','account')->user_login($sdf);
if($rs['rsp'] == 'succ') {
die('');
}
header('Content-Type:text/html; charset=utf-8');
die('登录失败:' . $rs['msg'].'');
}
/**
* loginout
* @param mixed $auth auth
* @param mixed $backurl backurl
* @return mixed 返回值
*/
public function loginout($auth, $backurl = "index.php")
{
unset($_SESSION['account'][$auth->type]);
unset($_SESSION['last_error']);
$rs = kernel::single('erpapi_router_request')->set('account','account')->user_loginOutUrl([]);
if($rs['rsp'] == 'succ') {
kernel::single('base_session')->destory();
die('');
}
}
/**
* 获取_data
* @return mixed 返回结果
*/
public function get_data()
{
}
/**
* 获取_id
* @return mixed 返回结果
*/
public function get_id()
{
}
/**
* 获取_expired
* @return mixed 返回结果
*/
public function get_expired()
{
}
/**
* 获取_config
* @return mixed 返回结果
*/
public function get_config()
{
$oidc = app::get('ome')->getConf('pam.passport.oidc.enable');
if($oidc != 'true') {
return [];
}
$ret = [];
$ret['shopadmin_passport_status']['value'] = 'true';
return $ret;
}
}