function ajax_dashstatus() { $sinfo = Service::ServiceData(SInfo::DATA_Status_LV); $listeners = $sinfo->Get(SInfo::FLD_Listener); $body = ''; $running = 0; $broken = ''; foreach ($listeners as $lname => $l) { $body .= '<tr><td class="'; if (isset($l['addr'])) { $body .= 'success"><i class="fa fa-link"></i>'; $running++; $addr = $l['addr']; } else { $body .= 'danger"><i class="fa fa-unlink"></i>'; $broken++; $addr = $l['daddr']; } $body .= '</td><td>' . $lname . ' </td><td>' . $addr . '</td></tr>' . "\n"; } $vhosts = $sinfo->Get(SInfo::FLD_VHosts); $vrunning = 0; $vdisabled = ''; $verrors = ''; $vbody = ''; $note_stopped = DMsg::ALbl('service_stopped'); $note_running = DMsg::ALbl('service_running'); $note_suspendvh = DMsg::ALbl('service_suspendvh'); $note_enablevh = DMsg::ALbl('service_enablevh'); $note_disabled = DMsg::ALbl('service_disabled'); foreach ($vhosts as $vn => $vh) { $vbody .= '<tr data-vn="' . $vn . '"><td>'; if ($vh['running'] == -1) { $verrors++; $vbody .= '<span class="text-danger" title="' . $note_stopped . '"><i class="fa fa-ban"></i></span> '; $actions = ''; } elseif ($vh['running'] == 1) { $vrunning++; $vbody .= '<span class="text-success" title="' . $note_running . '"><i class="fa fa-rocket"></i></span> '; $actions = '<a class="btn btn-warning btn-xs" data-action="lstvhcontrol" data-lstact="disable" title="' . $note_suspendvh . '"><i class="fa fa-pause"></i></a>'; } else { $vdisabled++; $vbody .= '<span class="text-warning" title="' . $note_disabled . '"><i class="fa fa-stop"></i></span> '; $actions = '<a class="btn btn-success btn-xs" data-action="lstvhcontrol" data-lstact="enable" title="' . $note_enablevh . '"><i class="fa fa-play"></i></a>'; } $vbody .= '</td><td>' . htmlspecialchars(wordwrap($vn, 40, "\n", true)) . '</td><td>'; if (isset($vh['templ'])) { $vbody .= $vh['templ']; } $vbody .= '</td><td>'; if (isset($vh['domains'])) { $vbody .= htmlspecialchars(wordwrap(implode("\n", array_keys($vh['domains'])), 60, "\n", true)); } $vbody .= '</td><td>'; $vbody .= $actions; $vbody .= '</td></tr>'; } $res = array('l_running' => $running, 'l_broken' => $broken, 'v_running' => $vrunning, 'v_disabled' => $vdisabled, 'v_err' => $verrors, 'l_body' => $body, 'v_body' => $vbody); echo json_encode($res); }
public function Render($blocked_version = 0) { $buf = '<a href="javascript:void(0);" rel="popover" data-placement="right" data-original-title="<i class=\'fa fa-fw fa-tag\'></i> <strong>' . $this->name . '</strong>" data-html="true" data-content=\'<div>'; switch ($blocked_version) { case 0: break; case 1: // LSWS ENTERPRISE; $buf .= ' <i>' . DMsg::UIStr('note_entfeature') . '</i>'; break; case 2: // LSWS 2CPU + // LSWS 2CPU + case 3: // LSLB 2CPU + $buf .= ' <i>' . DMsg::UIStr('note_multicpufeature') . '</i>'; break; } $buf .= $this->desc . '<br><br>'; if ($this->syntax) { $buf .= '<strong>' . DMsg::UIStr('note_syntax') . ':</strong> ' . $this->syntax . '<br><br>'; } if ($this->example) { $buf .= '<strong>' . DMsg::UIStr('note_example') . ':</strong> ' . $this->example . '<br><br>'; } if ($this->tips) { $buf .= '<strong>' . DMsg::UIStr('note_tips') . ':</strong><ul type=circle>'; $tips = explode('<br/>', $this->tips); foreach ($tips as $ti) { $ti = trim($ti); if ($ti != '') { $buf .= '<li>' . $ti . '</li>'; } } $buf .= '</ul>'; } $buf .= '</div>\'><i class="icon-prepend fa fa-question-circle text-muted"></i></a>'; return $buf; }
</form> </div> <p id="dash_logfoundmesg" class="alert alert-info no-margin"></p> </p> <!-- widget div--> <!-- content goes here --> <table id="dash_logtbl" class="table table-condensed table-hover" width="100%"> <thead><tr><th width="150"><?php DMsg::EchoUIStr('service_time'); ?> </th><th width="60"><?php DMsg::EchoUIStr('service_level'); ?> </th><th><?php DMsg::EchoUIStr('service_mesg'); ?> </th></tr></thead> <tbody id="dash_logbody" class="font-lstlog"> <tr><td></td><td></td><td></td></tr> </tbody> </table> <!-- end content --> </article> </div> <script type="text/javascript"> /* DO NOT REMOVE : GLOBAL FUNCTIONS! * * pageSetUp() is needed whenever you load a page. * It initializes and checks for all basic elements of the page
protected function process_config() { //init here $this->_disp->InitConf(); $this->loadConfig(); $confdata = $this->getConfData($this->_disp); $needTrim = 0; $tblDef = DTblDef::GetInstance(); $disp_act = $this->_disp->Get(DInfo::FLD_ACT); if ($disp_act == 's') { $validator = new ConfValidation(); $extracted = $validator->ExtractPost($this->_disp); if ($extracted->HasErr()) { $this->_disp->Set(DInfo::FLD_ACT, 'S'); $this->_disp->Set(DInfo::FLD_TopMsg, $extracted->Get(CNode::FLD_ERR)); return $extracted; } else { $confdata->SavePost($extracted, $this->_disp); $this->setChanged(true); $needTrim = 2; } } elseif ($disp_act == 'a') { $added = new CNode(CNode::K_EXTRACTED, ''); return $added; } elseif ($disp_act == 'c' || $disp_act == 'n') { // 'c': change, 'n': next $validator = new ConfValidation(); $extracted = $validator->ExtractPost($this->_disp); if ($disp_act == 'n') { $this->_disp->SwitchToSubTid($extracted); } return $extracted; } elseif ($disp_act == 'D') { $confdata->DeleteEntry($this->_disp); $needTrim = 1; } elseif ($disp_act == 'I') { if ($this->instantiateTemplate()) { $needTrim = 1; } } elseif ($disp_act == 'd' || $disp_act == 'i') { if ($disp_act == 'd') { $actions = 'DC'; $mesg = DMsg::UIStr('note_confirm_delete'); } else { $actions = 'IC'; $mesg = DMsg::UIStr('note_confirm_instantiate'); } $adata = $this->_disp->GetActionData($actions); $mesg = '<p>' . $mesg . '</p>' . UI::GetActionButtons($adata, 'text'); $this->_disp->Set(DInfo::FLD_TopMsg, $mesg); } $ctxseq = UIBase::GrabGoodInputWithReset('ANY', 'ctxseq', 'int'); if ($ctxseq != 0) { if ($this->_curOne->ChangeContextSeq($ctxseq)) { $needTrim = 1; } } if ($needTrim) { $this->_disp->TrimLastId(); // need reload $this->loadConfig(); $confdata = $this->getConfData($this->_disp); } return $confdata; }
public static function Get_LangDropdown() { $langlist = DMsg::GetSupportedLang($curlang); $buf = '<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span>' . $langlist[$curlang][0] . '</span> <i class="fa fa-angle-down"></i> </a> <ul id="lst-lang" class="dropdown-menu pull-right">'; foreach ($langlist as $lang => $linfo) { $buf .= '<li data-lang="' . $lang . '"'; if ($lang == $curlang) { $buf .= ' class="active"'; } $buf .= '><a href="javascript:void(0);">' . $linfo[0] . '</a></li>'; } $buf .= "</ul>\n"; return $buf; }
DMsg::EchoUIStr('btn_yes'); ?> ") { $.ajax({ type: "POST", url: "view/serviceMgr.php", data: {"act": "toggledebug"}, beforeSend: function () { $.smallBox({ title: "<?php DMsg::EchoUIStr('service_requesting'); ?> ", content: "<i class='fa fa-clock-o'></i> <i><?php DMsg::EchoUIStr('service_willrefresh'); ?> </i>", color: "#659265", iconSmall: "fa fa-check fa-2x fadeInRight animated", timeout: 2200 }); }, success: function (data) { setTimeout(refreshLog, 2000); } }); } });
<!-- SHORTCUT AREA : With large tiles (activated via clicking user name tag) --> <div id="shortcut"> <ul> <li> <a href="javascript:lst_restart()" class="jarvismetro-tile big-cubes bg-color-greenLight"> <span class="iconbox"> <i class="fa fa-repeat fa-4x"></i> <span><?php echo DMsg::UIStr('menu_restart'); ?> </span> </span> </a> </li> <li> <a href="#view/realtimestats.php" class="jarvismetro-tile big-cubes bg-color-blue"> <span class="iconbox"> <i class="fa fa-bar-chart-o fa-4x"></i> <span><?php echo DMsg::UIStr('menu_rtstats'); ?> </span> </span> </a> </li> <li> <a href="#view/logviewer.php" class="jarvismetro-tile big-cubes bg-color-orange"> <span class="iconbox"> <i class="fa fa-list fa-4x"></i> <span><?php echo DMsg::UIStr('menu_logviewer'); ?> </span> </span> </a> </li> <li> <a href="javascript:lst_toggledebug()" class="jarvismetro-tile big-cubes bg-color-purple"> <span class="iconbox"> <i class="fa fa-bug fa-4x"></i> <span><?php echo DMsg::UIStr('menu_toggledebug'); ?> </span> </span> </a> </li> </ul> </div> <!-- END SHORTCUT AREA -->
private function get_print_inputline($dlayer, $disp, $attr) { if ($attr->IsFlagOn(DAttr::BM_NOEDIT)) { return ''; } if ($attr->_type == 'sel1') { $attr->SetDerivedSelOptions($disp->GetDerivedSelOptions($this->_id, $attr->_minVal, $dlayer)); } $is_blocked = $attr->blockedVersion(); $helppop = ''; if (($dhelp_item = DMsg::GetAttrTip($attr->_helpKey)) != NULL) { $helppop = '<span class="lst-tooltip">' . $dhelp_item->Render($is_blocked ? $attr->_version : 0) . '</span>'; } $buf = $attr->toInputGroup($dlayer, $is_blocked, $helppop); return $buf; }
public function GenerateScript(&$error, &$optionsaved) { if ($this->progress_file == NULL) { if (!$this->init($error, $optionsaved)) { return FALSE; } } $params = array(); $params['__php_version__'] = $this->options->GetValue('PHPVersion'); $params['__progress_f__'] = $this->progress_file; $params['__log_file__'] = $this->log_file; $processUser = posix_getpwuid(posix_geteuid()); $gidinfo = posix_getgrgid($processUser['gid']); $params['__php_usr__'] = $processUser['name']; $params['__php_usrgroup__'] = $gidinfo['name']; $params['__extra_path_env__'] = $this->options->GetValue('ExtraPathEnv'); $params['__php_build_dir__'] = BuildConfig::Get(BuildConfig::BUILD_DIR); $params['__dl_method__'] = $this->dlmethod; $params['__install_dir__'] = $this->options->GetValue('InstallPath'); $params['__compiler_flags__'] = $this->options->GetValue('CompilerFlags'); $params['__enable_mailheader__'] = $this->options->GetValue('AddOnMailHeader') ? 1 : 0; $params['__lsapi_version__'] = BuildConfig::GetVersion(BuildConfig::LSAPI_VERSION); $params['__php_conf_options__'] = $this->options->GetValue('ConfigParam'); $params['__lsws_home__'] = SERVER_ROOT; $params['__install_script__'] = $this->build_install_script; $search = array_keys($params); $replace = array_values($params); //common header $template_file = 'build_common.template'; $template = file_get_contents($template_file, true); if ($template === false) { $error = DMsg::Err('err_failreadfile') . $template_file; return false; } $template_script = str_replace($search, $replace, $template); $prepare_script = $template_script; $install_script = $template_script; // prepare php $template_file = 'build_prepare.template'; $template = file_get_contents($template_file, true); if ($template === false) { $error = DMsg::Err('err_failreadfile') . $template_file; return false; } $template_script = str_replace($search, $replace, $template); $prepare_script .= $template_script; // install php $template_file2 = 'build_install.template'; $template2 = file_get_contents($template_file2, true); if ($template2 === false) { $error = DMsg::Err('err_failreadfile') . $template_file2; return false; } $template_script2 = str_replace($search, $replace, $template2); $install_script .= $template_script2; //prepare extension $template_file = 'build_prepare_ext.template'; $template = file_get_contents($template_file, true); if ($template === false) { $error = DMsg::Err('err_failreadfile') . $template_file; return false; } //install extension $template_file2 = 'build_install_ext.template'; $template2 = file_get_contents($template_file2, true); if ($template2 === false) { $error = DMsg::Err('err_failreadfile') . $template_file2; return false; } $extList = array(); if ($this->options->GetValue('AddOnSuhosin')) { $extList[] = 'Suhosin'; } if ($this->options->GetValue('AddOnAPC')) { $extList[] = 'APC'; } if ($this->options->GetValue('AddOnXCache')) { $extList[] = 'XCache'; } if ($this->options->GetValue('AddOnMemCache')) { $extList[] = 'MemCache'; } // if ($this->options->GetValue('AddOnMemCached')) { // $extList[] = 'MemCached'; // } if ($this->options->GetValue('AddOnOPcache')) { $extList[] = 'OPcache'; } foreach ($extList as $extName) { $newparams = array_merge($params, $this->ext_options[$extName]); $search = array_keys($newparams); $replace = array_values($newparams); $template_script = str_replace($search, $replace, $template); $prepare_script .= $template_script; $template_script2 = str_replace($search, $replace, $template2); $install_script .= $template_script2; } $this->extension_used = implode('.', $extList); $prepare_script .= 'main_msg "**DONE**"' . "\n"; $install_script .= 'main_msg "**DONE**"' . "\n"; if (file_put_contents($this->build_prepare_script, $prepare_script) === FALSE) { $error = DMsg::Err('buildphp_errcreatescript') . $this->build_prepare_script; return false; } if (chmod($this->build_prepare_script, 0700) == FALSE) { $error = DMsg::Err('buildphp_errchmod') . $this->build_prepare_script; return false; } if (file_put_contents($this->build_install_script, $install_script) === FALSE) { $error = DMsg::Err('buildphp_errcreatescript') . $this->build_install_script; return false; } if (chmod($this->build_install_script, 0700) == FALSE) { $error = DMsg::Err('buildphp_errchmod') . $this->build_install_script; return false; } // final manual run script $template_file = 'build_manual_run.template'; $template = file_get_contents($template_file, true); if ($template === false) { $error = DMsg::Err('err_failreadfile') . $template_file; return false; } $template_script = str_replace($search, $replace, $template); if (file_put_contents($this->build_manual_run_script, $template_script) === FALSE) { $error = DMsg::Err('buildphp_errcreatescript') . $this->build_manual_run_script; return false; } if (chmod($this->build_manual_run_script, 0700) == FALSE) { $error = DMsg::Err('buildphp_errchmod') . $this->build_manual_run_script; return false; } return true; }
protected function defineAll() { $id = 'g'; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('', array('S_PROCESS', 'S_GENERAL', 'S_INDEX', new DTblMap('expires', 'A_EXPIRES'), 'S_FILEUPLOAD', new DTblMap('*geoipdb$geoipDBFile', 'S_GEOIP_TOP', 'S_GEOIP')), new DTblMap('*index', array('S_MIME_TOP', 'S_MIME')))); $this->_pageDef['serv'][$id] = $page; $id = 'log'; $page = new DPage($id, DMsg::UIStr('tab_log'), new DTblMap('', array(new DTblMap('errorlog$fileName', 'S_LOG'), new DTblMap('accesslog$fileName', 'S_ACLOG')))); $this->_pageDef['serv'][$id] = $page; $id = 'tuning'; $page = new DPage($id, DMsg::UIStr('tab_tuning'), new DTblMap('tuning', array('S_TUNING_OS', 'S_TUNING_CONN', 'S_TUNING_REQ', 'S_TUNING_STATIC', 'S_TUNING_GZIP', 'S_TUNING_SSL'))); $this->_pageDef['serv'][$id] = $page; $id = 'sec'; $page = new DPage($id, DMsg::UIStr('tab_sec'), new DTblMap('', array(new DTblMap('fileAccessControl', 'S_SEC_FILE'), new DTblMap('perClientConnLimit', 'S_SEC_CONN'), new DTblMap('CGIRLimit', 'S_SEC_CGI'), new DTblMap('accessDenyDir', 'S_SEC_DENY'), new DTblMap('accessControl', 'A_SEC_AC')))); $this->_pageDef['serv'][$id] = $page; $id = 'ext'; $page = new DPage($id, DMsg::UIStr('tab_ext'), new DTblMap('*extprocessor$name', 'A_EXT_TOP', array('A_EXT_SEL', 'A_EXT_FCGI', 'A_EXT_FCGIAUTH', 'A_EXT_LSAPI', 'A_EXT_SERVLET', 'A_EXT_PROXY', 'A_EXT_LOGGER', 'A_EXT_LOADBALANCER'))); $this->_pageDef['serv'][$id] = $page; $id = 'sh'; $page = new DPage($id, DMsg::UIStr('tab_sh'), new DTblMap('scripthandler:*addsuffix$suffix', 'A_SCRIPT_TOP', 'A_SCRIPT')); $this->_pageDef['serv'][$id] = $page; $id = 'rails'; $page = new DPage($id, DMsg::UIStr('tab_rails'), new DTblMap('railsDefaults', 'S_RAILS')); $this->_pageDef['serv'][$id] = $page; $id = 'mod'; $page = new DPage($id, DMsg::UIStr('tab_mod'), new DTblMap('*module$name', 'S_MOD_TOP', 'S_MOD')); $this->_pageDef['serv'][$id] = $page; $id = 'top'; $page = new DPage($id, DMsg::UIStr('tab_top'), new DTblMap('*listener$name', 'L_TOP', 'L_GENERAL')); $this->_pageDef['sl'][$id] = $page; $id = 'lg'; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('*listener$name', array('L_GENERAL', new DTblMap('*vhmap$vhost', 'L_VHMAP_TOP', 'L_VHMAP')))); $this->_pageDef['sl_'][$id] = $page; $id = 'lsec'; $page = new DPage($id, DMsg::UIStr('tab_ssl'), new DTblMap('*listener$name', array('LVT_SSL_CERT', 'LVT_SSL', 'L_SSL_FEATURE', 'LVT_SSL_OCSP', 'LVT_SSL_CLVERIFY'))); $this->_pageDef['sl_'][$id] = $page; $id = 'lmod'; $page = new DPage($id, DMsg::UIStr('tab_mod'), new DTblMap('*listener$name', new DTblMap('*module$name', 'L_MOD_TOP', 'L_MOD'))); $this->_pageDef['sl_'][$id] = $page; $id = 'top'; $page = new DPage($id, DMsg::UIStr('tab_top'), new DTblMap('*virtualhost$name', 'V_TOP', 'V_TOPD')); $this->_pageDef['vh'][$id] = $page; //$id = 'top'; $page = new DPage($id, DMsg::UIStr('tab_top'), new DTblMap('*vhTemplate$name', 'T_TOP', 'T_TOPD')); $this->_pageDef['tp'][$id] = $page; $id = 'mbr'; $page = new DPage($id, DMsg::UIStr('tab_tp'), new DTblMap('*vhTemplate$name', array('T_TOPD', new DTblMap('*member$vhName', 'T_MEMBER_TOP', 'T_MEMBER')))); $this->_pageDef['tp_'][$id] = $page; $id = 'base'; $page = new DPage($id, DMsg::UIStr('tab_base'), new DTblMap('*virtualhost$name', array('V_BASE', 'V_BASE_CONN', 'V_BASE_SEC', 'V_BASE_THROTTLE'))); $this->_pageDef['vh_'][$id] = $page; $id = 'g'; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('', array('V_GENERAL', new DTblMap('index', 'VT_INDXF'), new DTblMap('*errorpage$errCode', 'VT_ERRPG_TOP', 'VT_ERRPG'), new DTblMap('expires', 'A_EXPIRES'), 'VT_FILEUPLOAD'))); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('', array('T_GENERAL1', new DTblMap('virtualHostConfig', array('T_GENERAL2', new DTblMap('index', 'VT_INDXF'), new DTblMap('*errorpage$errCode', 'VT_ERRPG_TOP', 'VT_ERRPG'), new DTblMap('scripthandler', new DTblMap(array('*scriptHandler', '*addsuffix$suffix'), 'A_SCRIPT')), new DTblMap('expires', 'A_EXPIRES'), 'VT_FILEUPLOAD'))))); $this->_pageDef['tp_'][$id] = $page; $id = 'log'; $page = new DPage($id, DMsg::UIStr('tab_log'), new DTblMap('', array(new DTblMap('errorlog$fileName', 'V_LOG'), new DTblMap('accesslog$fileName', 'V_ACLOG')))); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_log'), new DTblMap('virtualHostConfig', array(new DTblMap('errorlog$fileName', 'T_LOG'), new DTblMap('accesslog$fileName', 'T_ACLOG')))); $this->_pageDef['tp_'][$id] = $page; $id = 'sec'; $page = new DPage($id, DMsg::UIStr('tab_sec'), new DTblMap('', array(new DTblMap('accessControl', 'A_SEC_AC'), new DTblMap('*realm$name', 'V_REALM_TOP', 'V_REALM_FILE')), new DTblMap('*index', array('V_UDB_TOP', 'V_UDB', 'V_GDB_TOP', 'V_GDB')))); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_sec'), new DTblMap('', array('T_SEC_FILE', 'T_SEC_CONN', 'T_SEC_CGI', new DTblMap('virtualHostConfig', array(new DTblMap('accessControl', 'A_SEC_AC'), new DTblMap('*realm$name', 'T_REALM_TOP', 'T_REALM_FILE')))))); $this->_pageDef['tp_'][$id] = $page; $id = 'ext'; $page = new DPage($id, DMsg::UIStr('tab_ext'), new DTblMap('*extprocessor$name', 'A_EXT_TOP', array('A_EXT_SEL', 'A_EXT_FCGI', 'A_EXT_FCGIAUTH', 'A_EXT_LSAPI', 'A_EXT_SERVLET', 'A_EXT_PROXY', 'A_EXT_LOGGER', 'A_EXT_LOADBALANCER'))); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_ext'), new DTblMap('virtualHostConfig:*extprocessor$name', 'T_EXT_TOP', array('T_EXT_SEL', 'T_EXT_FCGI', 'T_EXT_FCGIAUTH', 'T_EXT_LSAPI', 'T_EXT_SERVLET', 'T_EXT_PROXY', 'T_EXT_LOGGER', 'T_EXT_LOADBALANCER'))); $this->_pageDef['tp_'][$id] = $page; $id = 'sh'; $page = new DPage($id, DMsg::UIStr('tab_sh'), new DTblMap('scripthandler:*addsuffix$suffix', 'A_SCRIPT_TOP', 'A_SCRIPT')); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_sh'), new DTblMap('virtualHostConfig:scripthandler:*addsuffix$suffix', 'A_SCRIPT_TOP', 'A_SCRIPT')); $this->_pageDef['tp_'][$id] = $page; $id = 'rw'; $page = new DPage($id, DMsg::UIStr('tab_rewrite'), new DTblMap('rewrite', array('VT_REWRITE_CTRL', new DTblMap('*map$name', 'VT_REWRITE_MAP_TOP', 'VT_REWRITE_MAP'), 'VT_REWRITE_RULE'))); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_rewrite'), new DTblMap('virtualHostConfig:rewrite', array('VT_REWRITE_CTRL', new DTblMap('*map$name', 'VT_REWRITE_MAP_TOP', 'VT_REWRITE_MAP'), 'VT_REWRITE_RULE'))); $this->_pageDef['tp_'][$id] = $page; $id = 'ctx'; $page = new DPage($id, DMsg::UIStr('tab_ctx'), new DTblMap('*context$uri', 'VT_CTX_TOP', array('VT_CTX_SEL', 'VT_CTXG', 'VT_CTXJ', 'VT_CTXS', 'VT_CTXF', 'VT_CTXL', 'VT_CTXP', 'VT_CTXC', 'VT_CTXB', 'VT_CTXR', 'VT_CTXRL', 'VT_CTXMD'))); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_ctx'), new DTblMap('virtualHostConfig:*context$uri', 'VT_CTX_TOP', array('VT_CTX_SEL', 'VT_CTXG', 'VT_CTXJ', 'VT_CTXS', 'VT_CTXF', 'VT_CTXL', 'VT_CTXP', 'VT_CTXC', 'VT_CTXB', 'VT_CTXR', 'VT_CTXRL'))); $this->_pageDef['tp_'][$id] = $page; $id = 'vhssl'; $page = new DPage($id, DMsg::UIStr('tab_ssl'), new DTblMap('vhssl', array('LVT_SSL_CERT', 'LVT_SSL', 'VT_SSL_FEATURE', 'LVT_SSL_OCSP', 'LVT_SSL_CLVERIFY'))); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_ssl'), new DTblMap('virtualHostConfig:vhssl', array('LVT_SSL_CERT', 'LVT_SSL', 'VT_SSL_FEATURE', 'LVT_SSL_OCSP', 'LVT_SSL_CLVERIFY'))); $this->_pageDef['tp_'][$id] = $page; $id = 'wsp'; $page = new DPage($id, DMsg::UIStr('tab_wsp'), new DTblMap('*websocket$uri', 'VT_WBSOCK_TOP', 'VT_WBSOCK')); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_wsp'), new DTblMap('virtualHostConfig:*websocket$uri', 'VT_WBSOCK_TOP', 'VT_WBSOCK')); $this->_pageDef['tp_'][$id] = $page; $id = 'mod'; $page = new DPage($id, DMsg::UIStr('tab_mod'), new DTblMap('*module$name', array('VT_MOD_TOP', new DTblMap('*urlFilter$uri', NULL, array('VT_MOD_FILTERTOP', 'VT_MOD_FILTER'))), 'VT_MOD')); $this->_pageDef['vh_'][$id] = $page; $page = new DPage($id, DMsg::UIStr('tab_mod'), new DTblMap('virtualHostConfig:*module$name', array('VT_MOD_TOP', new DTblMap('*urlFilter$uri', NULL, array('VT_MOD_FILTERTOP', 'VT_MOD_FILTER'))), 'VT_MOD')); $this->_pageDef['tp_'][$id] = $page; $id = 'g'; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('', array('ADM_PHP', new DTblMap('errorlog$fileName', 'V_LOG'), new DTblMap('accesslog$fileName', 'ADM_ACLOG'), new DTblMap('accessControl', 'A_SEC_AC')))); $this->_pageDef['admin'][$id] = $page; $id = 'usr'; $page = new DPage($id, DMsg::UIStr('tab_user'), new DTblMap('*index', 'ADM_USR_TOP', array('ADM_USR', 'ADM_USR_NEW'))); $this->_pageDef['admin'][$id] = $page; $id = 'top'; $page = new DPage($id, DMsg::UIStr('tab_top'), new DTblMap('*listener$name', 'ADM_L_TOP', 'ADM_L_GENERAL')); $this->_pageDef['al'][$id] = $page; $id = 'lg'; $page = new DPage($id, DMsg::UIStr('tab_g'), new DTblMap('*listener$name', 'ADM_L_GENERAL')); $this->_pageDef['al_'][$id] = $page; $id = 'lsec'; $page = new DPage($id, DMsg::UIStr('tab_ssl'), new DTblMap('*listener$name', array('LVT_SSL_CERT', 'LVT_SSL', 'L_SSL_FEATURE', 'LVT_SSL_CLVERIFY'))); $this->_pageDef['al_'][$id] = $page; }
<?php if ($argc == 1) { echo "Usage: {$argv['0']} lang [mixed]\n\t\tlang is the language file you want to sort.\n\t\tIf supply 2nd param mixed, the translated file will mix all the tags. \n\n"; return; } include '../../lib/DMsg.php'; DMsg::Util_SortMsg($argv[1], $argv[2]);
protected function add_LVT_SSL_CLVERIFY($id) { $attrs = array(DTblDefBase::NewSelAttr('clientVerify', DMsg::ALbl('l_clientverify'), array('0' => 'none', '1' => 'optional', '2' => 'require', '3' => 'optional_no_ca')), DTblDefBase::NewIntAttr('verifyDepth', DMsg::ALbl('l_verifydepth'), true, 0, 100), DTblDefBase::NewTextAttr('crlPath', DMsg::ALbl('l_crlpath'), 'cust'), DTblDefBase::NewTextAttr('crlFile', DMsg::ALbl('l_crlfile'), 'cust')); $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_clientverify'), $attrs); }
<?php require_once "inc/auth.php"; $act = UIBase::GrabGoodInput("any", 'act'); $actId = UIBase::GrabGoodInput("any", 'actId'); switch ($act) { case 'restart': Service::ServiceRequest(SInfo::SREQ_RESTART_SERVER); break; case 'lang': DMsg::SetLang($actId); break; case 'toggledebug': Service::ServiceRequest(SInfo::SREQ_TOGGLE_DEBUG); break; case 'reload': if ($actId != '') { Service::ServiceRequest(SInfo::SREQ_VH_RELOAD, $actId); } break; case 'disable': if ($actId != '') { Service::ServiceRequest(SInfo::SREQ_VH_DISABLE, $actId); } break; case 'enable': if ($actId != '') { Service::ServiceRequest(SInfo::SREQ_VH_ENABLE, $actId); } break; default:
function print_step_4() { $manual_script = $this->check->pass_val['manual_script']; if ($manual_script == NULL) { // illegal entry return; } $buf = $this->form_start(); $ver = $this->check->pass_val['php_version']; $binname = 'lsphp-' . $ver; $repl = array('%%server_root%%' => SERVER_ROOT, '%%binname%%' => $binname, '%%phpver%%' => $ver[0]); $notes = '<ul><li>' . DMsg::UIStr('buildphp_binarylocnote', $repl) . '</li>'; if ($this->check->pass_val['extentions'] != '') { $notes1 = BuildTool::getExtensionNotes($this->check->pass_val['extentions']); $notes .= "\n" . $notes1 . '</ul>'; } $buf .= UIBase::info_divmesg($notes); $echo_cmd = 'echo "For security reason, please log in and manually run the pre-generated script to continue."'; exec($echo_cmd . ' > ' . $this->check->pass_val['log_file']); exec($echo_cmd . ' > ' . $this->check->pass_val['progress_file']); $repl = array('%%manual_script%%' => $manual_script); $buf .= UIBase::warn_divmesg(DMsg::UIStr('buildphp_manualrunnotice', $repl)); $buf .= ' <h5>' . DMsg::ALbl('buildphp_mainstatus') . ': <span id="statusgraphzone"><i class="txt-color-teal fa fa-gear fa-spin"></i></span></h5> <div> <pre class="lst-statuszone" id="statuszone"></pre> </div> <h5>' . DMsg::ALbl('buildphp_detaillog') . ': </h5> <div > <pre class="lst-logzone" id="logzone">' . $cmd . '</pre> </div>'; $buf .= $this->form_end(); echo $buf; }
<input type="text" id="uid" name="userid" tabindex="1" required autofocus="autofocus"> <b class="tooltip tooltip-top-right"><i class="fa fa-user txt-color-teal"></i> <?php DMsg::EchoUIStr('service_enteruser'); ?> </b></label> </section> <section> <label class="label"><?php DMsg::EchoUIStr('l_pass'); ?> </label> <label class="input"> <i class="icon-append fa fa-lock"></i> <input type="password" id="pass" name="pass" tabindex="2" required > <b class="tooltip tooltip-top-right"><i class="fa fa-lock txt-color-teal"></i> <?php DMsg::EchoUIStr('service_enterpass'); ?> </b> </label> </section> </fieldset> <footer> <button type="submit" class="btn btn-primary"> Sign in </button> </footer> </form> </div> </div> <br> </div>
public function GetDerivedSelOptions($tid, $loc, $node) { $o = array(); if (substr($loc, 0, 13) == 'extprocessor:') { $type = substr($loc, 13); if ($type == '$$type') { if ($node != NULL) { $type = $node->GetChildVal('type'); } else { $type = 'fcgi'; } } if ($type == 'cgi') { $o['cgi'] = 'CGI Daemon'; return $o; } if ($type == 'module') { $modules = $this->_servData->GetChildrenValues('module'); if ($modules != NULL) { foreach ($modules as $mn) { $o[$mn] = $mn; } } return $o; } $exps = array(); if (($servexps = $this->_servData->GetRootNode()->GetChildren('extprocessor')) != NULL) { if (is_array($servexps)) { foreach ($servexps as $exname => $ex) { if ($ex->GetChildVal('type') == $type) { $exps[] = $exname; } } } elseif ($servexps->GetChildVal('type') == $type) { $exps[] = $servexps->Get(CNode::FLD_VAL); } } if ($this->_view == DInfo::CT_SERV) { foreach ($exps as $exname) { $o[$exname] = $exname; } return $o; } foreach ($exps as $exname) { $o[$exname] = '[' . DMsg::UIStr('note_serv_level') . "]: {$exname}"; } $loc = $this->_view == DInfo::CT_TP ? 'virtualHostConfig:extprocessor' : 'extprocessor'; if (($vhexps = $this->_confData->GetRootNode()->GetChildren($loc)) != NULL) { if (is_array($vhexps)) { foreach ($vhexps as $exname => $ex) { if ($ex->GetChildVal('type') == $type) { $o[$exname] = "[VHost Level]: {$exname}"; } } } else { if ($vhexps->GetChildVal('type') == $type) { $exname = $vhexps->Get(CNode::FLD_VAL); $o[$exname] = '[' . DMsg::UIStr('note_vh_level') . "]: {$exname}"; } } } return $o; } if (in_array($loc, array('virtualhost', 'listener', 'module'))) { $names = $this->_servData->GetChildrenValues($loc); } elseif ($loc == 'realm') { if ($this->_view == DInfo::CT_TP) { $loc = "virtualHostConfig:{$loc}"; } $names = $this->_confData->GetChildrenValues($loc); } sort($names); foreach ($names as $name) { $o[$name] = $name; } return $o; }
<?php /* * type: parse _minVal = pattern, _maxVal = pattern tips * */ define('ATTR_VAL_NOT_SET', DMsg::UIStr('o_notset')); define('ATTR_VAL_BOOL_YES', DMsg::UIStr('o_yes')); define('ATTR_VAL_BOOL_NO', DMsg::UIStr('o_no')); define('ATTR_NOTE_NUM_RANGE', DMsg::UIStr('note_numvalidrange')); define('ATTR_NOTE_NUMBER', DMsg::UIStr('note_number')); class DAttrBase { protected $_key; protected $_keyalias; public $_helpKey; public $_type; public $_minVal; public $_maxVal; public $_label; public $_href; public $_hrefLink; public $_multiInd; public $_note; public $_icon; protected $_inputType; protected $_inputAttr; protected $_glue; protected $_bitFlag = 0; const BM_NOTNULL = 1; const BM_NOEDIT = 2;
//array("Display Name" => "URL"); $breadcrumbs = array(); /*navigation array config ex: "dashboard" => array( "title" => "Display Title", "url" => "http://yoururl.com", "url_target" => "_self", "icon" => "fa-home", "label_htm" => "<span>Add your custom label/badge html here</span>", "sub" => array() //contains array of sub items with the same format as the parent ) */ $page_nav = array('dashboard' => array('title' => DMsg::UIStr('menu_dashboard'), 'url' => 'view/dashboard.php', 'icon' => 'fa-home'), 'serv' => array('title' => DMsg::UIStr('menu_serv'), 'icon' => 'fa-globe', 'url' => 'view/confMgr.php?m=serv'), 'sl' => array('title' => DMsg::UIStr('menu_sl'), 'icon' => 'fa-chain', 'url' => 'view/confMgr.php?m=sl'), 'vh' => array('title' => DMsg::UIStr('menu_vh'), 'icon' => 'fa-cubes', 'url' => 'view/confMgr.php?m=vh'), 'tp' => array('title' => DMsg::UIStr('menu_tp'), 'url' => 'view/confMgr.php?m=tp', 'icon' => 'fa-files-o'), 'tools' => array('title' => DMsg::UIStr('menu_tools'), 'icon' => 'fa-th', 'sub' => array('buildphp' => array('title' => DMsg::UIStr('menu_compilephp'), 'url' => 'view/compilePHP.php'), 'logviewer' => array('title' => DMsg::UIStr('menu_logviewer'), 'url' => 'view/logviewer.php'), 'stats' => array('title' => DMsg::UIStr('menu_rtstats'), 'url' => 'view/realtimestats.php'))), 'webadmin' => array('title' => DMsg::UIStr('menu_webadmin'), 'icon' => 'fa-gear', 'sub' => array('lg' => array('title' => DMsg::UIStr('menu_general'), 'url' => 'view/confMgr.php?m=admin'), 'al' => array('title' => DMsg::UIStr('menu_sl'), 'url' => 'view/confMgr.php?m=al'))), 'help' => array('title' => DMsg::UIStr('menu_help'), 'icon' => 'fa-book', 'sub' => array('docs' => array('title' => DMsg::UIStr('menu_docs'), 'url_target' => '_blank', 'url' => '/docs'), 'guides' => array('title' => DMsg::UIStr('menu_guides'), 'url' => 'http://open.litespeedtech.com/mediawiki/?utm_source=Open&utm_medium=WebAdmin', 'url_target' => '_blank'), 'community' => array('title' => DMsg::UIStr('menu_community'), 'url' => 'https://groups.google.com/forum/#!forum/openlitespeed-development', 'url_target' => '_blank')))); //configuration variables $page_title = ""; $no_main_header = false; //set true for lock.php and login.php $footer_lic_info = ' Open LiteSpeed is an open source HTTP server. Copyright (C) 2013-2015 Lite Speed Technologies, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
private static function loadErrorLog($filter) { $logfile = $filter->Get(LogFilter::FLD_LOGFILE); if (($fd = fopen($logfile, 'r')) == FALSE) { $filter->SetMesg(DMsg::Err('err_failreadfile') . ': ' . $filter->Get(LogFilter::FLD_LOGFILE)); return; } $frominput = $filter->Get(LogFilter::FLD_FROMINPUT); $block = $filter->Get(LogFilter::FLD_BLKSIZE) * 1024; $file_size = filesize($logfile); $filter->Set(LogFilter::FLD_FILE_SIZE, $file_size); $frompos = $frominput == LogFilter::POS_FILEEND ? $file_size - $block : $frominput * 1024; if ($frompos < 0) { $frompos = 0; $endpos = $file_size; } else { $endpos = $frompos + $block; } fseek($fd, $frompos); $filter->Set(LogFilter::FLD_FROMPOS, $frompos); $found = false; $totalLine = 0; $newlineTag = '[ERR[WAR[NOT[INF[DEB'; $levels = array('E' => 1, 'W' => 2, 'N' => 3, 'I' => 4, 'D' => 5); $filterlevel = $filter->Get(LogFilter::FLD_LEVEL); $cur_level = ''; $cur_time = ''; $cur_mesg = ''; while ($buffer = fgets($fd)) { // check if new line $c25 = substr($buffer, 25, 3); if ($c25 && strstr($newlineTag, $c25)) { // is new line $totalLine++; if ($found) { // finish prior line $filter->AddLogEntry($cur_level, $cur_time, $cur_mesg); $found = false; } $cur_level = $levels[$c25[0]]; if ($cur_level <= $filterlevel && preg_match("/^\\d{4}-\\d{2}-\\d{2} /", $buffer)) { // start a new line $found = true; $cur_time = substr($buffer, 0, 23); $cur_mesg = htmlspecialchars(substr($buffer, strpos($buffer, ']', 24) + 2)); } } elseif ($found) { // multi-line output $cur_mesg .= '<br>' . htmlspecialchars($buffer); } $curpos = ftell($fd); if ($curpos >= $endpos) { break; } } fclose($fd); if ($found) { $filter->AddLogEntry($cur_level, $cur_time, $cur_mesg); } $filter->Set(LogFilter::FLD_TOTALSEARCHED, $totalLine); }
public static function Err($tag) { if ($tag == '') { return NULL; } global $_gmsg; if (self::$_curlang == '') { DMsg::init(); } if (isset($_gmsg[$tag])) { return $_gmsg[$tag] . ' '; } else { error_log("DMsg:undefined Err tag {$tag}"); return 'Unknown'; } }
protected function add_SERVICE_SUSPENDVH($id) { $attrs = array(DTblDefBase::NewCustFlagAttr('suspendedVhosts', NULL, DAttr::BM_HIDE | DAttr::BM_NOEDIT, true, 'vhname', NULL, NULL, 1)); $this->_tblDef[$id] = DTbl::NewRegular($id, DMsg::ALbl('l_suspendvh'), $attrs); }
private function emailFailedLogin($authUser) { $ip = $_SERVER['REMOTE_ADDR']; $url = UIBase::GrabGoodInput('server', 'SCRIPT_URI'); error_log("[WebAdmin Console] Failed Login Attempt - username:{$authUser} ip:{$ip} url:{$url}\n"); $emails = Service::ServiceData(SInfo::DATA_ADMIN_EMAIL); if ($emails != NULL) { $hostname = gethostbyaddr($ip); $date = date("F j, Y, g:i a"); $repl = array('%%date%%' => $date, '%%authUser%%' => $authUser, '%%ip%%' => $ip, '%%hostname%%' => $hostname, '%%url%%' => $url); $subject = DMsg::UIStr('mail_failedlogin'); $contents = DMsg::UIStr('mail_failedlogin_c', $repl); mail($emails, $subject, $contents); } }
$.smallBox({ title : "<?php DMsg::EchoUIStr('service_addtomonitor'); ?> ", content : "<?php DMsg::EchoUIStr('service_confirmmonitor'); ?> " + vhname + "? <p class='text-align-right'><a href='javascript:void(0);' onclick='javascript:addMonitorTab(\"" + vhname + "\");' class='btn btn-primary btn-sm'><?php DMsg::EchoUIStr('btn_yes'); ?> </a> <a href='javascript:void(0);' class='btn btn-default btn-sm'><?php DMsg::EchoUIStr('btn_cancel'); ?> </a></p>", color : "#296191", icon : "fa fa-stethoscope swing animated" }); } }); $("#refresh-interval").change(function() { updateInterval = $(this).val() * 1000; clearInterval($.intervalArr.pop()); if (updateInterval > 0) { $.intervalArr.push(setInterval(updateChart, updateInterval)); } });
?> --> <!-- PAGE FOOTER --> <div class="page-footer"> <div class="row"> <div class="col-xs-12 col-sm-6"> <span class="txt-color-white">LiteSpeed WebAdmin Console © 2014-2015 <?php DMsg::EchoUIStr('note_copyrightreserved'); ?> </span> </div> <div class="col-xs-6 col-sm-6 text-right hidden-xs"> <i class="txt-color-blueLight hidden-mobile"> <i class="fa fa-clock-o"></i> <i><?php DMsg::EchoUIStr('note_dataretrievedat'); ?> <span id="lst_UpdateStamp"></span> </i> </div> </div> </div> <!-- END PAGE FOOTER --> <!-- ==========================CONTENT ENDS HERE ========================== --> <?php include "view/inc/scripts.php"; ?>