function action_setprefs($eventData) { global $gEnv, $gStatus, $gLocale; $jp_cfg = new ConfigFile(CONFIG_PATH . 'jpcache.cfg', true); $jp_cfg->SetValue('CACHE_TIME', $eventData['cachetime']); $jp_cfg->SetValue('CACHE_ON', $eventData['cacheon'] == 'on' ? '1' : '0'); $jp_cfg->SetValue('USE_GZIP', $eventData['usegzip'] == 'on' ? '1' : '0'); $jp_cfg->SetValue('CACHE_POST', $eventData['cachepost'] == 'on' ? '1' : '0'); $gStatus = $gLocale->GetStr('prefs_set.status'); }
function SetReportsEmail($email) { $cfg = new ConfigFile(AMP_CONFIG); return $cfg->SetValue('MAINTENANCE_REPORTS_EMAIL', $email); }
function pass_edit($eventData) { global $hui_page; $log = new Logger(AMP_LOG); $ampcfg = new ConfigFile(AMP_CONFIG); $ampcfg->SetValue('AMP_NAME', $eventData['name']); $ampcfg->SetValue('AMP_DOMAIN', $eventData['domain']); $ampcfg->SetValue('AMP_DNS', $eventData['dns']); $log->LogEvent('Ampoliros', 'Changed Ampoliros network settings', LOGGER_NOTICE); $hui_page->mJavascript = 'parent.frames.header.location.reload()'; }
function pass_setadvanced($eventData) { global $gPage_status, $gLocale, $gEnv, $gState; $amp_state = ''; switch ($eventData['ampstate']) { case Ampoliros::STATE_DEBUG: $amp_state_str = 'DEBUG'; $amp_state = 'debug'; $amp = Ampoliros::instance('Ampoliros'); $amp->setState(Ampoliros::STATE_DEVELOPMENT); // Do not set it to DEBUG break; case Ampoliros::STATE_DEVELOPMENT: $amp_state_str = 'DEVELOPMENT'; $amp_state = 'development'; $amp = Ampoliros::instance('Ampoliros'); $amp->setState(Ampoliros::STATE_DEVELOPMENT); break; case AMP_STATE_PRODUCTION: $amp_state_str = 'PRODUCTION'; $amp_state = 'production'; $amp = Ampoliros::instance('Ampoliros'); $amp->setState(Ampoliros::STATE_PRODUCTION); break; } if (strlen($amp_state)) { $gState = $eventData['ampstate']; $log = new Logger($gEnv['root']['log']); $amp_cfg = new ConfigFile(AMP_CONFIG); $amp_cfg->SetValue('AMP_STATE', $amp_state); //$gEnv['core']['state'] = $eventData['ampstate']; $log->LogEvent('Ampoliros', 'Changed Ampoliros state to ' . $amp_state_str, LOGGER_NOTICE); $gPage_status = $gLocale->GetStr('advancedset.status'); //$hui_page->mJavascript = 'parent.frames.sum.location.reload()'; } else { $gPage_status = $gLocale->GetStr('advancednotset.status'); } }
public function setAlertEvents($events) { $cfg = new ConfigFile(AMP_CONFIG); $cfg->SetValue('ALERT_ON_WRONG_LOCAL_ROOT_LOGIN', $events['wronglocalrootlogin'] ? '1' : '0'); $cfg->SetValue('ALERT_ON_WRONG_LOCAL_USER_LOGIN', $events['wronglocaluserlogin'] ? '1' : '0'); $cfg->SetValue('ALERT_ON_WRONG_REMOTE_LOGIN', $events['wrongremotelogin'] ? '1' : '0'); $cfg->SetValue('ALERT_ON_MODULE_OPERATION', $events['moduleoperation'] ? '1' : '0'); $cfg->SetValue('ALERT_ON_MODULE_SITE_OPERATION', $events['modulesiteoperation'] ? '1' : '0'); $cfg->SetValue('ALERT_ON_SITE_OPERATION', $events['siteoperation'] ? '1' : '0'); return true; }
function pass_setcountry($eventData) { global $hui_mainstatus, $amp_locale, $hui_page; $log = new Logger(AMP_LOG); $amp_config = new ConfigFile(AMP_CONFIG); $amp_config->SetValue('AMP_COUNTRY', $eventData['country']); $log->LogEvent('Ampoliros', 'Changed Ampoliros root country', LOGGER_NOTICE); $hui_mainstatus->mArgs['status'] = $amp_locale->GetStr('countryset_status'); $hui_page->mArgs['javascript'] = 'parent.frames.sum.location.reload()'; }
function pass_setadvanced($eventData) { global $hui_mainstatus, $amp_locale, $hui_page, $env, $hui_comments, $compressed_ob; $log = new Logger(AMP_LOG); $amp_cfg = new ConfigFile(AMP_CONFIG); $amp_cfg->SetValue('AMP_HUI_COMMENTS', $eventData['hui-comments'] == 'on' ? '1' : '0'); $amp_cfg->SetValue('AMP_COMPRESSED_OB', $eventData['compressed-ob'] == 'on' ? '1' : '0'); $hui_comments = 'false'; $compressed_ob = 'false'; if ($eventData['hui-comments'] == 'on') { $hui_comments = 'true'; } if ($eventData['compressed-ob'] == 'on') { $compressed_ob = 'true'; } $log->LogEvent('Ampoliros', 'Changed Ampoliros advanced interface settings', LOGGER_NOTICE); $hui_mainstatus->mArgs['status'] = $amp_locale->GetStr('advancedset_status'); $hui_page->mArgs['javascript'] = 'parent.frames.sum.location.reload()'; }