Ejemplo n.º 1
0
 private function _authorize()
 {
     $acl = Zend_Registry::get('acl');
     $module = $this->_request->getModuleName();
     $controller = $this->_request->getControllerName();
     $action = $this->_request->getActionName();
     $user_roles = $this->_social->getUser()->getRoles();
     $is_authorized = false;
     foreach ($user_roles as $role) {
         if ($acl->isAllowed($role, $module . ':' . $controller, $action)) {
             $is_authorized = true;
             break;
         }
     }
     if (!$is_authorized) {
         $this->_social->handleFailedAuthorization($this->_getRedirectUrlForAuthorization());
     }
 }
Ejemplo n.º 2
0
 function __construct($config)
 {
     parent::__construct($config);
     $this->_client = new apiClient();
     //TODO where is the best place for APPLICATION_NAME ?
     $this->_client->setApplicationName(APPLICATION_NAME);
     $this->_client->setClientId($this->_config->id);
     $this->_client->setClientSecret($this->_config->secret);
     $this->_client->setRedirectUri($this->_config->url);
     //$this->_client->setDeveloperKey('insert_your_developer_key');
     $this->_client->setScopes(array('https://www.googleapis.com/auth/plus.me'));
     $this->_social = new apiPlusService($this->_client);
     try {
         $this->_init();
     } catch (Exception $e) {
         setcookie('access_token', '', time() - 1000);
         unset($_SESSION['access_token']);
         session_destroy();
         die("Please ensure you have a Google Plus account and have authorized this app!");
     }
 }
Ejemplo n.º 3
0
 function __construct($config)
 {
     parent::__construct($config);
     $this->_social = new HTS_Govn_Api(array('appId' => $config->id, 'secret' => $config->secret, 'appUrl' => $config->url, 'proxy.host' => @$config->proxy->host, 'proxy.port' => @$config->proxy->port));
     $this->_init();
 }
Ejemplo n.º 4
0
 function __construct($config)
 {
     parent::__construct($config);
     $this->_user = HTS_Util::getDbRow('users');
 }
Ejemplo n.º 5
0
 function __construct($config)
 {
     parent::__construct($config);
     $this->_facebook = new HTS_Facebook_Api(array('appId' => $config->id, 'secret' => $config->secret, 'proxy.host' => @$config->proxy->host, 'proxy.port' => @$config->proxy->port));
     $this->_init();
 }