merge heihedata branch to trunk from r4110 to r4111

This commit is contained in:
wlx 2013-11-26 13:53:20 +00:00
parent 6127e1766a
commit 8c2b1e4b74
2 changed files with 56 additions and 25 deletions

View File

@ -50,8 +50,13 @@ class Source
"code"=>"code" "code"=>"code"
); );
if($this->website == 'westdc'){ //新浪微博(新浪通行证)
$this->source->sina = new stdClass();
$this->source->sina->param = array(
);
if($this->website == 'westdc'){
$this->source->escience->config = array( $this->source->escience->config = array(
'id' => '71852', 'id' => '71852',
'secret' => 'ad7gd3jZgbzhQM6vIh9vPnQFZQoTGHZI', 'secret' => 'ad7gd3jZgbzhQM6vIh9vPnQFZQoTGHZI',
@ -61,11 +66,9 @@ class Source
'theme'=>'full' 'theme'=>'full'
) )
); );
} }
if($this->website == 'heihedata'){ if($this->website == 'heihedata'){
$this->source->escience->config = array( $this->source->escience->config = array(
'id' => '78969', 'id' => '78969',
'secret' => 'iTGKdCkUPakA2hza2TJ4XZ4cnwlh8Hqz', 'secret' => 'iTGKdCkUPakA2hza2TJ4XZ4cnwlh8Hqz',
@ -75,9 +78,48 @@ class Source
'theme'=>'full' 'theme'=>'full'
) )
); );
} }
if($this->website == 'card'){
$this->source->escience->config = array(
'id' => '58176',
'secret' => 'ZM5dEFX5GpJC62IcJ3iajx51T9hzhJkQ',
'index' => 'http://card.westgis.ac.cn/',
'callback' => 'http://card.westgis.ac.cn/account/callback/type/escience',
'other' => array(
'theme'=>'full'
)
);
}
}
//Oauth2登录目标
/*
name : 名称
code : 获取code的url
token : 获取 token的url
code_response : 获取token时使用的参数值(配合$this->source->OBJECTIVE->param中的code_response使用
grant_type : 获得token的认证方式按照oauth2标准应该是authorization_code
*/
private function initTarget(){
//中国科技网通行证
$this->target->escience = array(
'name' => '中国科技网通行证',
'code' => 'http://passport.escience.cn/oauth2/authorize',
'token' => 'https://passport.escience.cn/oauth2/token',
'code_response' => 'code',
'grant_type' => 'authorization_code',
);
//新浪
$this->target->sina = array(
'name' => '新浪微博',
'code' => 'https://api.weibo.com/oauth2/authorize',
'token' => '',
'code_response' => 'code',
'grant_type' => 'authorization_code'
);
} }
//获得一个源 //获得一个源
@ -96,17 +138,6 @@ class Source
} }
} }
//Oauth2登录目标
private function initTarget(){
$this->target->escience = array(
'name' => '中国科技网通行证',
'code' => 'http://passport.escience.cn/oauth2/authorize',
'token' => 'https://passport.escience.cn/oauth2/token',
'code_response' => 'code',
'grant_type' => 'authorization_code',
);
}
//获得Oauth2登录模板 //获得Oauth2登录模板
public function getTarget($type = "") public function getTarget($type = "")
{ {

View File

@ -100,7 +100,7 @@ class Offlineapp
@unlink($row['applicationform']); @unlink($row['applicationform']);
} }
if($this->db->exec("UPDATE offlineapp SET applicationform=NULL WHERE id=$id")>0) if($this->db->exec("UPDATE offlineapp SET applicationform=NULL,status=2 WHERE id=$id")>0 && $this->db->exec("UPDATE dataorder SET status=2 WHERE offlineappid=$id"))
{ {
@$this->events()->trigger('offlineapp.AppFormReseted', $this, compact('id')); @$this->events()->trigger('offlineapp.AppFormReseted', $this, compact('id'));
return true; return true;