Exemple #1
0
 private static function init()
 {
     $lang = DMsg::DEFAULT_LANG;
     if (isset($_SESSION[DMsg::_COOKIE_LANG_])) {
         $lang = $_SESSION[DMsg::_COOKIE_LANG_];
     } else {
         $lang1 = UIBase::GrabGoodInput('cookie', self::_COOKIE_LANG_);
         if ($lang1 != NULL && $lang != $lang1 && array_key_exists($lang1, self::$_supported)) {
             $lang = $lang1;
         }
         DMsg::SetLang($lang);
     }
     $filecode = self::$_supported[$lang][1];
     self::$_curlang = $lang;
     include SERVER_ROOT . self::LANG_DIR . 'en-US_msg.php';
     if ($lang != DMsg::DEFAULT_LANG) {
         include SERVER_ROOT . self::LANG_DIR . $filecode . '_msg.php';
     }
 }
Exemple #2
0
 public function PrintHtml($disp)
 {
     $this->_disp_tid = $disp->Get(DInfo::FLD_TID);
     $this->_disp_ref = $disp->Get(DInfo::FLD_REF);
     $this->_linked_tbls = NULL;
     $this->_extended = TRUE;
     if ($this->_disp_tid == '') {
         $this->_extended = FALSE;
     } elseif (($last = strrpos($this->_disp_tid, '`')) > 0) {
         $this->_disp_tid = substr($this->_disp_tid, $last + 1);
     }
     if (($topmesg = $disp->Get(DInfo::FLD_TopMsg)) != NULL) {
         foreach ($topmesg as $tm) {
             echo UIBase::message('', $tm, 'error');
         }
     }
     $root = $disp->Get(DInfo::FLD_PgData);
     if ($root == NULL) {
         return;
     }
     if ($root->Get(CNode::FLD_KEY) == CNode::K_EXTRACTED) {
         $this->print_tbl($this->_disp_tid, $root, $disp);
     } else {
         $this->_printdone = FALSE;
         $this->print_map($this->_tblmap, $root, $disp);
     }
     if ($disp->IsViewAction() && $this->_linked_tbls != NULL) {
         $this->_extended = TRUE;
         $disp->SetPrintingLinked(TRUE);
         foreach ($this->_linked_tbls as $lti) {
             $this->_disp_tid = $lti;
             $this->_disp_ref = $disp->Get(DInfo::FLD_REF);
             $this->_printdone = FALSE;
             $this->print_map($this->_tblmap, $root, $disp);
         }
         $disp->SetPrintingLinked(FALSE);
     }
 }
Exemple #3
0
			<span> <a href="/login.php?logoff=1" title="' . DMsg::UIStr('note_signout') . '" data-action="userLogout" data-logout-msg="' . DMsg::UIStr('note_logout') . '"><i class="fa fa-sign-out"></i></a> </span>
		</div>
		<!-- end logout button -->

		<!-- fullscreen button -->
		<div id="fullscreen" class="btn-header transparent pull-right">
			<span> <a href="javascript:void(0);" title="' . DMsg::UIStr('note_fullscreen') . '" data-action="launchFullscreen"><i class="fa fa-arrows-alt"></i></a> </span>
		</div>
		<!-- end fullscreen button -->

		<!-- multiple lang dropdown : find all flags in the flags page -->

		<ul class="header-dropdown-list hidden-xs">
			<li>
	';
