信呼OA版本v2.3.8
This commit is contained in:
27
webmain/model/reimplat/oauthModel.php
Normal file
27
webmain/model/reimplat/oauthModel.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
class reimplat_oauthClassModel extends reimplatModel
|
||||
{
|
||||
public function login()
|
||||
{
|
||||
$platsign = $this->rock->session('platsign');
|
||||
if(isempt($platsign))return returnerror('无效登录');
|
||||
$url = $this->geturl('openoauth','oauthinfo', array(
|
||||
'platsign' => $platsign
|
||||
));
|
||||
|
||||
$result = c('curl')->getcurl($url);
|
||||
$barr = $this->recordchu($result);
|
||||
if(!$barr['success'])return $barr;
|
||||
|
||||
$info = $barr['data']['userinfo'];
|
||||
$user = $info['user'];
|
||||
$usr = m('admin')->getone("`status`=1 and `user`='$user'");
|
||||
if(!$usr)return returnerror('oa上用户不存在');
|
||||
c('cache')->set('login'.$usr['user'].'', $usr['id'], 60);
|
||||
|
||||
return returnsuccess(array(
|
||||
'user' => $user,
|
||||
'pass' => md5($usr['pass'])
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user