示例#1
0
 /**
  * Returns the account information for the current user (the user associated
  * with the API key used)
  * 
  * No params required
  *
  */
 public function get($params)
 {
     $otAccount = new Ot_Model_DbTable_Account();
     if (!Zend_Auth::getInstance()->hasIdentity()) {
         throw new Ot_Exception_Access('msg-error-apiAccessDenied');
     }
     $accountId = Zend_Auth::getInstance()->getIdentity()->accountId;
     $accountInfo = $otAccount->find($accountId);
     if (is_null($accountInfo)) {
         throw new Ot_Exception_Data('msg-error-noAccount');
     }
     unset($accountInfo->password);
     unset($accountInfo->role);
     return $accountInfo;
 }
 /**
  * Displays a list of all the api apps registered with application
  * regardless of the user who registered the app
  */
 public function allAppsAction()
 {
     $apiApp = new Ot_Model_DbTable_ApiApp();
     $account = new Ot_Model_DbTable_Account();
     $allApps = $apiApp->fetchAll(null, 'name ASC')->toArray();
     foreach ($allApps as &$a) {
         $user = $account->find($a['accountId']);
         if (!is_null($user)) {
             $a['user'] = $user;
         }
     }
     unset($a);
     $this->view->allApps = $allApps;
     $this->_helper->pageTitle('ot-apiapp-allApps:title', $this->_helper->configVar('appTitle'));
 }