php 5.4 fixes + bugfix interface/web/admin/list/remote_user.list.php ['table_idx'] from userid to remote_userid
| | |
| | | public function get_server_config($server_id, $section = '') { |
| | | global $app; |
| | | |
| | | if(!is_array($this->config[$server_id])) { |
| | | if(!isset($this->config[$server_id])) { |
| | | $app->uses('ini_parser'); |
| | | $server_id = intval($server_id); |
| | | $server = $app->db->queryOneRecord('SELECT config FROM server WHERE server_id = '.$server_id); |
| | |
| | | public function get_global_config($section = '') { |
| | | global $app; |
| | | |
| | | if(!is_array($this->config['global'])) { |
| | | if(isset($this->config['global'])) { |
| | | $app->uses('ini_parser'); |
| | | $tmp = $app->db->queryOneRecord('SELECT config FROM sys_ini WHERE sysini_id = 1'); |
| | | $this->config['global'] = $app->ini_parser->parse_ini_string(stripslashes($tmp['config'])); |
| | | } else { |
| | | $this->config['global'] = NULL; |
| | | } |
| | | return ($section == '') ? $this->config['global'] : $this->config['global'][$section]; |
| | | } |
| | |
| | | $listTpl->setVar('theme', $_SESSION['s']['theme']); |
| | | |
| | | // Generate the SQL for searching |
| | | $sql_where = ""; |
| | | if($app->listform->listDef["auth"] != 'no') { |
| | | if($_SESSION["s"]["user"]["typ"] == "admin") { |
| | | $sql_where = ""; |
| | | } else { |
| | | $sql_where = $app->tform->getAuthSQL('r')." and"; |
| | | if($_SESSION["s"]["user"]["typ"] != "admin") { |
| | | $sql_where = $app->tform->getAuthSQL('r')." and"; |
| | | } |
| | | } |
| | | |
| | |
| | | $limits = array('5'=>'5','15'=>'15','25'=>'25','50'=>'50','100'=>'100','999999999' => 'all'); |
| | | |
| | | //* create options and set selected, if default -> 15 is selected |
| | | $options=''; |
| | | foreach($limits as $key => $val){ |
| | | $options .= '<option value="'.$key.'" '.(isset($_SESSION['search']['limit']) && $_SESSION['search']['limit'] == $key ? 'selected="selected"':'' ).(!isset($_SESSION['search']['limit']) && $key == '15' ? 'selected="selected"':'').'>'.$val.'</option>'; |
| | | } |
| | |
| | | $liste['table'] = 'remote_user'; |
| | | |
| | | // Index index field of the database table |
| | | $liste['table_idx'] = 'userid'; |
| | | $liste['table_idx'] = 'remote_userid'; |
| | | |
| | | // Search Field Prefix |
| | | $liste['search_prefix'] = 'search_'; |
| | |
| | | $rec["type"] = $tmp_parts[0]; |
| | | } |
| | | } |
| | | if(@$tmp_parts[2] != '') { |
| | | if(!empty($tmp_parts[2])) { |
| | | $dest = @$tmp_parts[1].':'.@$tmp_parts[2]; |
| | | } elseif($tmp_parts[1] != '') { |
| | | } elseif(!empty($tmp_parts[1])) { |
| | | $dest = $tmp_parts[1]; |
| | | } else { |
| | | $dest = $this->dataRecord["transport"]; |
| | |
| | | if($this->dataRecord["quota"] != -1) $app->tpl->setVar("quota",$this->dataRecord["quota"] / 1024 / 1024); |
| | | |
| | | // Is autoresponder set? |
| | | if ($this->dataRecord['autoresponder'] == 'y') { |
| | | if (!empty($this->dataRecord['autoresponder']) && $this->dataRecord['autoresponder'] == 'y') { |
| | | $app->tpl->setVar("ar_active", 'checked="checked"'); |
| | | } else { |
| | | $app->tpl->setVar("ar_active", ''); |
| | |
| | | |
| | | |
| | | $app->uses('getconf'); |
| | | $mail_config = $app->getconf->get_server_config($domain["server_id"],'mail'); |
| | | $mail_config = $app->getconf->get_server_config(!empty($domain["server_id"]) ? $domain["server_id"] : '','mail'); |
| | | |
| | | //* compose the email field |
| | | if(isset($_POST["email_local_part"]) && isset($_POST["email_domain"])) { |
| | |
| | | if(!isset($_POST["login"])) $this->dataRecord["login"] = $this->dataRecord["email"]; |
| | | elseif(strpos($_POST["login"], '@') !== false && $_POST["login"] != $this->dataRecord["email"]) $app->tform->errorMessage .= $app->tform->lng("error_login_email_txt")."<br>"; |
| | | } else { |
| | | $this->dataRecord["login"] = $this->dataRecord["email"]; |
| | | $this->dataRecord["login"] = isset($this->dataRecord["email"]) ? $this->dataRecord["email"] : ''; |
| | | } |
| | | //* if autoresponder checkbox not selected, do not save dates |
| | | if (!isset($_POST['autoresponder']) && array_key_exists('autoresponder_start_date', $_POST)) { |
| | |
| | | |
| | | // Set the fields for dovecot |
| | | if(isset($this->dataRecord["email"])) { |
| | | $disableimap = ($this->dataRecord["disableimap"])?'y':'n'; |
| | | $disablepop3 = ($this->dataRecord["disablepop3"])?'y':'n'; |
| | | $disableimap = (isset($this->dataRecord["disableimap"]) && $this->dataRecord["disableimap"])?'y':'n'; |
| | | $disablepop3 = (isset($this->dataRecord["disablepop3"]) && $this->dataRecord["disablepop3"])?'y':'n'; |
| | | $disabledeliver = ($this->dataRecord["postfix"] == 'y')?'n':'y'; |
| | | $disablesmtp = ($this->dataRecord["postfix"] == 'y')?'n':'y'; |
| | | |
| | |
| | | $rec['bgcolor'] = $this->DataRowColor; |
| | | $email = $rec['email']; |
| | | |
| | | $rec['used'] = $monitor_data[$email]['used']; |
| | | $rec['used'] = isset($monitor_data[$email]['used']) ? $monitor_data[$email]['used'] : array(1 => 0); |
| | | |
| | | if (!is_numeric($rec['used'])) $rec['used']=$rec['used'][1]; |
| | | |
| | |
| | | $app->tpl->setVar("state_data",$output); |
| | | $app->tpl->setVar("state_type",$stateType); |
| | | $app->tpl->setVar("list_head_txt",$title); |
| | | $app->tpl->setVar("list_desc_txt",$description); |
| | | $app->tpl->setVar("list_desc_txt",(isset($description) ? $description : '')); |
| | | $app->tpl->setVar("monTransRefreshsq", $monTransRefreshsq); |
| | | |
| | | /* |
| | |
| | | /* |
| | | * Info of a "normal" Server or a OpenVz-Host |
| | | */ |
| | | $html_server .= '<div class="systemmonitor-state state-' . $serverState . '">'; |
| | | $html_server = '<div class="systemmonitor-state state-' . $serverState . '">'; |
| | | $html_server .= '<div class="systemmonitor-device device-server">'; |
| | | $html_server .= '<div class="systemmonitor-content icons32 ico-' . $serverState . '">'; |
| | | $html_server .= $app->lng("monitor_serverstate_server_txt") . ': ' . $serverName; |
| | |
| | | } |
| | | |
| | | $html_server .= $app->lng("monitor_serverstate_state_txt") . ': ' . $serverState . ' ('; |
| | | $html_server .= sizeof($messages[$app->lng("monitor_serverstate_listunknown_txt")]) . ' ' . $app->lng("monitor_serverstate_unknown_txt") . ', '; |
| | | $html_server .= sizeof($messages[$app->lng("monitor_serverstate_listinfo_txt")]) . ' ' . $app->lng("monitor_serverstate_info_txt") . ', '; |
| | | $html_server .= sizeof($messages[$app->lng("monitor_serverstate_listwarning_txt")]) . ' ' . $app->lng("monitor_serverstate_warning_txt") . ', '; |
| | | $html_server .= sizeof($messages[$app->lng("monitor_serverstate_listcritical_txt")]) . ' ' . $app->lng("monitor_serverstate_critical_txt") . ', '; |
| | | $html_server .= sizeof($messages[$app->lng("monitor_serverstate_listerror_txt")]) . ' ' . $app->lng("monitor_serverstate_error_txt") . ''; |
| | | $html_server .= sizeof((isset($messages[$app->lng("monitor_serverstate_listunknown_txt")]) ? $messages[$app->lng("monitor_serverstate_listunknown_txt")] : array())) . ' ' . $app->lng("monitor_serverstate_unknown_txt") . ', '; |
| | | $html_server .= sizeof((isset($messages[$app->lng("monitor_serverstate_listinfo_txt")]) ? $messages[$app->lng("monitor_serverstate_listinfo_txt")] : array())) . ' ' . $app->lng("monitor_serverstate_info_txt") . ', '; |
| | | $html_server .= sizeof((isset($messages[$app->lng("monitor_serverstate_listwarning_txt")]) ? $messages[$app->lng("monitor_serverstate_listwarning_txt")] : array())) . ' ' . $app->lng("monitor_serverstate_warning_txt") . ', '; |
| | | $html_server .= sizeof((isset($messages[$app->lng("monitor_serverstate_listcritical_txt")]) ? $messages[$app->lng("monitor_serverstate_listcritical_txt")] : array())) . ' ' . $app->lng("monitor_serverstate_critical_txt") . ', '; |
| | | $html_server .= sizeof((isset($messages[$app->lng("monitor_serverstate_listerror_txt")]) ? $messages[$app->lng("monitor_serverstate_listerror_txt")] : array())) . ' ' . $app->lng("monitor_serverstate_error_txt") . ''; |
| | | $html_server .= ')<br />'; |
| | | |
| | | /* |
| | |
| | | |
| | | //* get the server config for this server |
| | | $app->uses("getconf"); |
| | | $web_config = $app->getconf->get_server_config(intval($this->dataRecord["server_id"]),'web'); |
| | | $web_config = $app->getconf->get_server_config(intval(isset($this->dataRecord["server_id"]) ? $this->dataRecord["server_id"] : 0),'web'); |
| | | //* Check for duplicate ssl certs per IP if SNI is disabled |
| | | if(isset($this->dataRecord['ssl']) && $this->dataRecord['ssl'] == 'y' && $web_config['enable_sni'] != 'y') { |
| | | $sql = "SELECT count(domain_id) as number FROM web_domain WHERE `ssl` = 'y' AND ip_address = '".$app->db->quote($this->dataRecord['ip_address'])."' and domain_id != ".$this->id; |
| | |
| | | $web_rec = $app->tform->getDataRecord($this->id); |
| | | $web_config = $app->getconf->get_server_config(intval($web_rec["server_id"]),'web'); |
| | | $document_root = str_replace("[website_id]",$this->id,$web_config["website_path"]); |
| | | $document_root = str_replace("[website_idhash_1]",$this->id_hash($page_form->id,1),$document_root); |
| | | $document_root = str_replace("[website_idhash_2]",$this->id_hash($page_form->id,1),$document_root); |
| | | $document_root = str_replace("[website_idhash_3]",$this->id_hash($page_form->id,1),$document_root); |
| | | $document_root = str_replace("[website_idhash_4]",$this->id_hash($page_form->id,1),$document_root); |
| | | $page_formid = isset($page_form->id) ? $page_form->id : ''; |
| | | $document_root = str_replace("[website_idhash_1]",$this->id_hash($page_formid,1),$document_root); |
| | | $document_root = str_replace("[website_idhash_2]",$this->id_hash($page_formid,1),$document_root); |
| | | $document_root = str_replace("[website_idhash_3]",$this->id_hash($page_formid,1),$document_root); |
| | | $document_root = str_replace("[website_idhash_4]",$this->id_hash($page_formid,1),$document_root); |
| | | |
| | | // get the ID of the client |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) { |
| | |
| | | } |
| | | |
| | | //* If the domain name has been changed, we will have to change all subdomains |
| | | if($this->dataRecord["domain"] != '' && $this->oldDataRecord["domain"] != '' && $this->dataRecord["domain"] != $this->oldDataRecord["domain"]) { |
| | | if(!empty($this->dataRecord["domain"]) && !empty($this->oldDataRecord["domain"]) && $this->dataRecord["domain"] != $this->oldDataRecord["domain"]) { |
| | | $records = $app->db->queryAllRecords("SELECT domain_id,domain FROM web_domain WHERE type = 'subdomain' AND domain LIKE '%.".$app->db->quote($this->oldDataRecord["domain"])."'"); |
| | | foreach($records as $rec) { |
| | | $subdomain = $app->db->quote(str_replace($this->oldDataRecord["domain"],$this->dataRecord["domain"],$rec['domain'])); |
| | |
| | | } |
| | | |
| | | //* Set php_open_basedir if empty or domain or client has been changed |
| | | if($web_rec['php_open_basedir'] == '' || |
| | | ($this->dataRecord["domain"] != '' && $this->oldDataRecord["domain"] != '' && $this->dataRecord["domain"] != $this->oldDataRecord["domain"]) || |
| | | if(empty($web_rec['php_open_basedir']) || |
| | | (!empty($this->dataRecord["domain"]) && !empty($this->oldDataRecord["domain"]) && $this->dataRecord["domain"] != $this->oldDataRecord["domain"]) || |
| | | (isset($this->dataRecord["client_group_id"]) && $this->dataRecord["client_group_id"] != $this->oldDataRecord["sys_groupid"])) { |
| | | $document_root = $app->db->quote(str_replace("[client_id]",$client_id,$document_root)); |
| | | $php_open_basedir = str_replace("[website_path]",$document_root,$web_config["php_open_basedir"]); |
| | |
| | | $sql = 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name'; |
| | | $records = $app->db->queryAllRecords($sql); |
| | | if(is_array($records)) { |
| | | $template_id_select=''; |
| | | foreach( $records as $rec) { |
| | | $selected = @($rec["template_id"] == $this->dataRecord["template_id"])?'SELECTED':''; |
| | | $template_id_select .= "<option value='$rec[template_id]' $selected>$rec[template_name]</option>\r\n"; |