Exemple #1
0
}
// history
if (isset($page['hist_arg']) && CWebUser::$data['alias'] != ZBX_GUEST_USER && $page['type'] == PAGE_TYPE_HTML && !defined('ZBX_PAGE_NO_MENU')) {
    // if URL length is greater than DB field size, skip history update
    $url = getHistoryUrl($page);
    if ($url) {
        DBstart();
        $result = addUserHistory($page['title'], $url);
        DBend($result);
    }
}
// last page
if (!defined('ZBX_PAGE_NO_MENU') && $page['file'] != 'profile.php') {
    CProfile::update('web.paging.lastpage', $page['file'], PROFILE_TYPE_STR);
}
if (CProfile::isModified()) {
    DBstart();
    $result = CProfile::flush();
    DBend($result);
}
// end transactions if they have not been closed already
if (isset($DB) && isset($DB['TRANSACTIONS']) && $DB['TRANSACTIONS'] != 0) {
    error(_('Transaction has not been closed. Aborting...'));
    DBend(false);
}
show_messages();
if (in_array($page['type'], array(PAGE_TYPE_HTML_BLOCK, PAGE_TYPE_HTML))) {
    if (!is_null(CWebUser::$data) && isset(CWebUser::$data['debug_mode']) && CWebUser::$data['debug_mode'] == GROUP_DEBUG_MODE_ENABLED) {
        CProfiler::getInstance()->stop();
        CProfiler::getInstance()->show();
    }
 /**
  * Main controller processing routine. Returns response object: data, redirect or fatal redirect.
  *
  * @return var
  */
 public final function run()
 {
     if ($this->validateSID && !$this->checkSID()) {
         access_deny(ACCESS_DENY_PAGE);
     }
     if ($this->checkInput()) {
         if ($this->checkPermissions() !== true) {
             access_deny(ACCESS_DENY_PAGE);
         }
         $this->doAction();
     }
     if (CProfile::isModified()) {
         DBstart();
         $result = CProfile::flush();
         DBend($result);
     }
     return $this->getResponse();
 }