echo UIBase::Get_LangDropdown();
?>
			</li>
		</ul>

		<!-- end multiple lang -->
			</div>
			<!-- end pulled right: nav area -->

		</header>
		<!-- END HEADER -->

		<!-- SHORTCUT AREA : With large tiles (activated via clicking user name tag) -->
		<div id="shortcut">
			<ul>
				<li>
 public static function GetErrLog($errorlogfile)
 {
     // get from input
     $filename = UIBase::GrabGoodInput('any', 'filename');
     if ($filename == '') {
         return self::GetDashErrLog($errorlogfile);
     }
     // todo: validate
     $level = UIBase::GrabGoodInput('ANY', 'sellevel', 'int');
     $startinput = UIBase::GrabGoodInput('any', 'startpos', 'float');
     $block = UIBase::GrabGoodInput('any', 'blksize', 'float');
     $act = UIBase::GrabGoodInput('any', 'act');
     switch ($act) {
         case 'begin':
             $startinput = 0;
             break;
         case 'end':
             $startinput = LogFilter::POS_FILEEND;
             break;
         case 'prev':
             $startinput -= $block;
             break;
         case 'next':
             $startinput += $block;
             break;
     }
     $filter = new LogFilter($filename);
     $filter->Set(LogFilter::FLD_LEVEL, $level);
     $filter->SetRange($startinput, $block);
     $filter->SetMesg('');
     self::loadErrorLog($filter);
     return $filter;
 }
Exemple #5
0
    protected function toHtmlInput($helppop, $isDisabled, $err, $value)
    {
        $spacer = '&nbsp;&nbsp;&nbsp;&nbsp;';
        $checked = ' checked="checked"';
        $input = '<div class="input-group">';
        $input .= '<span class="input-group-addon">' . $helppop . '</span>' . "\n";
        // need this even empty, for alignment
        if (is_array($value) && $this->_inputType != 'checkbox') {
            if ($this->_multiInd == 1) {
                $glue = ', ';
            } else {
                $glue = "\n";
            }
            $value = implode($glue, $value);
        }
        $name = $this->_key;
        $inputAttr = $this->_inputAttr;
        if ($isDisabled) {
            $inputAttr .= ' disabled="disabled"';
        }
        $style = 'form-control';
        if ($this->_inputType == 'text') {
            $input .= '<input class="' . $style . '" type="text" name="' . $name . '" ' . $inputAttr . ' value="' . htmlspecialchars($value, ENT_QUOTES) . '">';
        } elseif ($this->_inputType == 'password') {
            $input .= '<input class="' . $style . '" type="password" name="' . $name . '" ' . $inputAttr . ' value="' . $value . '">';
        } elseif ($this->_inputType == 'textarea' || $this->_inputType == 'textarea1') {
            $input .= '<textarea name="' . $name . '" class="' . $style . '" ' . $inputAttr . '>' . htmlspecialchars($value, ENT_QUOTES) . '</textarea>';
        } elseif ($this->_inputType == 'radio' && $this->_type == 'bool') {
            $input .= '<div class="form-control"><div class="lst-radio-group"><label class="radio radio-inline">
					<input type="radio" name="' . $name . '" ' . $inputAttr . ' value="1"';
            if ($value == '1') {
                $input .= $checked;
            }
            $input .= '> ' . ATTR_VAL_BOOL_YES . '</label><label class="radio radio-inline">' . '<input type="radio" name="' . $name . '" ' . $inputAttr . ' value="0"';
            if ($value == '0') {
                $input .= $checked;
            }
            $input .= '> ' . ATTR_VAL_BOOL_NO . '</label>';
            if (!$this->IsFlagOn(self::BM_NOTNULL)) {
                $input .= '<label class="radio radio-inline">
					<input type="radio" name="' . $name . '" ' . $inputAttr . ' value=""';
                if ($value != '0' && $value != '1') {
                    $input .= $checked;
                }
                $input .= '> ' . ATTR_VAL_NOT_SET . '</label>';
            }
            $input .= '</div></div>';
        } elseif ($this->_inputType == 'checkboxgroup') {
            $input .= '<div class="form-control">';
            if ($this->_minVal !== NULL && ($value === '' || $value === NULL)) {
                // has default value, for "Not set", set default val
                $value = $this->_minVal;
            }
            $js0 = $js1 = '';
            if (array_key_exists('0', $this->_maxVal)) {
                $chval = array_keys($this->_maxVal);
                foreach ($chval as $chv) {
                    if ($chv == '0') {
                        $js1 = "document.confform.{$name}{$chv}.checked=false;";
                    } else {
                        $js0 .= "document.confform.{$name}{$chv}.checked=false;";
                    }
                }
                $js1 = " onclick=\"{$js1}\"";
                $js0 = " onclick=\"{$js0}\"";
            }
            foreach ($this->_maxVal as $val => $disp) {
                $id = $name . $val;
                $input .= "<input type=\"checkbox\" id=\"{$id}\" name=\"{$id}\" value=\"{$val}\"";
                if ($value & $val || $value === $val || $value === '0' && $val === 0) {
                    $input .= $checked;
                }
                $input .= $val == '0' ? $js0 : $js1;
                $input .= "> <label for=\"{$id}\"> {$disp} </label> {$spacer}";
            }
            $input .= '</div>';
        } elseif ($this->_inputType == 'select') {
            $input .= '<select class="form-control" name="' . $name . '" ' . $inputAttr . '>';
            $input .= UIBase::genOptions($this->_maxVal, $value);
            $input .= '</select>';
        }
        $input .= "</div>\n";
        if ($err != '') {
            $input .= '<span class="help-block"><i class="fa fa-warning"></i> ';
            $type3 = substr($this->_type, 0, 3);
            $input .= $type3 == 'fil' || $type3 == 'pat' ? $err : htmlspecialchars($err, ENT_QUOTES);
            $input .= '</span>';
        }
        $note = $this->getNote();
        if ($note) {
            $input .= '<p class="note">' . htmlspecialchars($note, ENT_QUOTES) . '</p>';
        }
        return $input;
    }
