Ejemplo n.º 1
0
 /**
  * A static method to check if an alert needs to be shown to the user
  *
  * @return bool
  */
 function alertNeeded()
 {
     $aPref = $GLOBALS['_MAX']['PREF'];
     $iLastRun = (int) OA_Dal_ApplicationVariables::get('maintenance_timestamp');
     if ($iLastRun > 0 && !$aPref['maintenance']['autoMaintenance']) {
         if ($iLastRun < time() - 86400) {
             // Update the timestamp to make sure the warning
             // is shown only once every 24 hours
             OA_Dal_Maintenance_UI::updateLastRun();
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 2
0
 function _assignUserAccountInfo($oCurrentSection)
 {
     global $session;
     // Show currently logged on user and IP
     if (OA_Auth::isLoggedIn() || defined('phpAds_installing')) {
         $this->oTpl->assign('helpLink', OA_Admin_Help::getHelpLink($oCurrentSection));
         if (!defined('phpAds_installing')) {
             $this->oTpl->assign('infoUser', OA_Permission::getUsername());
             $this->oTpl->assign('buttonLogout', true);
             $this->oTpl->assign('buttonReportBugs', true);
             // Account switcher
             OA_Admin_UI_AccountSwitch::assignModel($this->oTpl);
             $this->oTpl->assign('strWorkingAs', $GLOBALS['strWorkingAs_Key']);
             $this->oTpl->assign('keyWorkingAs', $GLOBALS['keyWorkingAs']);
             $this->oTpl->assign('accountId', OA_Permission::getAccountId());
             $this->oTpl->assign('accountName', OA_Permission::getAccountName());
             $this->oTpl->assign('accountSearchUrl', MAX::constructURL(MAX_URL_ADMIN, 'account-switch-search.php'));
             $this->oTpl->assign('productUpdatesCheck', OA_Permission::isAccount(OA_ACCOUNT_ADMIN) && $GLOBALS['_MAX']['CONF']['sync']['checkForUpdates'] && !isset($session['maint_update_js']));
             if (OA_Permission::isUserLinkedToAdmin()) {
                 $this->oTpl->assign('maintenanceAlert', OA_Dal_Maintenance_UI::alertNeeded());
             }
         } else {
             $this->oTpl->assign('buttonStartOver', true);
         }
     }
 }