Пример #1
0
 public function logout()
 {
     global $USER;
     $token = google_picasa::get_sesskey($USER->id);
     $gauth = new google_authsub($token);
     // revoke token from google
     $gauth->revoke_session_token();
     google_picasa::delete_sesskey($USER->id);
     $this->subauthtoken = '';
     return parent::logout();
 }
Пример #2
0
 public function post_control($stage, $params)
 {
     if ($stage != PORTFOLIO_STAGE_CONFIG) {
         return;
     }
     if (!array_key_exists('token', $params)) {
         throw new portfolio_plugin_exception('noauthtoken', 'portfolio_googledocs');
     }
     // we now have our auth token, get a session token..
     $gauth = new google_authsub(false, $params['token']);
     $this->sessiontoken = $gauth->get_sessiontoken();
     google_docs::set_sesskey($this->sessiontoken, $this->get('user')->id);
 }