Exemple #6
0
function ajax_downloadlog()
{
    $file = UIBase::GrabGoodInput('get', 'filename');
    if (file_exists($file)) {
        if (ob_get_level()) {
            ob_end_clean();
        }
        header('Content-Description: File Transfer');
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename=' . basename($file));
        header('Expires: 0');
        header('Cache-Control: must-revalidate');
        header('Pragma: public');
        header('Content-Length: ' . filesize($file));
        readfile($file);
        exit;
    } else {
        error_log("download log {$file} not exist");
    }
}
 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;
 }
Exemple #8
0
?>
</h2>
                <div class="widget-toolbar" role="menu">
                    <span class="onoffswitch-title"><?php 
DMsg::EchoUIStr('service_realtime');
?>
</span>
                    <span class="onoffswitch">
                        <input type="checkbox" name="live_feed" class="onoffswitch-checkbox" checked="checked" id="live_feed">
                        <label class="onoffswitch-label" for="live_feed"> <span class="onoffswitch-inner" data-swchon-text="YES" data-swchoff-text="NO"></span> <span class="onoffswitch-switch"></span> </label> </span>
                </div>
            </header>

            <!-- widget div-->
            <?php 
echo UIBase::GenPlotTab('serv', $servstatbottom, $servstatplot, -1);
?>

            <!-- end widget div -->
        </div>
    </article>
    <!-- WIDGET END -->
</div>
<!-- end row -->

<hr class="simple">
<article>
    <div class="jarviswidget" id="lvh_widget">
        <ul class="nav nav-tabs bordered">
            <li class="active">
                <a href="#listeners" data-toggle="tab"><i class="fa fa-fw fa-lg fa-chain"></i> <?php 
Exemple #9
0
    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;
    }
