Skip to content
......@@ -225,10 +225,10 @@ class remoting_lib extends tform_base {
return $sql;
}
function getDataRecord($primary_id) {
function getDataRecord($primary_id, $client_id = 0) {
global $app;
$escape = '`';
$this->loadUserProfile();
$this->loadUserProfile($client_id);
if(@is_numeric($primary_id)) {
if($primary_id > 0) {
// Return a single record
......@@ -238,7 +238,7 @@ class remoting_lib extends tform_base {
$sql = "SELECT * FROM ??";
return $app->db->queryAllRecords($sql, $this->formDef['db_table']);
} else {
throw new SoapFault('invalid_id', 'The ID has to be > 0 or -1.');
throw new ISPConfigRemoteException('invalid_id', 'The ID has to be > 0 or -1.');
return array();
}
} elseif (@is_array($primary_id) || @is_object($primary_id)) {
......@@ -308,7 +308,9 @@ class remoting_lib extends tform_base {
global $app;
$username = $params["username"];
$clear_password = $params["password"];
$language = $params['language'];
$client_id = $app->functions->intval($client_id);
if(!isset($params['_ispconfig_pw_crypted']) || $params['_ispconfig_pw_crypted'] != 1) $password = $app->auth->crypt_password(stripslashes($clear_password));
else $password = $clear_password;
$params = array($username);
......@@ -318,8 +320,15 @@ class remoting_lib extends tform_base {
} else {
$pwstring ="" ;
}
$langstring = '';
if (!empty($language)) {
$langstring = ', language = ?';
$params[] = $language;
}
$params[] = $client_id;
$sql = "UPDATE sys_user set username = ? $pwstring WHERE client_id = ?";
$sql = "UPDATE sys_user set username = ? $pwstring $langstring WHERE client_id = ?";
$app->db->query($sql, true, $params);
}
......
......@@ -173,11 +173,17 @@ class ISPConfigRESTHandler {
try {
$this->_return_json($return_code, call_user_func_array(array($this->classes[$class_name], $method), $params));
} catch(SoapFault $e) {
} catch(ISPConfigRemoteException $e) {
$this->_return_error(500, 'REQUEST ERROR', $e->getMessage());
}
}
}
?>
if(!class_exists('ISPConfigRemoteException')) {
class ISPConfigRemoteException extends Exception {
public function __construct($code = '', $message = '') {
parent::__construct($message . ' (' . $code . ')', 0);
}
}
}
\ No newline at end of file
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
class searchform {
public $debug = 0;
public $errorMessage;
public $listDef;
public $searchValues;
public $pagingHTML;
public $pagingValues;
public $searchChanged = 0;
public $module;
public function loadListDef($file, $module = '')
{
global $app, $conf;
if(!is_file($file)){
die("List-Definition: $file not found.");
}
include_once $file;
$this->listDef = $liste;
$this->module = $module;
//* Fill datasources
foreach($this->listDef['item'] as $key => $field) {
if(is_array($field['datasource'])) {
$this->listDef['item'][$key]['value'] = $this->getDatasourceData($field);
}
}
return true;
}
/**
* Get the key => value array of a form filed from a datasource definitiom
*
* @param field = array with field definition
* @param record = Dataset as array
* @return key => value array for the value field of a form
*/
public function getDatasourceData($field)
{
global $app;
$values = array();
if($field['datasource']['type'] == 'SQL') {
//* Preparing SQL string. We will replace some common placeholders
$querystring = $field['datasource']['querystring'];
$querystring = str_replace('{USERID}', $_SESSION['s']['user']['userid'], $querystring);
$querystring = str_replace('{GROUPID}', $_SESSION['s']['user']['default_group'], $querystring);
$querystring = str_replace('{GROUPS}', $_SESSION['s']['user']['groups'], $querystring);
$table_idx = $this->formDef['db_table_idx'];
//$querystring = str_replace('{RECORDID}',$record[$table_idx],$querystring);
$app->uses('tform');
$querystring = str_replace('{AUTHSQL}', $app->tform->getAuthSQL('r'), $querystring);
//* Getting the records
$tmp_records = $app->db->queryAllRecords($querystring);
if($app->db->errorMessage != ''){
die($app->db->errorMessage);
}
if(is_array($tmp_records)) {
$key_field = $field['datasource']['keyfield'];
$value_field = $field['datasource']['valuefield'];
foreach($tmp_records as $tmp_rec) {
$values[$tmp_rec[$key_field]] = $tmp_rec[$value_field];
}
}
}
if($field['datasource']['type'] == 'CUSTOM') {
//* Calls a custom class to validate this record
if($field['datasource']['class'] != '' and $field['datasource']['function'] != '') {
$datasource_class = $field['datasource']['class'];
$datasource_function = $field['datasource']['function'];
$app->uses($datasource_class);
$record = array();
$values = $app->$datasource_class->$datasource_function($field, $record);
}else{
$this->errorMessage .= "Custom datasource class or function is empty<br>\r\n";
}
}
return $values;
}
public function getSearchSQL($sql_where = '')
{
global $db;
//* Config vars
$list_name = $this->listDef['name'];
$search_prefix = $this->listDef['search_prefix'];
//* store retrieval query
foreach($this->listDef['item'] as $i) {
$field = $i['field'];
//* TODO ? hat sich die suche ge�ndert - has itself search ?
$ki = $search_prefix.$field;
if(isset($_REQUEST) and $_REQUEST[$ki] != $_SESSION['search'][$list_name][$ki]){
$this->searchChanged = 1;
}
//* suchfield in session store.
if(isset($_REQUEST[$ki])){
$_SESSION['search'][$list_name][$ki] = $_REQUEST[$ki];
}
if($i['formtype'] == 'SELECT'){
if(is_array($i['value'])) {
$out = '<option value=""></option>';
foreach($i['value'] as $k => $v) {
$selected = ($k == $_SESSION['search'][$list_name][$ki] && $_SESSION['search'][$list_name][$ki] != '') ? ' SELECTED' : '';
$out .= "<option value='$k'$selected>$v</option>\r\n";
}
}
$this->searchValues[$ki] = $out;
}else{
$this->searchValues[$ki] = $_SESSION['search'][$list_name][$ki];
}
}
//* store variables in object. $this->searchValues = $_SESSION["search"][$list_name];
foreach($this->listDef['item'] as $i) {
$field = $i['field'];
//if($_REQUEST[$search_prefix.$field] != '') $sql_where .= " $field ".$i["op"]." '".$i["prefix"].$_REQUEST[$search_prefix.$field].$i["suffix"]."' and";
if($_SESSION['search'][$list_name][$ki] != ''){
$sql_where .= " $field ".$i['op']." '".$i['prefix'].$_SESSION['search'][$list_name][$ki].$i['suffix']."' and";
}
}
return ($sql_where != '') ? substr($sql_where, 0, -3) : '1';
}
public function getPagingSQL($sql_where = '1') {
global $app, $conf;
$list_name = $this->listDef['name'];
$search_prefix = $this->listDef['search_prefix'];
$records_per_page = $this->listDef['records_per_page'];
$table = $this->listDef['table'];
//* set page to seror id session not set
if($_SESSION['search'][$list_name]['page'] == '') $_SESSION['search'][$list_name]['page'] = 0;
//* Set page size to request if set
if(isset($_REQUEST['page'])) $_SESSION['search'][$list_name]['page'] = $_REQUEST['page'];
//* TODO PAGE to 0 set, if look for themselves ge?ndert. = page auf 0 setzen, wenn suche sich ge�ndert hat.
if($this->searchChanged == 1) $_SESSION['search'][$list_name]['page'] = 0;
$sql_von = $_SESSION['search'][$list_name]['page'] * $records_per_page;
$record_count = $app->db->queryOneRecord("SELECT count(*) AS anzahl FROM ?? WHERE $sql_where", $table);
$pages = $app->functions->intval(($record_count['anzahl'] - 1) / $records_per_page);
$vars['list_file'] = $this->listDef['file'];
$vars['page'] = $_SESSION['search'][$list_name]['page'];
$vars['last_page'] = $_SESSION['search'][$list_name]['page'] - 1;
$vars['next_page'] = $_SESSION['search'][$list_name]['page'] + 1;
$vars['pages'] = $pages;
$vars['max_pages'] = $pages + 1;
$vars['records_gesamt'] = $record_count['anzahl'];
$vars['page_params'] = $this->listDef['page_params'];
if($_SESSION['search'][$list_name]['page'] > 0) $vars['show_page_back'] = 1;
if($_SESSION['search'][$list_name]['page'] <= $vars['pages'] - 1) $vars['show_page_next'] = 1;
$this->pagingValues = $vars;
$this->pagingHTML = $this->getPagingHTML($vars);
return "LIMIT $sql_von, $records_per_page";
}
public function getPagingHTML($vars) {
global $app;
$page_params = $vars['page_params'];
$list_file = $vars['list_file'];
$content = '<a href="'.$list_file.'?page=0'.$page_params.'"><img src="../themes/iprg/images/btn_left.png" border="0"></a> &nbsp; ';
if($vars['show_page_back'] == 1){
$content .= '<a href="'.$list_file.'?page='.$vars['last_page'].$page_params.'"><img src="../themes/iprg/images/btn_back.png" border="0"></a> ';
}
$content .= ' '.$app->lng('Page').' '.$vars['next_page'].' '.$app->lng('of').' '.$vars['max_pages'].' ';
if($vars['show_page_next'] == 1){
$content .= '<a href="'.$list_file.'?page='.$vars['next_page'].$page_params.'"><img src="../themes/iprg/images/btn_next.png" border="0"></a> &nbsp; ';
} else{
$content .= '&nbsp;';
}
$content .= '<a href="'.$list_file.'?page='.$vars['pages'].$page_params.'"> <img src="../themes/iprg/images/btn_right.png" border="0"></a>';
return $content;
}
public function getPagingHTMLasTXT($vars)
{
global $app;
$page_params = $vars['page_params'];
$list_file = $vars['list_file'];
$content = '[<a href="'.$list_file.'?page=0'.$page_params.'">|&lt;&lt; </a>]';
if($vars['show_page_back'] == 1){
$content .= '[<< <a href="'.$list_file.'?page='.$vars['last_page'].$page_params.'">'.$app->lng('Back').'</a>] ';
}
$content .= ' '.$app->lng('Page').' '.$vars['next_page'].' '.$app->lng('of').' '.$vars['max_pages'].' ';
if($vars['show_page_next'] == 1){
$content .= '[<a href="'.$vars['list_file'].'?page='.$vars['next_page'].$page_params.'">'.$app->lng('Next').' >></a>] ';
}
$content .= '[<a href="'.$list_file.'?page='.$vars['pages'].$page_params.'"> &gt;&gt;|</a>]';
return $content;
}
public function getSortSQL()
{
$sort_field = $this->listDef['sort_field'];
$sort_direction = $this->listDef['sort_direction'];
return ($sort_field != '' && $sort_direction != '') ? "ORDER BY $sort_field $sort_direction" : '';
}
public function saveSearchSettings($searchresult_name)
{
global $app, $conf;
$list_name = $this->listDef['name'];
$settings = $_SESSION['search'][$list_name];
unset($settings['page']);
$data = serialize($settings);
$userid = $_SESSION['s']['user']['userid'];
$groupid = $_SESSION['s']['user']['default_group'];
$sys_perm_user = 'riud';
$sys_perm_group = 'r';
$sys_perm_other = '';
$module = $_SESSION['s']['module']['name'];
$searchform = $this->listDef['name'];
$title = $searchresult_name;
$sql = 'INSERT INTO `searchform` ( '
.'`sys_userid` , `sys_groupid` , `sys_perm_user` , `sys_perm_group` , `sys_perm_other` , `module` , `searchform` , `title` , `data` '
.')VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)';
$app->db->query($sql, $userid, $groupid, $sys_perm_user, $sys_perm_group, $sys_perm_other, $module, $searchform, $title, $data);
}
public function decode($record)
{
global $app;
if(is_array($record)) {
foreach($this->listDef['item'] as $field) {
$key = $field['field'];
switch ($field['datatype'])
{
case 'DATE':
if($val > 0) {
$record[$key] = date($this->dateformat, $record[$key]);
}
break;
case 'INTEGER':
$record[$key] = $app->functions->intval($record[$key]);
break;
case 'DOUBLE':
$record[$key] = $record[$key];
break;
case 'CURRENCY':
$record[$key] = number_format($record[$key], 2, ',', '');
break;
case 'VARCHAR':
case 'TEXT':
default:
$record[$key] = stripslashes($record[$key]);
break;
}
}
}
return $record;
}
/* TODO: check for double quoting mysql value */
public function encode($record)
{
global $app;
if(is_array($record)) {
foreach($this->listDef['item'] as $field) {
$key = $field['field'];
switch ($field['datatype'])
{
case 'VARCHAR':
case 'TEXT':
if(!is_array($record[$key])) {
$record[$key] = $app->db->quote($record[$key]);
} else {
$record[$key] = implode($this->tableDef[$key]['separator'], $record[$key]);
}
break;
case 'DATE':
if($record[$key] > 0) {
list($tag, $monat, $jahr) = explode('.', $record[$key]);
$record[$key] = mktime(0, 0, 0, $monat, $tag, $jahr);
}
break;
case 'INTEGER':
$record[$key] = $app->functions->intval($record[$key]);
break;
case 'DOUBLE':
$record[$key] = $app->db->quote($record[$key]);
break;
case 'CURRENCY':
$record[$key] = str_replace(',', '.', $record[$key]);
break;
}
}
}
return $record;
}
}
?>
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
class searchform_actions {
var $id;
var $idx_key;
var $DataRowColor;
var $SQLExtWhere = '';
var $SQLOrderBy = '';
function onLoad() {
global $app, $conf, $list_def_file;
if(!is_object($app->tpl)) $app->uses('tpl');
if(!is_object($app->searchform)) $app->uses('searchform');
if(!is_object($app->tform)) $app->uses('tform');
// Load list definition
$app->searchform->loadListDef($list_def_file);
// Delete the search form contents, if requested
if($_REQUEST["empty_searchfields"] == 'yes') {
$list_name = $app->searchform->listDef["name"];
unset($_SESSION["search"][$list_name]);
}
// Save the search for later usage
if($_REQUEST["btn_submit_search_save"] && $_REQUEST["search_save_as"] != '') {
$app->searchform->saveSearchSettings($_REQUEST["search_save_as"]);
}
// Set th returnto value for forms
$_SESSION["s"]["form"]["return_to_url"] = $app->searchform->listDef["file"];
if(!is_file('templates/'.$app->searchform->listDef["name"].'_search.htm')) {
$app->uses('searchform_tpl_generator');
$app->searchform_tpl_generator->buildHTML($app->searchform->listDef);
}
$app->tpl->newTemplate("searchpage.tpl.htm");
$app->tpl->setInclude('content_tpl', 'templates/'.$app->searchform->listDef["name"].'_search.htm');
// Getting Datasets from DB
$records = $app->db->queryAllRecords($this->getQueryString());
$this->DataRowColor = "#FFFFFF";
if(is_array($records)) {
$this->idx_key = $app->searchform->listDef["table_idx"];
foreach($records as $rec) {
$records_new[] = $this->prepareDataRow($rec);
}
}
$app->tpl->setLoop('records', $records_new);
//print_r($records_new);
$this->onShow();
}
function prepareDataRow($rec) {
global $app;
$rec = $app->searchform->decode($rec);
// Alternating datarow colors
$this->DataRowColor = ($this->DataRowColor == "#FFFFFF")?"#EEEEEE":"#FFFFFF";
$rec["bgcolor"] = $this->DataRowColor;
// substitute value for select fields
foreach($app->searchform->listDef["item"] as $field) {
$key = $field["field"];
if($field['formtype'] == "SELECT") {
if($rec[$key] == 'y' or $rec[$key] == 'n') {
// Set a additional image variable for bolean fields
$rec['_'.$key.'_'] = ($rec[$key] == 'y')?'list_icon_true.png':'list_icon_false.png';
}
// substitute value for select field
$rec[$key] = $field['value'][$rec[$key]];
}
}
// The variable "id" contains always the index variable
$rec["id"] = $rec[$this->idx_key];
return $rec;
}
function getQueryString() {
global $app;
// Generate the search sql
if($app->searchform->listDef["auth"] != 'no') {
if($_SESSION["s"]["user"]["typ"] == "admin") {
$sql_where = "";
} else {
$sql_where = $app->tform->getAuthSQL('r')." and";
}
}
if($this->SQLExtWhere != '') {
$sql_where .= " ".$this->SQLExtWhere." and";
}
$sql_where = $app->searchform->getSearchSQL($sql_where);
$app->tpl->setVar($app->searchform->searchValues);
$order_by_sql = $this->SQLOrderBy;
// Generate SQL for paging
$limit_sql = $app->searchform->getPagingSQL($sql_where);
$app->tpl->setVar("paging", $app->searchform->pagingHTML);
return "SELECT * FROM ".$app->searchform->listDef["table"]." WHERE $sql_where $order_by_sql $limit_sql";
}
function onShow() {
global $app;
// Language File setzen
$lng_file = ISPC_WEB_PATH.'/lang/lib/lang/'.$_SESSION['s']['language'].'_list.lng';
if(!file_exists($lng_file)) $lng_file = ISPC_WEB_PATH.'/lang/lib/lang/en_'.'_list.lng';
include $lng_file;
$lng_file = "lib/lang/".$_SESSION["s"]["language"]."_".$app->searchform->listDef['name']."_search.lng";
if(!file_exists($lng_file)) $lng_file = 'lib/lang/en_'.$app->searchform->listDef['name']."_search.lng";
include $lng_file;
$app->tpl->setVar($wb);
$app->tpl->setVar("form_action", $app->searchform->listDef["file"]);
// Parse the templates and send output to the browser
$this->onShowEnd();
}
function onShowEnd() {
global $app;
if(count($_REQUEST) > 0) {
$app->tpl->setVar('searchresult_visible', 1);
if($_REQUEST['searchresult_visible'] == 'no') $app->tpl->setVar('searchresult_visible', 0);
if($_REQUEST['searchform_visible'] == 'yes') {
$app->tpl->setVar('searchform_visible', 1);
} else {
$app->tpl->setVar('searchform_visible', 0);
}
} else {
$app->tpl->setVar('searchform_visible', 1);
if($_REQUEST['searchform_visible'] == 'no') $app->tpl->setVar('searchform_visible', 0);
if($_REQUEST['searchresult_visible'] == 'yes') {
$app->tpl->setVar('searchresult_visible', 1);
} else {
$app->tpl->setVar('searchresult_visible', 0);
}
}
// make columns visible
$visible_columns = explode(",", $app->searchform->listDef['default_columns']);
foreach($visible_columns as $col) {
$app->tpl->setVar($col.'_visible', 1);
}
$app->tpl_defaults();
$app->tpl->pparse();
}
}
?>
<?php
/*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
class searchform_tpl_generator {
function buildHTML($listDef, $module = '') {
global $app;
$lang = array();
$html = '<form name="myform" action="'.$listDef["file"].'" method="POST">
<div class="frmTextHead"><tmpl_var name="list_head_txt"></div><br />
<tmpl_if name="searchform_visible">
<table border="0" cellspacing="0" cellpadding="4">';
$lang["list_head_txt"] = $listDef["name"];
foreach($listDef["item"] as $field) {
$key = $field["field"];
if($field["formtype"] == 'SELECT') {
$html .= "
<tr>
<td class=\"frmText11\"><tmpl_var name=\"".$key."_txt\">:</td>
<td><select name=\"".$listDef["search_prefix"].$key."\">{tmpl_var name='".$listDef["search_prefix"].$key."'}</select></td>
</tr>";
} else {
$html .= "
<tr>
<td class=\"frmText11\"><tmpl_var name=\"".$key."_txt\">:</td>
<td><input type=\"text\" name=\"".$listDef["search_prefix"].$key."\" value=\"{tmpl_var name='".$listDef["search_prefix"].$key."'}\" class=\"text\" /></td>
</tr>";
}
}
$html .= '
<tr>
<td colspan="2" align="center"><input name="Filter" type="image" id="Filter" src="../themes/iprg/images/btn_filter.png"></td>
</tr>
</table>
</tmpl_if>
<tmpl_if name="searchresult_visible">
<p>
[<a class="frmText11" href="domain_search.php?searchform_visible=yes&searchresult_visible=no&empty_searchfields=yes">Neue Suche</a>]
[<a class="frmText11" href="domain_search.php?searchform_visible=yes&searchresult_visible=no&empty_searchfields=no">Suchkriterien ändern</a>]
Suche speichern unter: <input type="text" name="search_save_as" /> <input type="submit" name="btn_submit_search_save" value="Speichern" />
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
';
$lang["list_head_txt"] = $listDef["name"];
foreach($listDef["item"] as $field) {
$key = $field["field"];
$html .= "<tmpl_if name='".$key."_visible'>";
$html .= " <td class=\"tblHead\"><tmpl_var name=\"".$key."_txt\"></td>\r\n";
$html .= "</tmpl_if>";
$lang[$key."_txt"] = $key;
}
$html .= ' <td class="tblHead">&nbsp;</td>
</tr>
<tmpl_loop name="records">
<tr bgcolor="{tmpl_var name="bgcolor"}">
';
foreach($listDef["item"] as $field) {
$key = $field["field"];
$html .= "<tmpl_if name='".$key."_visible'>";
$html .= " <td class=\"frmText11\"><a href=\"".$listDef["edit_file"]."?id={tmpl_var name='id'}\" class=\"frmText11\">{tmpl_var name=\"".$key."\"}</a></td>\r\n";
$html .= "</tmpl_if>";
}
$html .= " <td class=\"frmText11\" align=\"right\">[<a href=\"javascript: del_record('".$listDef["delete_file"]."?id={tmpl_var name='id'}&phpsessid={tmpl_var name='phpsessid'}');\" class=\"frmText11\">{tmpl_var name='delete_txt'}</a>]</td>
</tr>
</tmpl_loop>
";
$html .= '
</table><table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td height="40" align="center" class="tblFooter"><tmpl_var name="paging"></td>
</tr>
</table>
</tmpl_if>
</form>';
if($module == '') {
$filename = 'templates/'.$listDef["name"].'_search.htm';
} else {
$filename = '../'.$module.'/templates/'.$listDef["name"].'_search.htm';
}
// speichere Template
if (!$handle = fopen($filename, 'w')) {
print "Cannot open file ($filename)";
exit;
}
if (!fwrite($handle, $html)) {
print "Cannot write to file ($filename)";
exit;
}
fclose($handle);
}
}
?>
......@@ -36,7 +36,11 @@ class session {
private $permanent = false;
function __construct($session_timeout = 0) {
$this->db = new db;
try {
$this->db = new db;
} catch (Exception $e) {
$this->db = false;
}
$this->timeout = $session_timeout;
}
......
......@@ -71,25 +71,31 @@ class ISPConfigSoapHandler {
public function __call($method, $params) {
if(array_key_exists($method, $this->methods) == false) {
throw new SoapFault('invalid_method', 'Method ' . $method . ' does not exist');
throw new ISPConfigRemoteException('invalid_method', 'Method ' . $method . ' does not exist');
}
$class_name = $this->methods[$method];
if(array_key_exists($class_name, $this->classes) == false) {
throw new SoapFault('invalid_class', 'Class ' . $class_name . ' does not exist');
throw new ISPConfigRemoteException('invalid_class', 'Class ' . $class_name . ' does not exist');
}
if(method_exists($this->classes[$class_name], $method) == false) {
throw new SoapFault('invalid_method', 'Method ' . $method . ' does not exist in the class it was expected (' . $class_name . ')');
throw new ISPConfigRemoteException('invalid_method', 'Method ' . $method . ' does not exist in the class it was expected (' . $class_name . ')');
}
try {
return call_user_func_array(array($this->classes[$class_name], $method), $params);
} catch(SoapFault $e) {
} catch(ISPConfigRemoteException $e) {
throw $e;
}
}
}
?>
if(!class_exists('ISPConfigRemoteException')) {
class ISPConfigRemoteException extends SoapFault {
public function __construct($code = '', $message = '') {
parent::__construct($code, $message);
}
}
}
......@@ -41,7 +41,7 @@ class system {
// simple query cache
if($this->client_service===null)
$this->client_service = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = ? AND sys_user.client_id = client.client_id", $userid);
$this->client_service = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = ? AND sys_user.client_id = client.client_id", $userid);
// isn't service
if(!$this->client_service) return false;
......
......@@ -132,20 +132,25 @@ class tform extends tform_base {
function isReadonlyTab($tab, $primary_id) {
global $app, $conf;
if(isset($this->formDef['tabs'][$tab]['readonly']) && $this->formDef['tabs'][$tab]['readonly'] == true) {
// Add backticks for incomplete table names.
if(stristr($this->formDef['db_table'], '.')) {
$escape = '';
} else {
$escape = '`';
}
// Add backticks for incomplete table names.
if(stristr($this->formDef['db_table'], '.')) {
$escape = '';
} else {
$escape = '`';
}
$sql = "SELECT sys_userid FROM ?? WHERE ?? = ?";
$record = $app->db->queryOneRecord($sql, $this->formDef['db_table'], $this->formDef['db_table_idx'], $primary_id);
$sql = "SELECT sys_userid FROM ?? WHERE ?? = ?";
$record = $app->db->queryOneRecord($sql, $this->formDef['db_table'], $this->formDef['db_table_idx'], $primary_id);
// return true if the readonly flag of the form is set and the current loggedin user is not the owner of the record.
if(isset($this->formDef['tabs'][$tab]['readonly']) && $this->formDef['tabs'][$tab]['readonly'] == true && $record['sys_userid'] != $_SESSION["s"]["user"]["userid"]) {
return true;
// return true if the readonly flag of the form is set and the current loggedin user is not the owner of the record.
if($record['sys_userid'] != $_SESSION["s"]["user"]["userid"]) {
return true;
} else {
return false;
}
} else {
return false;
}
......
......@@ -134,7 +134,7 @@ class tform_base {
$this->module = $module;
$wb = array();
include_once ISPC_ROOT_PATH.'/lib/lang/'.$_SESSION['s']['language'].'.lng';
include_once ISPC_ROOT_PATH.'/lib/lang/'.$app->functions->check_language($_SESSION['s']['language']).'.lng';
if(is_array($wb)) $wb_global = $wb;
......@@ -143,7 +143,7 @@ class tform_base {
if(!file_exists($lng_file)) $lng_file = "lib/lang/en_".$this->formDef["name"].".lng";
include $lng_file;
} else {
$lng_file = "../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng";
$lng_file = "../$module/lib/lang/".$app->functions->check_language($_SESSION["s"]["language"])."_".$this->formDef["name"].".lng";
if(!file_exists($lng_file)) $lng_file = "../$module/lib/lang/en_".$this->formDef["name"].".lng";
include $lng_file;
}
......@@ -155,6 +155,66 @@ class tform_base {
$this->wordbook = $wb;
// load wordbook/lang files from addons
if($module == '') {
$lng_path = 'lib/lang.d';
} else {
$lng_path = '../' . $module . '/lib/lang.d';
}
if(($dir = opendir($lng_path))) {
$fallback_files = array();
$use_files = array();
while(false !== ($cur = readdir($dir))) {
$lng_file = $lng_path . '/' . $cur;
if(is_file($lng_file) && substr($cur, -strlen('.'.$this->formDef["name"].".lng")) === '.'.$this->formDef["name"].".lng") {
if(substr($cur, 0, 3) === 'en_') {
$fallback_files[] = $cur;
} elseif(substr($cur, 0, 3) === $app->functions->check_language($_SESSION["s"]["language"]) . '_') {
$use_files[] = $cur;
}
}
}
closedir($dir);
foreach($fallback_files as $cur) {
$cur_lng = $app->functions->check_language($_SESSION["s"]["language"]) . '_' . substr($cur, 3);
if(in_array($cur_lng, $use_files, true) == false) {
$use_files[] = $cur;
}
}
unset($fallback_files);
reset($use_files);
foreach($use_files as $cur) {
$lng_file = $lng_path . '/' . $cur;
include $lng_file;
if(isset($wb) && is_array($wb)) {
$this->wordbook = $app->functions->array_merge($this->wordbook, $wb);
}
}
unset($use_files);
}
if($module != '') {
// load tform files from addons
$tform_path = '../' . $module . '/lib/form.d';
if(($dir = opendir($tform_path))) {
$tabs = null;
while(false !== ($cur = readdir($dir))) {
$tform_file = $tform_path . '/' . $cur;
if(is_file($tform_file) && substr($cur, -strlen('.'.$this->formDef["name"].".tform.php")) === '.'.$this->formDef["name"].".tform.php") {
unset($tabs); // just in case someone does not create a new array in the tform file
include($tform_file);
if(isset($tabs) && is_array($tabs) && !empty($tabs)) {
$this->tform['tabs'] = array_replace_recursive($this->tform['tabs'], $tabs);
}
}
}
closedir($dir);
}
}
$app->plugin->raiseEvent($_SESSION['s']['module']['name'].':'.$app->tform->formDef['name'] . ':on_after_formdef', $this);
$this->dateformat = $app->lng('conf_format_dateshort');
......@@ -1393,7 +1453,7 @@ class tform_base {
} else {
if($this->formDef['auth'] == 'yes') {
if($primary_id != 0) {
if($api == true && $_SESSION["s"]["user"]["client_id"] > 0 && $_SESSION["s"]["user"]["iserid"] > 0 && $_SESSION["s"]["user"]["default_group"] > 0) {
if($api == true && $_SESSION["s"]["user"]["client_id"] > 0 && $_SESSION["s"]["user"]["userid"] > 0 && $_SESSION["s"]["user"]["default_group"] > 0) {
$sql_update .= '`sys_userid` = '.$this->sys_userid.', ';
$sql_update .= '`sys_groupid` = '.$this->sys_default_group.', ';
}
......
......@@ -298,7 +298,7 @@ class tform_tpl_generator {
function lng_add($lang, $formDef) {
global $go_api, $go_info, $conf;
$lng_file = "lib/lang/".$conf["language"]."_".$formDef['name'].".lng";
$lng_file = "lib/lang/".$app->functions->check_language($conf["language"])."_".$formDef['name'].".lng";
if(is_file($lng_file)) {
include $lng_file;
} else {
......
......@@ -504,39 +504,6 @@ class tools_monitor {
return $html;
}
function showMongoDB() {
global $app;
/* fetch the Data from the DB */
$record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'log_mongodb' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']);
if(isset($record['data'])) {
$html =
'<div class="systemmonitor-state state-'.$record['state'].'">
<div class="systemmonitor-content icons32 ico-'.$record['state'].'">';
/*
* First, we have to detect, if there is any monitoring-data.
* If not (because mongodb is not installed) show this.
*/
$data = unserialize($record['data']);
if ($data == '') {
$html .= '<p>'.
'MongoDB is not installed on this server.<br />' .
'</p>';
}
else {
$html .= nl2br($data);
}
$html .= '</div></div>';
} else {
$html = '<p>There is no data available at the moment.</p>';
}
return $html;
}
function showIPTables() {
global $app;
$record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'iptables_rules' and server_id = ? ORDER BY created DESC", $_SESSION['monitor']['server_id']);
......
......@@ -52,8 +52,9 @@ class validate_autoresponder extends validate_datetime
//$start_date = $app->tform_actions->dataRecord['autoresponder_start_date'];
// Parse date
$start_date_array = date_parse_from_format($app->lng('conf_format_datetime'),$start_date);
$end_date_array = date_parse_from_format($app->lng('conf_format_datetime'),$field_value);
$datetimeformat = (isset($app->remoting_lib) ? $app->remoting_lib->datetimeformat : $app->tform->datetimeformat);
$start_date_array = date_parse_from_format($datetimeformat,$start_date);
$end_date_array = date_parse_from_format($datetimeformat,$field_value);
//calculate timestamps
$start_date_tstamp = mktime($start_date_array['hour'], $start_date_array['minute'], $start_date_array['second'], $start_date_array['month'], $start_date_array['day'], $start_date_array['year']);
......
......@@ -124,9 +124,6 @@ class validate_client {
$used_servers = $app->db->queryAllRecords('SELECT domain_id FROM mail_domain INNER JOIN sys_user ON mail_domain.sys_userid = sys_user.userid WHERE client_id = ? AND server_id NOT IN ?', $client_id, $field_value);
break;
case 'xmpp_servers':
$used_servers = $app->db->queryAllRecords('SELECT domain_id FROM xmpp_domain INNER JOIN sys_user ON xmpp_domain.sys_userid = sys_user.userid WHERE client_id = ? AND server_id NOT IN ?', $client_id, $field_value);
break;
}
if ($used_servers === null || count($used_servers))
......@@ -196,7 +193,7 @@ class validate_client {
}
*/
} catch(SoapFault $e) {
} catch(ISPConfigRemoteException $e) {
//echo 'Error, see message: '.$e->faultstring;
switch ($e->faultstring) {
case 'INVALID_INPUT':
......@@ -215,7 +212,7 @@ class validate_client {
break;
}
}
} catch(SoapFault $e){
} catch(ISPConfigRemoteException $e){
// Connection to host not possible, europe.eu down?
// this shouldn't be the user's fault, so we return no error
}
......
......@@ -191,7 +191,7 @@ class validate_domain {
/* internal validator function to match regexp */
function _regex_validate($domain_name, $allow_wildcard = false) {
$pattern = '/^' . ($allow_wildcard == true ? '(\*\.)?' : '') . '[\w\.\-]{2,255}\.[a-zA-Z0-9\-]{2,30}$/';
$pattern = '/^' . ($allow_wildcard == true ? '(\*\.)?' : '') . '[\w\.\-]{1,255}\.[a-zA-Z0-9\-]{2,30}$/';
return preg_match($pattern, $domain_name);
}
......
<?php
/**
Copyright (c) 2015, Florian Schaal, schaal @it
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@author Florian Schaal, info@schaal-24.de
@copyright Florian Schaal, info@schaal-24.de
*/
class validate_openvz {
function get_error($errmsg, $additional='') {
global $app;
if(isset($app->tform->wordbook[$errmsg])) {
return $app->tform->wordbook[$errmsg].$additional."<br>\r\n";
} else {
return $errmsg."<br>".$additional."<br>\r\n";
}
}
function check_custom($field_name, $field_value, $validator) {
$template = file('../vm/templates/openvz.conf.tpl', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$custom_array = explode("\n", $field_value);
$used_parameters = array();
foreach ($template as $line) {
$line = trim ($line);
if (preg_match('/^[^#].*=\".*\"/', $line)) {
$line = explode('=', $line, 2);
$used_parameters[] = $line[0];
}
}
foreach ($custom_array as $check) {
$check = trim(strtoupper($check));
$check = explode('=', trim($check), 2);
$check = trim($check[0]);
if (in_array($check, $used_parameters)) {
return $this->get_error($validator['errmsg'], $check);
}
}
}
}
......@@ -71,7 +71,7 @@ class validate_password {
} else if ($points == 1) {
if ($length >= 5 && $length <= 6) {
return 2;
} else if (length >= 7 && length <=10) {
} else if ($length >= 7 && $length <=10) {
return 3;
} else {
return 4;
......@@ -111,10 +111,8 @@ class validate_password {
$app->uses('ini_parser,getconf');
$server_config_array = $app->getconf->get_global_config();
$min_password_strength = 0;
$min_password_length = 5;
if(isset($server_config_array['misc']['min_password_length'])) $min_password_length = $server_config_array['misc']['min_password_length'];
if(isset($server_config_array['misc']['min_password_strength'])) $min_password_strength = $server_config_array['misc']['min_password_strength'];
$min_password_length = $app->auth->get_min_password_length();
$min_password_strength = $app->auth->get_min_password_strength();
if($min_password_strength > 0) {
$lng_text = $app->lng('weak_password_txt');
......
......@@ -45,7 +45,7 @@ $revision = str_replace(array('Revision:', '$', ' '), '', $svn_revision);
//** Application
define('ISPC_APP_TITLE', 'ISPConfig');
define('ISPC_APP_VERSION', '3.1dev');
define('ISPC_APP_VERSION', '3.2.0dev');
define('DEVSYSTEM', 0);
......
<?php
$wb['conf_format_dateshort'] = "Y-m-d";
$wb['conf_format_dateshort_human_readable'] = "yyyy-mm-dd";
$wb['conf_format_datelong'] = "l dS of F Y";
$wb['conf_format_timeshort'] = "H:i";
$wb['conf_format_timelong'] = "H:i:s";
$wb['conf_format_datetime'] = "Y-m-d H:i";
$wb['number_format_decimals'] = '4';
$wb['number_format_decimals_client'] = '2';
$wb['number_format_dec_point'] = '.';
$wb['number_format_thousands_sep'] = '';
$wb['error_301'] = "Module not permitted for the current user.";
$wb['error_302'] = "ماژول نامعتبر.";
$wb['error_1001'] = "نام کاربری و رمز عبور نمی تواند خالی باشد.";
$wb['error_1002'] = "نام کاربری یا رمز عبور اشتباه است!";
$wb['error_1003'] = "کاربر غیرفعال شده است.";
$wb['delete_confirmation'] = "واقعا مایل به حذف این رکورد هستید؟";
$wb['error_no_view_permission'] = "شما دسترسی لازم برای نمایش این رکورد را ندارید و یا رکورد موجود نیست!";
$wb['error_no_delete_permission'] = "شما اجازه حذف این رکورد را ندارید!";
$wb['page_txt'] = "صفحه";
$wb['page_of_txt'] = "از";
$wb['page_and_txt'] = "و";
$wb['page_next_txt'] = "بعدی";
$wb['page_back_txt'] = "بازگشت";
$wb['delete_txt'] = "حذف";
$wb['filter_txt'] = "فیلتر";
$wb['add_new_record_txt'] = "ایجاد رکورد جدید";
$wb['btn_save_txt'] = "ذخیره";
$wb['btn_cancel_txt'] = "لغو";
$wb['top_menu_system'] = 'سامانه';
$wb['top_menu_client'] = 'مشتری';
$wb['top_menu_email'] = 'رایانامه';
$wb['top_menu_monitor'] = 'مونیتور کردن';
$wb['top_menu_sites'] = 'وب سایت ها';
$wb['top_menu_dns'] = 'DNS';
$wb['top_menu_tools'] = 'ابزارها';
$wb['top_menu_help'] = 'راهنما';
$wb['top_menu_billing'] = 'صورت حساب';
$wb['top_menu_mailuser'] = 'Mailuser';
$wb['top_menu_domain'] = 'دامنه ها';
$wb['top_menu_dashboard'] = 'خانه';
$wb['top_menu_vm'] = 'VServer';
$wb['toolsarea_head_txt'] = 'ابزارها';
$wb['latest_news_txt'] = 'آخرین خبرها';
$wb['logout_txt'] = "برون رفت";
$wb['daynamesmin_su'] = "یکشنبه";
$wb['daynamesmin_mo'] = "دوشنبه";
$wb['daynamesmin_tu'] = "سه شنبه";
$wb['daynamesmin_we'] = "چهارشنبه";
$wb['daynamesmin_th'] = "پنج شنبه";
$wb['daynamesmin_fr'] = "جمعه";
$wb['daynamesmin_sa'] = "شنبه";
$wb['daynames_sunday'] = "یکشنبه";
$wb['daynames_monday'] = "دوشنبه";
$wb['daynames_tuesday'] = "سه شنبه";
$wb['daynames_wednesday'] = "چهارشنبه";
$wb['daynames_thursday'] = "پنج شنبه";
$wb['daynames_friday'] = "جمعه";
$wb['daynames_saturday'] = "شنبه";
$wb['monthnamesshort_jan'] = "Jan";
$wb['monthnamesshort_feb'] = "Feb";
$wb['monthnamesshort_mar'] = "Mar";
$wb['monthnamesshort_apr'] = "Apr";
$wb['monthnamesshort_may'] = "May";
$wb['monthnamesshort_jun'] = "Jun";
$wb['monthnamesshort_jul'] = "Jul";
$wb['monthnamesshort_aug'] = "Aug";
$wb['monthnamesshort_sep'] = "Sep";
$wb['monthnamesshort_oct'] = "Oct";
$wb['monthnamesshort_nov'] = "Nov";
$wb['monthnamesshort_dec'] = "Dec";
$wb['datepicker_nextText'] = "Next";
$wb['datepicker_prevText'] = "Prev";
$wb['submit_confirmation'] = "واقعا قصد انجام این کار را دارید؟";
$wb['globalsearch_resultslimit_of_txt'] = "از";
$wb['globalsearch_resultslimit_results_txt'] = "نتیجه ها";
$wb['globalsearch_noresults_text_txt'] = "نتیجه ای یافت نشد.";
$wb['globalsearch_noresults_limit_txt'] = "0 نتیجه";
$wb['globalsearch_searchfield_watermark_txt'] = "جستجو";
$wb['globalsearch_suggestions_text_txt'] = "پیشنهادات";
$wb['global_tabchange_warning_txt'] = 'Changed data in this tab will be changed if you press OK. On cancel they will be discarded.';
$wb['global_tabchange_discard_txt'] = 'شما تغییرات ذخیره نشده ای در این صفحه دارید، در صورت ادامه تغییر لغو خواهند شد.';
$wb['datalog_changes_txt'] = 'تغییرات اعمال شده هنوز برای همه سرورها اعمال نشده است:';
$wb['datalog_changes_end_txt'] = 'ذخیره تغییرات تا دقایقی طول خواهند کشید. لطفا شکیبا باشید.';
$wb['datalog_status_i_web_database'] = 'ساخت پایگاه داده جدید';
$wb['datalog_status_u_web_database'] = 'بروزرسانی پایگاه داده';
$wb['datalog_status_d_web_database'] = 'حذف پایگاه داده';
$wb['datalog_status_i_web_database_user'] = 'ساخت کاربر برای پایگاه داده';
$wb['datalog_status_u_web_database_user'] = 'بروزرسانی کاربر پایگاه داده';
$wb['datalog_status_d_web_database_user'] = 'حذف کاربر پایگاه داده';
$wb['datalog_status_i_web_domain'] = 'ایجاد وب سایت جدید';
$wb['datalog_status_u_web_domain'] = 'بروزرسانی تنظیماته وب سایت';
$wb['datalog_status_d_web_domain'] = 'حذف وب سایت';
$wb['datalog_status_i_ftp_user'] = 'ساخت کاربر FTP';
$wb['datalog_status_u_ftp_user'] = 'بروزرسانی کاربر FTP';
$wb['datalog_status_d_ftp_user'] = 'حذف کاربر FTP';
$wb['datalog_status_i_mail_domain'] = 'ایجاد ایمیل دامنه';
$wb['datalog_status_u_mail_domain'] = 'بروزرسانی ایمیل دامنه';
$wb['datalog_status_d_mail_domain'] = 'حذف ایمیل دامنه';
$wb['datalog_status_i_mail_user'] = 'ساخت کاربر ایمیل';
$wb['datalog_status_u_mail_user'] = 'بروزرسانی کاربر ایمیل';
$wb['datalog_status_d_mail_user'] = 'حذف کاربر ایمیل';
$wb['datalog_status_i_spamfilter_users'] = 'ساخت تنظیمات فیلتر هرزنامه';
$wb['datalog_status_u_spamfilter_users'] = 'بروزرسانی تنظیمات فیلتر هرزنامه';
$wb['datalog_status_d_spamfilter_users'] = 'حذف تنظیمات فیلتر هرزنامه';
$wb['datalog_status_i_mail_forwarding'] = 'ساخت آدرس ایمیل';
$wb['datalog_status_u_mail_forwarding'] = 'بروزرسانی آدرس ایمیل';
$wb['datalog_status_d_mail_forwarding'] = 'حذف آدرس ایمیل';
$wb['datalog_status_i_dns_rr'] = 'ساخت رکورد DNS';
$wb['datalog_status_u_dns_rr'] = 'بروزرسانی رکورد DNS';
$wb['datalog_status_d_dns_rr'] = 'حذف رکورد DNS';
$wb['datalog_status_i_dns_soa'] = 'ساخت DNS zone';
$wb['datalog_status_u_dns_soa'] = 'بروزرسانی DNS zone';
$wb['datalog_status_d_dns_soa'] = 'حذف DNS zone';
$wb['datalog_status_i_cron'] = 'ساخت cron job';
$wb['datalog_status_u_cron'] = 'بروزرسانی cron job';
$wb['datalog_status_d_cron'] = 'حذف cron job';
$wb['datalog_status_i_mail_get'] = 'Create mail fetcher account';
$wb['datalog_status_u_mail_get'] = 'Update mail fetcher account';
$wb['datalog_status_d_mail_get'] = 'Delete mail fetcher account';
$wb['datalog_status_i_mail_mailinglist'] = 'ساخت لیست ایمیل';
$wb['datalog_status_u_mail_mailinglist'] = 'بروزرسانی لیست ایمیل';
$wb['datalog_status_d_mail_mailinglist'] = 'حذف لیست ایمیل';
$wb['datalog_status_i_mail_ml_membership'] = 'ساخت کاربر برای لیست ایمیل';
$wb['datalog_status_u_mail_ml_membership'] = 'بروزرسانی کاربر برای لیست ایمیل';
$wb['datalog_status_d_mail_ml_membership'] = 'حذف کاربر برای لیست ایمیل';
$wb['datalog_status_i_shell_user'] = 'ساخت shell user';
$wb['datalog_status_u_shell_user'] = 'بروزرسانی shell user';
$wb['datalog_status_d_shell_user'] = 'حذف shell user';
$wb['datalog_status_i_web_folder'] = 'ساخت محافظ پوشه';
$wb['datalog_status_u_web_folder'] = 'بروزرسانی محافظ پوشه';
$wb['datalog_status_d_web_folder'] = 'حذف محافظ پوشه';
$wb['datalog_status_i_web_folder_user'] = 'ساخت کاربر محافظ پوشه';
$wb['datalog_status_u_web_folder_user'] = 'بروزرسانی کاربر محافظ پوشه';
$wb['datalog_status_d_web_folder_user'] = 'حذف کاربر محافظ پوشه';
$wb['datalog_status_i_xmpp_domain'] = 'Create XMPP domain';
$wb['datalog_status_u_xmpp_domain'] = 'Update XMPP domain';
$wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain';
$wb['datalog_status_i_xmpp_user'] = 'Create XMPP user';
$wb['datalog_status_u_xmpp_user'] = 'Update XMPP user';
$wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user';
$wb['err_csrf_attempt_blocked'] = 'CSRF attempt blocked.';
$wb['login_as_txt'] = 'وارد شدن بعنوان';
$wb["no_domain_perm"] = 'دسترسی ای برای این دامنه ندارید.';
$wb["no_destination_perm"] = 'دسترسی ای برای این مقصد ندارید.';
$wb['client_you_are_locked'] = 'دسترسی ای برای تغییر هیچ تنظیماتی ندارید.';
$wb['gender_m_txt'] = 'آقای.';
$wb['gender_f_txt'] = 'خانم.';
$wb['client_cannot_be_deleted_because_of_billing_module_txt'] = 'مشتری اطلاعاتی در ماژول صورت حساب دارد و قابل حذف نیست.';
$wb['yes_txt'] = 'بلی';
$wb['no_txt'] = 'خیر';
$wb['None'] = 'هیچکدام';
$wb['strength_1'] = 'ضعیف';
$wb['strength_2'] = 'نسبتا خوب';
$wb['strength_3'] = 'خوب';
$wb['strength_4'] = 'قوی';
$wb['strength_5'] = 'خیلی قوی';
$wb['weak_password_txt'] = 'رمز عبور شما مطابق با معیارهای امنیتی نیست. رمز عبور حداقل باید {chars} حرف باشد و حداقل دارای معیار قوی بودن "{strength}" باشد.';
$wb['weak_password_length_txt'] = 'رمز عبور شما مطابق با معیارهای امنیتی نیست. رمز عبور حداقل باید {chars} حرف باشد.';
$wb['security_check1_txt'] = 'دسترسی های امنیتی را چک نمایید:';
$wb['security_check2_txt'] = 'ناموفق.';
$wb['select_directive_snippet_txt'] = 'Directive Snippets';
$wb['select_master_directive_snippet_txt'] = 'Master Directive Snippets';
$wb['datalog_changes_close_txt'] = 'بستن';
?>
\ No newline at end of file
......@@ -88,14 +88,6 @@ class mail_mail_domain_plugin {
}
}
//* Update the mailinglist
$mailing_lists = $app->db->queryAllRecords("SELECT mailinglist_id FROM mail_mailinglist WHERE domain = ?", $page_form->oldDataRecord['domain']);
if(is_array($mailing_lists)) {
foreach($mailing_lists as $rec) {
$app->db->datalogUpdate('mail_mailinglist', array("sys_userid" => $client_user_id, "sys_groupid" => $sys_groupid), 'mailinglist_id', $rec['mailinglist_id']);
}
}
//* Update the mailget records
$mail_gets = $app->db->queryAllRecords("SELECT mailget_id, destination FROM mail_get WHERE destination LIKE ?", "%@" . $page_form->oldDataRecord['domain']);
if(is_array($mail_gets)) {
......