function getTicket($force)
 {
     if ($force) {
         $result = $this->m2mService->getM2MTicket();
         if (PEAR::isError($result)) {
             throw new Exception($result->getMessage(), $result->getCode());
         }
     }
     $ticket = $this->m2mDal->getM2MTicket($this->m2mService->accountId);
     return $ticket ? $ticket : $this->getTicket(true);
 }
Exemple #2
0
 /**
  * A method to launch and display the widget
  *
  */
 function display()
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     phpAds_PageHeader(null, new OA_Admin_UI_Model_PageHeaderModel(), '', false, false);
     $oTpl = new OA_Admin_Template('dashboard/main.html');
     if (!$aConf['ui']['dashboardEnabled'] || !$aConf['sync']['checkForUpdates']) {
         $dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Disabled');
     } else {
         $m2mTicket = OA_Dal_Central_M2M::getM2MTicket(OA_Permission::getAccountId());
         if (empty($m2mTicket)) {
             $dashboardUrl = MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php?widget=Reload');
         } else {
             $dashboardUrl = $this->buildDashboardUrl($m2mTicket, null, '&');
         }
     }
     $oTpl->assign('dashboardURL', $dashboardUrl);
     $oTpl->display();
     phpAds_PageFooter('', true);
 }