Exemple #10
0
 public function InitConf()
 {
     $has_pid = FALSE;
     $mid = UIBase::GrabGoodInput("request", 'm');
     if ($mid != NULL) {
         $this->_mid = $mid;
         $pid = UIBase::GrabGoodInput("request", 'p');
         if ($pid != NULL) {
             $this->_pid = $pid;
             $has_pid = TRUE;
         }
     }
     if (($pos = strpos($this->_mid, '_')) > 0) {
         $this->_view = substr($this->_mid, 0, $pos + 1);
         $this->_viewName = substr($this->_mid, $pos + 1);
         if ($this->_pid == '' || $this->_view == 'sl' || $this->_view == 'sl_' || $this->_view == 'al' || $this->_view == 'al_' || $this->_pid == 'base' || $this->_pid == 'mbr') {
             $this->_ref = $this->_viewName;
         }
         // still in serv conf
     } else {
         $this->_view = $this->_mid;
     }
     $this->_confType = $this->_mid[0] == 'a' ? self::CT_ADMIN : self::CT_SERV;
     $this->_tabs = DPageDef::GetInstance()->GetTabDef($this->_view);
     if ($has_pid) {
         if (!array_key_exists($this->_pid, $this->_tabs)) {
             die("Invalid pid - {$this->_pid} \n");
         }
     } else {
         $this->_pid = key($this->_tabs);
         // default
     }
     if ($has_pid && !isset($_REQUEST['t0']) && isset($_REQUEST['t'])) {
         $t = UIBase::GrabGoodInput('request', 't');
         if ($t != NULL) {
             $this->_tid = $t;
             $t1 = UIBase::GrabGoodInputWithReset('request', 't1');
             if ($t1 != NULL && $this->GetLast(self::FLD_TID) != $t1) {
                 $this->_tid .= '`' . $t1;
             }
             if (($r = UIBase::GrabGoodInputWithReset('request', 'r')) != NULL) {
                 $this->_ref = $r;
             }
             if (($r1 = UIBase::GrabGoodInputWithReset('request', 'r1')) != NULL) {
                 $this->_ref .= '`' . $r1;
             }
         }
     }
     $this->_act = UIBase::GrabGoodInput("request", 'a');
     if ($this->_act == NULL) {
         $this->_act = 'v';
     }
     $tokenInput = UIBase::GrabGoodInput("request", 'tk');
     $this->_token = $_SESSION['token'];
     if ($this->_act != 'v' && $this->_token != $tokenInput) {
         die('Illegal entry point!');
     }
     if ($this->_act == 'B') {
         $this->TrimLastId();
         $this->_act = 'v';
     }
     $this->_sort = UIBase::GrabGoodInput("request", 'sort');
     $this->_allActions = array('a' => array(DMsg::UIStr('btn_add'), 'fa-indent'), 'v' => array(DMsg::UIStr('btn_view'), 'fa-search-plus'), 'E' => array(DMsg::UIStr('btn_edit'), 'fa-edit'), 's' => array(DMsg::UIStr('btn_save'), 'fa-save'), 'B' => array(DMsg::UIStr('btn_back'), 'fa-reply'), 'n' => array(DMsg::UIStr('btn_next'), 'fa-step-forward'), 'd' => array(DMsg::UIStr('btn_delete'), 'fa-trash-o'), 'D' => array(DMsg::UIStr('btn_delete'), 'fa-trash-o'), 'C' => array(DMsg::UIStr('btn_cancel'), 'fa-angle-double-left'), 'i' => array(DMsg::UIStr('btn_instantiate'), 'fa-cube'), 'I' => array(DMsg::UIStr('btn_instantiate'), 'fa-cube'), 'X' => array(DMsg::UIStr('btn_view'), 'fa-search-plus'));
 }
 private function validate_step3()
 {
     $php_version = UIBase::GrabGoodInput('ANY', 'buildver');
     if ($php_version == '') {
         echo "missing php_version";
         return FALSE;
     }
     $this->pass_val['php_version'] = $php_version;
     $next = UIBase::GrabInput('ANY', 'next');
     if ($next == 0) {
         $this->next_step = 2;
         return TRUE;
     }
     if (!isset($_SESSION['progress_file'])) {
         echo "missing progress file";
         return FALSE;
     }
     $progress_file = $_SESSION['progress_file'];
     if (!isset($_SESSION['log_file'])) {
         echo "missing log file";
         return FALSE;
     }
     $log_file = $_SESSION['log_file'];
     if (!file_exists($log_file)) {
         echo "logfile does not exist";
         return FALSE;
     }
     $manual_script = UIBase::GrabGoodInput('ANY', 'manual_script');
     if ($manual_script == '' || !file_exists($manual_script)) {
         echo "missing manual script";
         return FALSE;
     }
     $this->pass_val['progress_file'] = $progress_file;
     $this->pass_val['log_file'] = $log_file;
     $this->pass_val['manual_script'] = $manual_script;
     $this->pass_val['extentions'] = UIBase::GrabGoodInput('ANY', 'extentions');
     $this->next_step = 4;
     return TRUE;
 }
