<horizbar><name>hb</name></horizbar> <button><name>submit</name> <args> <label type="encoded">' . urlencode($gLocale->GetStr('setprefs.submit')) . '</label> <themeimage>button_ok</themeimage> <horiz>true</horiz> <frame>true</frame> <formsubmit>prefs</formsubmit> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'default', ''), array('action', 'setprefs', '')))) . '</action> </args> </button> </children></vertgroup>'; $gPage_content = new HuiXml('page', array('definition' => $xml_def)); } $gMain_disp->AddEvent('stats', 'main_stats'); function main_stats($eventData) { global $gEnv, $gLocale, $gPage_content; $xml_def = '<vertgroup><name>stats</name><children> <grid><name>prefs</name><children> <label row="0" col="0"><name>cacheobjects</name><args><label type="encoded">' . urlencode($gLocale->GetStr('cacheobjects.label')) . '</label></args></label> <string row="0" col="1"><name>cacheobjects</name><args><readonly>true</readonly><size>5</size><value>' . cache_objects() . '</value></args></string> </children></grid> </children></vertgroup>'; $gPage_content = new HuiXml('page', array('definition' => $xml_def)); } $gMain_disp->Dispatch(); // Rendering // $gHui->AddChild(new HuiAmpPage('page', array('pagetitle' => $gTitle, 'menu' => $gMenu, 'toolbars' => array(new HuiAmpToolBar('main', array('toolbars' => $gToolbars))), 'maincontent' => $gPage_content, 'status' => $gStatus))); $gHui->Render();
DoAuth(true); } // unset( $AMPROOT_AUTH_USER ); } $login_disp->AddEvent('logout', 'login_logout'); function login_logout($eventData) { Carthag::import('com.solarix.ampoliros.security.SecurityLayer'); $amp_security = new SecurityLayer(); $amp_security->LogAccess($_SESSION['AMP_AUTH_USER'], true, false, $_SERVER['REMOTE_ADDR']); session_unregister('AMP_AUTH_USER'); unset($_SESSION['AMP_AUTH_USER']); unset($amp_security); DoAuth(); } $login_disp->Dispatch(); } if ($GLOBALS['gEnv']['core']['config']->Value('ONLY_HTTPS_SITE_ACCESS') == '1') { if (!isset($_SERVER['HTTPS']) or $_SERVER['HTTPS'] != 'on') { DoAuth(true, 'only_https_allowed'); } } if (!isset($_SESSION['AMP_AUTH_USER'])) { DoAuth(); } $sitesquery = $gEnv['root']['db']->Execute('SELECT id FROM sites WHERE siteid=' . $gEnv['root']['db']->Format_Text(GetStoreID($gEnv['root']['db'], $_SESSION['AMP_AUTH_USER']))); if ($sitesquery->NumRows() == 0) { DoAuth(); } else { $sitesquery->Free(); $amp->startSite(GetStoreID($gEnv['root']['db'], $_SESSION['AMP_AUTH_USER']), $_SESSION['AMP_AUTH_USER']);
<args> <horiz>true</horiz> <frame>false</frame> <themeimage>button_ok</themeimage> <label type="encoded">' . urlencode($amp_locale->GetStr('set_motd.submit')) . '</label> <formsubmit>motd</formsubmit> <action type="encoded">' . urlencode(build_events_call_string('', array(array('main', 'motd', ''), array('pass', 'setmotd', '')))) . '</action> </args> </button> </children> </vertgroup>'; $hui_mainframe->AddChild(new HuiXml('page', array('definition' => $xml_def))); $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('motd.title'); } } $main_disp->AddEvent('help', 'main_help'); function main_help($eventData) { global $env, $hui_titlebar, $hui_mainframe, $amp_locale; $hui_titlebar->mTitle .= ' - ' . $amp_locale->GetStr('help_title'); $hui_mainframe->AddChild(new HuiHelpNode('profiles_help', array('node' => 'ampoliros.site.profiles.' . $eventData['node'], 'language' => $env['sitelocale']))); } $main_disp->Dispatch(); // Page render // $hui_mainvertgroup->AddChild($hui_mainframe); $hui_mainvertgroup->AddChild($hui_mainstatus); $hui_page->AddChild($hui_mainvertgroup); $hui->AddChild($hui_page); $hui->Render();
global $hui_mainstatus, $amp_locale, $log; setup_ampcentral($eventData, $log); } $pass_disp->AddEvent('cleanup', 'pass_cleanup'); function pass_cleanup($eventData) { global $hui_mainstatus, $amp_locale, $log; setup_cleanup($eventData, $log); } $pass_disp->AddEvent('finish', 'pass_finish'); function pass_finish($eventData) { global $hui_mainstatus, $amp_locale, $log; setup_finish($eventData, $log); } $pass_disp->Dispatch(); // Checks if all setup phases are completed // if (setup_check_lock_files()) { // Removes setup lock files // setup_remove_lock_files(); if (!setup_remove_setup_lock_file()) { $log->logevent('ampoliros.root.main_php', 'Unable to remove lock file during initialization', LOGGER_ERROR); } } clearstatcache(); // Checks if there are remaining setup phases // if (!file_exists(AMP_SETUP_LOCK)) { main_page(TRUE);