Exemple #12
0
 protected function __construct($entries, $header = null)
 {
     parent::__construct();
     $this->entries = $entries;
     $this->header = $header;
     require_css('table');
 }
Exemple #13
0
<?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:
Exemple #14
0
 /**
  * Constructs a new UIText that replaces newline chars with HTML line breaks.
  * 
  * $text : must be valid, escaped HTML, but newlines are OK and converted to HTML breaks
  * $title : optional
  * $cols : number of columns to render, 1 by default
  */
 public function __construct($text, $title = null, $cols = 1)
 {
     parent::__construct();
     if (is_numeric($title)) {
         $cols = $title;
         $title = null;
     }
     $this->text = $text;
     $this->cols = $cols;
     $this->replace = true;
     if ($title != null) {
         $this->title = $title;
     }
 }
 private function parse_vhosts()
 {
     $this->_vhosts = array();
     $top = UIBase::GrabGoodInput("request", "vh_topn", 'int');
     $filter = UIBase::GrabGoodInput("request", "vh_filter", "string");
     $sort = UIBase::GrabGoodInput("request", "vh_sort", "int");
     $vhosts = array();
     $m = array();
     $found = preg_match_all("/REQ_RATE \\[(.+)\\]: REQ_PROCESSING: ([0-9]+), REQ_PER_SEC: ([0-9\\.]+), TOT_REQS: ([0-9]+)/i", $this->_rawdata, $m);
     //$found = preg_match_all("/REQ_RATE \[(.+)\]: REQ_PROCESSING: ([0-9]+), REQ_PER_SEC: ([0-9\.]+), TOT_REQS: ([0-9]+), CACHE_HITS_PER_SEC: ([0-9\.]+), TOTAL_CACHE_HITS: ([0-9]+)/i", $this->_rawdata, $m);
     for ($f = 0; $f < $found; $f++) {
         $vhname = trim($m[1][$f]);
         if ($filter != "" && !preg_match("/{$filter}/i", $vhname)) {
             continue;
         }
         if (!isset($vhosts[$vhname])) {
             $vhosts[$vhname] = array_fill(0, 10, 0);
             $vhosts[$vhname]['ea'] = array();
         }
         $vh =& $vhosts[$vhname];
         $vh[self::FLD_VH_REQ_PROCESSING] += (int) $m[2][$f];
         $vh[self::FLD_VH_REQ_PER_SEC] += doubleval($m[3][$f]);
         $vh[self::FLD_VH_TOT_REQS] += doubleval($m[4][$f]);
     }
     //reset
     $m = array();
     $found = preg_match_all("/EXTAPP \\[(.+)\\] \\[(.+)\\] \\[(.+)\\]: CMAXCONN: ([0-9]+), EMAXCONN: ([0-9]+), POOL_SIZE: ([0-9]+), INUSE_CONN: ([0-9]+), IDLE_CONN: ([0-9]+), WAITQUE_DEPTH: ([0-9]+), REQ_PER_SEC: ([0-9\\.]+), TOT_REQS: ([0-9]+)/i", $this->_rawdata, $m);
     for ($f = 0; $f < $found; $f++) {
         $vhname = trim($m[2][$f]);
         $extapp = trim($m[3][$f]);
         if ($vhname == '') {
             $vhname = '_Server';
             if (!isset($vhosts[$vhname])) {
                 $vhosts[$vhname] = array_fill(0, 10, 0);
                 $vhosts[$vhname]['ea'] = array();
             }
         } else {
             if (!isset($vhosts[$vhname])) {
                 continue;
             }
         }
         if (!isset($vhosts[$vhname]['ea'][$extapp])) {
             $vhosts[$vhname][self::FLD_VH_EAP_COUNT]++;
             $vhosts[$vhname]['ea'][$extapp] = array_fill(0, 8, 0);
         }
         $ea =& $vhosts[$vhname]['ea'][$extapp];
         $ea[self::FLD_EA_TYPE] = trim($m[1][$f]);
         $ea[self::FLD_EA_CMAXCONN] += (int) $m[4][$f];
         $ea[self::FLD_EA_EMAXCONN] += (int) $m[5][$f];
         $ea[self::FLD_EA_POOL_SIZE] += (int) $m[6][$f];
         $ea[self::FLD_EA_INUSE_CONN] += (int) $m[7][$f];
         $ea[self::FLD_EA_IDLE_CONN] += (int) $m[8][$f];
         $ea[self::FLD_EA_WAITQUE_DEPTH] += (int) $m[9][$f];
         $ea[self::FLD_EA_REQ_PER_SEC] += doubleval($m[10][$f]);
         $ea[self::FLD_EA_TOT_REQS] += doubleval($m[11][$f]);
         $vhosts[$vhname][self::FLD_VH_EAP_INUSE] += (int) $m[7][$f];
         $vhosts[$vhname][self::FLD_VH_EAP_IDLE] += (int) $m[8][$f];
         $vhosts[$vhname][self::FLD_VH_EAP_WAITQUE] += (int) $m[9][$f];
         $vhosts[$vhname][self::FLD_VH_EAP_REQ_PER_SEC] += doubleval($m[10][$f]);
     }
     $names = array_keys($vhosts);
     if ($sort != "" && count($names) > 1) {
         foreach ($names as $vhname) {
             if ($vhosts[$vhname][$sort] > 0) {
                 $sortDesc1[] = $vhosts[$vhname][$sort];
                 $sortAsc2[] = $vhname;
             }
         }
         if (count($sortAsc2) > 0) {
             array_multisort($sortDesc1, SORT_DESC, SORT_NUMERIC, $sortAsc2, SORT_ASC, SORT_STRING);
             $names = $sortAsc2;
         }
     }
     if ($top != 0 && count($names) > $top) {
         $names = array_slice($names, 0, $top);
     }
     foreach ($names as $vn) {
         $this->_vhosts[$vn] = $vhosts[$vn];
     }
 }
 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);
     }
 }
</a>
				</li>
			</ul>
			<div class="widget-toolbar" role="menu">
				<span><?php 
DMsg::EchoUIStr('service_retrieve');
?>
 </span>
				<select id="vh_topn" name="vh_topn" class="font-sm">
<?php 
echo UIBase::genOptions($topOptions, 10);
?>
				</select>
				<select name="vh_sort" id="vh_sort" class="font-sm">
<?php 
echo UIBase::genOptions($vhSortOptions, RealTimeStats::FLD_VH_REQ_PER_SEC);
?>
				</select>
			</div>
			<div class="widget-toolbar" role="menu">
				<span><?php 
DMsg::EchoUIStr('service_filterbyvn');
?>
: </span><input class="input-xs" type="text"
					name="vh_filter" id="vh_filter" placeholder="<?php 
DMsg::EchoUIStr('service_nameallowexp');
?>
" value="">
			</div>
		</header>
Exemple #18
0
 public function __construct($title = null)
 {
     parent::__construct($title);
 }