Commit 355efb9a authored by tbrehm's avatar tbrehm

Merged revisions 2886-2909 from stable branch.

parent 85444438
...@@ -96,7 +96,7 @@ $conf["mysql"]["ispconfig_user"] = $conf_old["db_user"]; ...@@ -96,7 +96,7 @@ $conf["mysql"]["ispconfig_user"] = $conf_old["db_user"];
$conf["mysql"]["ispconfig_password"] = $conf_old["db_password"]; $conf["mysql"]["ispconfig_password"] = $conf_old["db_password"];
$conf['language'] = $conf_old['language']; $conf['language'] = $conf_old['language'];
if($conf['language'] == '{language}') $conf['language'] = 'en'; if($conf['language'] == '{language}') $conf['language'] = 'en';
$conf['timezone'] = $conf_old['timezone']; $conf['timezone'] = (isset($conf_old['timezone']))?$conf_old['timezone']:'UTC';
if($conf['timezone'] == '{timezone}' or trim($conf['timezone']) == '') $conf['timezone'] = 'UTC'; if($conf['timezone'] == '{timezone}' or trim($conf['timezone']) == '') $conf['timezone'] = 'UTC';
if(isset($conf_old["dbmaster_host"])) $conf["mysql"]["master_host"] = $conf_old["dbmaster_host"]; if(isset($conf_old["dbmaster_host"])) $conf["mysql"]["master_host"] = $conf_old["dbmaster_host"];
......
...@@ -45,6 +45,7 @@ class functions { ...@@ -45,6 +45,7 @@ class functions {
$content = file_get_contents($filepath); $content = file_get_contents($filepath);
$content = chunk_split(base64_encode($content)); $content = chunk_split(base64_encode($content));
$uid = strtoupper(md5(uniqid(time()))); $uid = strtoupper(md5(uniqid(time())));
$subject = "=?utf-8?B?".base64_encode($subject)."?=";
if($filename == '') { if($filename == '') {
$path_parts = pathinfo($filepath); $path_parts = pathinfo($filepath);
...@@ -75,6 +76,7 @@ class functions { ...@@ -75,6 +76,7 @@ class functions {
$header = "From: $from\nReply-To: $from\n"; $header = "From: $from\nReply-To: $from\n";
$header .= "Content-Type: text/plain;\n\tcharset=\"UTF-8\"\n"; $header .= "Content-Type: text/plain;\n\tcharset=\"UTF-8\"\n";
$header .= "Content-Transfer-Encoding: 8bit\n\n"; $header .= "Content-Transfer-Encoding: 8bit\n\n";
$subject = "=?utf-8?B?".base64_encode($subject)."?=";
mail($to, $subject, $text, $header); mail($to, $subject, $text, $header);
} }
......
...@@ -348,8 +348,8 @@ class remoting { ...@@ -348,8 +348,8 @@ class remoting {
$this->server->fault('permission_denied','You do not have the permissions to access this function.'); $this->server->fault('permission_denied','You do not have the permissions to access this function.');
return false; return false;
} }
$affected_rows = $this->deleteQuery('../mail/form/mail_user_filter.tform.php', $primary_id); $affected_rows = $this->deleteQuery('../mail/form/mail_user_filter.tform.php', $primary_id,'mail:mail_user_filter:on_after_delete');
$app->plugin->raiseEvent('mail:mail_user_filter:on_after_delete',$this); // $app->plugin->raiseEvent('mail:mail_user_filter:on_after_delete',$this);
return $affected_rows; return $affected_rows;
} }
...@@ -2180,20 +2180,29 @@ class remoting { ...@@ -2180,20 +2180,29 @@ class remoting {
//* Get the SQL query //* Get the SQL query
$sql = $app->remoting_lib->getSQL($params,'INSERT',0); $sql = $app->remoting_lib->getSQL($params,'INSERT',0);
$app->db->query($sql);
//* Check if no system user with that username exists //* Check if no system user with that username exists
$username = $app->db->quote($params["username"]); $username = $app->db->quote($params["username"]);
$tmp = $app->db->queryOneRecord("SELECT count(userid) as number FROm sys_user WHERE username = '$username'"); $tmp = $app->db->queryOneRecord("SELECT count(userid) as number FROM sys_user WHERE username = '$username'");
if($tmp['number'] > 0) $app->remoting_lib->errorMessage .= "Duplicate username<br />"; if($tmp['number'] > 0) $app->remoting_lib->errorMessage .= "Duplicate username<br />";
//* Stop on error while preparing the sql query
if($app->remoting_lib->errorMessage != '') { if($app->remoting_lib->errorMessage != '') {
$this->server->fault('data_processing_error', $app->remoting_lib->errorMessage); $this->server->fault('data_processing_error', $app->remoting_lib->errorMessage);
return false; return false;
} }
//* Execute the SQL query
$app->db->query($sql);
$insert_id = $app->db->insertID(); $insert_id = $app->db->insertID();
//* Stop on error while executing the sql query
if($app->remoting_lib->errorMessage != '') {
$this->server->fault('data_processing_error', $app->remoting_lib->errorMessage);
return false;
}
$this->id = $insert_id; $this->id = $insert_id;
$this->dataRecord = $params; $this->dataRecord = $params;
...@@ -2332,22 +2341,23 @@ class remoting { ...@@ -2332,22 +2341,23 @@ class remoting {
// set a few values for compatibility with tform actions, mostly used by plugins // set a few values for compatibility with tform actions, mostly used by plugins
$this->oldDataRecord = $old_rec; $this->oldDataRecord = $old_rec;
$this->id = $primary_id; $this->id = $primary_id;
$this->dataRecord = $params; $this->dataRecord = $old_rec;
//$this->dataRecord = $params;
//* Get the SQL query //* Get the SQL query
$sql = $app->remoting_lib->getDeleteSQL($primary_id); $sql = $app->remoting_lib->getDeleteSQL($primary_id);
$app->db->errorMessage = '';
$app->db->query($sql); $app->db->query($sql);
$affected_rows = $app->db->affectedRows();
if($app->db->errorMessage != '') { if($app->db->errorMessage != '') {
if($event_identifier != '') $app->plugin->raiseEvent($event_identifier,$this);
$this->server->fault('database_error', $app->db->errorMessage . ' '.$sql); $this->server->fault('database_error', $app->db->errorMessage . ' '.$sql);
return false; return false;
} }
$affected_rows = $app->db->affectedRows(); if($event_identifier != '') {
$app->plugin->raiseEvent($event_identifier,$this);
}
//* Save changes to Datalog //* Save changes to Datalog
if($app->remoting_lib->formDef["db_history"] == 'yes') { if($app->remoting_lib->formDef["db_history"] == 'yes') {
......
...@@ -536,11 +536,16 @@ class remoting_lib { ...@@ -536,11 +536,16 @@ class remoting_lib {
if($field['formtype'] == 'PASSWORD') { if($field['formtype'] == 'PASSWORD') {
$sql_insert_key .= "`$key`, "; $sql_insert_key .= "`$key`, ";
if($field['encryption'] == 'CRYPT') { if($field['encryption'] == 'CRYPT') {
$record[$key] = $app->auth->crypt_password(stripslashes($record[$key])); $record[$key] = $app->auth->crypt_password(stripslashes($record[$key]));
$sql_insert_val .= "'".$app->db->quote($record[$key])."', ";
} elseif ($field['encryption'] == 'MYSQL') {
$sql_insert_val .= "PASSWORD('".$app->db->quote($record[$key])."'), ";
} elseif ($field['encryption'] == 'CLEARTEXT') {
$sql_insert_val .= "'".$app->db->quote($record[$key])."', ";
} else { } else {
$record[$key] = md5($record[$key]); $record[$key] = md5(stripslashes($record[$key]));
$sql_insert_val .= "'".$app->db->quote($record[$key])."', ";
} }
$sql_insert_val .= "'".$record[$key]."', ";
} elseif ($field['formtype'] == 'CHECKBOX') { } elseif ($field['formtype'] == 'CHECKBOX') {
$sql_insert_key .= "`$key`, "; $sql_insert_key .= "`$key`, ";
if($record[$key] == '') { if($record[$key] == '') {
...@@ -645,7 +650,11 @@ class remoting_lib { ...@@ -645,7 +650,11 @@ class remoting_lib {
foreach($primary_id as $key => $val) { foreach($primary_id as $key => $val) {
$key = $app->db->quote($key); $key = $app->db->quote($key);
$val = $app->db->quote($val); $val = $app->db->quote($val);
$sql_where .= "$key = '$val' AND "; if(stristr($val,'%')) {
$sql_where .= "$key like '$val' AND ";
} else {
$sql_where .= "$key = '$val' AND ";
}
} }
$sql_where = substr($sql_where,0,-5); $sql_where = substr($sql_where,0,-5);
$sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$sql_where; $sql = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$sql_where;
......
...@@ -161,7 +161,7 @@ if(is_array($installed_packages)) { ...@@ -161,7 +161,7 @@ if(is_array($installed_packages)) {
foreach($installed_packages as $ip) { foreach($installed_packages as $ip) {
// Get version number of the latest installed version // Get version number of the latest installed version
$sql = "SELECT v1, v2, v3, v4 FROM software_update, software_update_inst WHERE software_update.software_update_id = software_update_inst.software_update_id AND server_id = 1 ORDER BY v1 DESC , v2 DESC , v3 DESC , v4 DESC LIMIT 0,1"; $sql = "SELECT v1, v2, v3, v4 FROM software_update, software_update_inst WHERE software_update.software_update_id = software_update_inst.software_update_id AND server_id = ".$server_id." ORDER BY v1 DESC , v2 DESC , v3 DESC , v4 DESC LIMIT 0,1";
$lu = $app->db->queryOneRecord($sql); $lu = $app->db->queryOneRecord($sql);
// Get all installable updates // Get all installable updates
......
...@@ -106,6 +106,14 @@ class page_action extends tform_actions { ...@@ -106,6 +106,14 @@ class page_action extends tform_actions {
} }
if($this->id > 0) {
//* we are editing a existing record
$app->tpl->setVar("edit_disabled", 1);
$app->tpl->setVar("server_id_value", $this->dataRecord["server_id"]);
} else {
$app->tpl->setVar("edit_disabled", 0);
}
parent::onShowEnd(); parent::onShowEnd();
} }
......
...@@ -116,6 +116,14 @@ class page_action extends tform_actions { ...@@ -116,6 +116,14 @@ class page_action extends tform_actions {
} }
if($this->id > 0) {
//* we are editing a existing record
$app->tpl->setVar("edit_disabled", 1);
$app->tpl->setVar("server_id_value", $this->dataRecord["server_id"]);
} else {
$app->tpl->setVar("edit_disabled", 0);
}
parent::onShowEnd(); parent::onShowEnd();
} }
...@@ -180,19 +188,36 @@ class page_action extends tform_actions { ...@@ -180,19 +188,36 @@ class page_action extends tform_actions {
// make sure that the record belongs to the client group and not the admin group when a dmin inserts it // make sure that the record belongs to the client group and not the admin group when a dmin inserts it
if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
$client_group_id = intval($this->dataRecord["client_group_id"]); $client_group_id = intval($this->dataRecord["client_group_id"]);
$app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id WHERE id = ".$this->id); $app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE id = ".$this->id);
// And we want to update all rr records too, that belong to this record // And we want to update all rr records too, that belong to this record
$app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id); $app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id);
} }
if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) {
$client_group_id = intval($this->dataRecord["client_group_id"]); $client_group_id = intval($this->dataRecord["client_group_id"]);
$app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id WHERE id = ".$this->id); $app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE id = ".$this->id);
// And we want to update all rr records too, that belong to this record // And we want to update all rr records too, that belong to this record
$app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id); $app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id);
} }
} }
function onBeforeUpdate () {
global $app, $conf;
//* Check if the server has been changed
// We do this only for the admin or reseller users, as normal clients can not change the server ID anyway
if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) {
//* We do not allow users to change a domain which has been created by the admin
$rec = $app->db->queryOneRecord("SELECT origin from dns_soa WHERE id = ".$this->id);
if(isset($this->dataRecord["origin"]) && $rec['origin'] != $this->dataRecord["origin"] && $app->tform->checkPerm($this->id,'u')) {
//* Add a error message and switch back to old server
$app->tform->errorMessage .= $app->lng('The Zone (soa) can not be changed. Please ask your Administrator if you want to change the Zone name.');
$this->dataRecord["origin"] = $rec['origin'];
}
unset($rec);
}
}
function onAfterUpdate() { function onAfterUpdate() {
global $app, $conf; global $app, $conf;
...@@ -206,13 +231,13 @@ class page_action extends tform_actions { ...@@ -206,13 +231,13 @@ class page_action extends tform_actions {
// make sure that the record belongs to the client group and not the admin group when a dmin inserts it // make sure that the record belongs to the client group and not the admin group when a dmin inserts it
if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) { if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($this->dataRecord["client_group_id"])) {
$client_group_id = intval($this->dataRecord["client_group_id"]); $client_group_id = intval($this->dataRecord["client_group_id"]);
$app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id WHERE id = ".$this->id); $app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id, sys_perm_group = 'ru' WHERE id = ".$this->id);
// And we want to update all rr records too, that belong to this record // And we want to update all rr records too, that belong to this record
$app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id); $app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id);
} }
if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) { if($app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord["client_group_id"])) {
$client_group_id = intval($this->dataRecord["client_group_id"]); $client_group_id = intval($this->dataRecord["client_group_id"]);
$app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id WHERE id = ".$this->id); $app->db->query("UPDATE dns_soa SET sys_groupid = $client_group_id, sys_perm_group = 'riud' WHERE id = ".$this->id);
// And we want to update all rr records too, that belong to this record // And we want to update all rr records too, that belong to this record
$app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id); $app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id);
} }
......
...@@ -80,7 +80,7 @@ $form["tabs"]['dns'] = array ( ...@@ -80,7 +80,7 @@ $form["tabs"]['dns'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'name_error_empty'), 'errmsg'=> 'name_error_empty'),
1 => array ( 'type' => 'REGEX', 1 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-]{1,64}$/', 'regex' => '/^[\w\.\-]{1,255}$/',
'errmsg'=> 'name_error_regex'), 'errmsg'=> 'name_error_regex'),
), ),
'default' => '', 'default' => '',
......
...@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array ( ...@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX', 'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-\*]{0,64}$/', 'regex' => '/^[\w\.\-\*]{0,255}$/',
'errmsg'=> 'name_error_regex'), 'errmsg'=> 'name_error_regex'),
), ),
'default' => '', 'default' => '',
......
...@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array ( ...@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX', 'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-]{0,64}$/', 'regex' => '/^[\w\.\-]{0,255}$/',
'errmsg'=> 'name_error_regex'), 'errmsg'=> 'name_error_regex'),
), ),
'default' => '', 'default' => '',
......
...@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array ( ...@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX', 'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-]{0,64}$/', 'regex' => '/^[\w\.\-]{0,255}$/',
'errmsg'=> 'name_error_regex'), 'errmsg'=> 'name_error_regex'),
), ),
'default' => '', 'default' => '',
......
...@@ -94,7 +94,7 @@ $form["tabs"]['dns_slave'] = array ( ...@@ -94,7 +94,7 @@ $form["tabs"]['dns_slave'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX', 'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-]{1,64}$/', 'regex' => '/^[\w\.\-]{1,255}$/',
'errmsg'=> 'ns_error_regex'), 'errmsg'=> 'ns_error_regex'),
), ),
'default' => '', 'default' => '',
......
...@@ -94,7 +94,7 @@ $form["tabs"]['dns_soa'] = array ( ...@@ -94,7 +94,7 @@ $form["tabs"]['dns_soa'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX', 'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-]{1,64}$/', 'regex' => '/^[\w\.\-]{1,255}$/',
'errmsg'=> 'ns_error_regex'), 'errmsg'=> 'ns_error_regex'),
), ),
'default' => '', 'default' => '',
...@@ -108,7 +108,7 @@ $form["tabs"]['dns_soa'] = array ( ...@@ -108,7 +108,7 @@ $form["tabs"]['dns_soa'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY', 'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'mbox_error_empty'), 'errmsg'=> 'mbox_error_empty'),
1 => array ( 'type' => 'REGEX', 1 => array ( 'type' => 'REGEX',
'regex' => '/^[[a-zA-Z0-9\.\-\_]{0,64}\.$/', 'regex' => '/^[[a-zA-Z0-9\.\-\_]{0,255}\.$/',
'errmsg'=> 'mbox_error_regex'), 'errmsg'=> 'mbox_error_regex'),
), ),
'default' => '', 'default' => '',
......
...@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array ( ...@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX', 'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-]{0,64}$/', 'regex' => '/^[\w\.\-]{0,255}$/',
'errmsg'=> 'name_error_regex'), 'errmsg'=> 'name_error_regex'),
), ),
'default' => '', 'default' => '',
......
...@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array ( ...@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX', 'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[\w\.\-]{0,64}$/', 'regex' => '/^[\w\.\-]{0,255}$/',
'errmsg'=> 'name_error_regex'), 'errmsg'=> 'name_error_regex'),
), ),
'default' => '', 'default' => '',
......
...@@ -28,4 +28,5 @@ $wb['seconds_txt'] = 'Seconds'; ...@@ -28,4 +28,5 @@ $wb['seconds_txt'] = 'Seconds';
$wb['eg_domain_tld'] = 'e.g. domain.tld'; $wb['eg_domain_tld'] = 'e.g. domain.tld';
$wb['eg_ns1_domain_tld'] = 'e.g. ns1.domain.tld'; $wb['eg_ns1_domain_tld'] = 'e.g. ns1.domain.tld';
$wb['eg_webmaster_domain_tld'] = 'e.g. webmaster@domain.tld'; $wb['eg_webmaster_domain_tld'] = 'e.g. webmaster@domain.tld';
$wb['The Domain can not be changed. Please ask your Administrator if you want to change the domain name.'] = 'The Domain can not be changed. Please ask your Administrator if you want to change the domain name.';
?> ?>
...@@ -7,10 +7,18 @@ ...@@ -7,10 +7,18 @@
<fieldset class="inlineLabels"><legend>Secondary DNS Zone</legend> <fieldset class="inlineLabels"><legend>Secondary DNS Zone</legend>
<tmpl_if name="is_admin"> <tmpl_if name="is_admin">
<div class="ctrlHolder"> <div class="ctrlHolder">
<label for="server_id">{tmpl_var name='server_id_txt'}</label> <tmpl_if name="edit_disabled">
<label for="server_id_disabled">{tmpl_var name='server_id_txt'}</label>
<select name="server_id_disabled" id="server_id_disabled" class="selectInput" disabled="disabled">
{tmpl_var name='server_id'}
</select>
<input type="hidden" name="server_id" value="{tmpl_var name='server_id_value'}" />
<tmpl_else>
<label for="server_id">{tmpl_var name='server_id_txt'}</label>
<select name="server_id" id="server_id" class="selectInput"> <select name="server_id" id="server_id" class="selectInput">
{tmpl_var name='server_id'} {tmpl_var name='server_id'}
</select> </select>
</tmpl_if>
</div> </div>
<div class="ctrlHolder"> <div class="ctrlHolder">
<label for="client_group_id">{tmpl_var name='client_txt'}</label> <label for="client_group_id">{tmpl_var name='client_txt'}</label>
......
...@@ -7,10 +7,18 @@ ...@@ -7,10 +7,18 @@
<fieldset class="inlineLabels"><legend>DNS Zone</legend> <fieldset class="inlineLabels"><legend>DNS Zone</legend>
<tmpl_if name="is_admin"> <tmpl_if name="is_admin">
<div class="ctrlHolder"> <div class="ctrlHolder">
<label for="server_id">{tmpl_var name='server_id_txt'}</label> <tmpl_if name="edit_disabled">
<label for="server_id_disabled">{tmpl_var name='server_id_txt'}</label>
<select name="server_id_disabled" id="server_id_disabled" class="selectInput" disabled="disabled">
{tmpl_var name='server_id'}
</select>
<input type="hidden" name="server_id" value="{tmpl_var name='server_id_value'}" />
<tmpl_else>
<label for="server_id">{tmpl_var name='server_id_txt'}</label>
<select name="server_id" id="server_id" class="selectInput"> <select name="server_id" id="server_id" class="selectInput">
{tmpl_var name='server_id'} {tmpl_var name='server_id'}
</select> </select>
</tmpl_if>
</div> </div>
<div class="ctrlHolder"> <div class="ctrlHolder">
<label for="client_group_id">{tmpl_var name='client_txt'}</label> <label for="client_group_id">{tmpl_var name='client_txt'}</label>
......
...@@ -14,4 +14,5 @@ $wb["source_username_error_isempty"] = 'Username is empty.'; ...@@ -14,4 +14,5 @@ $wb["source_username_error_isempty"] = 'Username is empty.';
$wb["source_password_error_isempty"] = 'Password is empty.'; $wb["source_password_error_isempty"] = 'Password is empty.';
$wb["destination_error_isemail"] = 'No destination selected.'; $wb["destination_error_isemail"] = 'No destination selected.';
$wb["source_server_error_regex"] = 'Pop3/Imap Server is not a valid domain name.'; $wb["source_server_error_regex"] = 'Pop3/Imap Server is not a valid domain name.';
$wb["error_delete_read_all_combination"] = 'Illegal combination of options. You can not use "Delete emails after retrieval" = no together with "Retrieve all emails" = yes';
?> ?>
\ No newline at end of file
...@@ -85,11 +85,17 @@ class page_action extends tform_actions { ...@@ -85,11 +85,17 @@ class page_action extends tform_actions {
} }
} // end if user is not admin } // end if user is not admin
// Set the server ID according to the selected destination // Set the server ID according to the selected destination
$tmp = $app->db->queryOneRecord("SELECT server_id FROM mail_user WHERE email = '".$app->db->quote($this->dataRecord["destination"])."'"); $tmp = $app->db->queryOneRecord("SELECT server_id FROM mail_user WHERE email = '".$app->db->quote($this->dataRecord["destination"])."'");
$this->dataRecord["server_id"] = $tmp["server_id"]; $this->dataRecord["server_id"] = $tmp["server_id"];
unset($tmp); unset($tmp);
//* Check that no illegal combination of options is set
if((!isset($this->dataRecord['source_delete']) || @$this->dataRecord['source_delete'] == 'n') && $this->dataRecord['source_read_all'] == 'y') {
$app->tform->errorMessage .= $app->tform->lng('error_delete_read_all_combination')."<br>";
}
parent::onSubmit(); parent::onSubmit();
} }
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
jQuery('#redirect_type option[value="R"]').hide(); jQuery('#redirect_type option[value="R"]').hide();
jQuery('#redirect_type option[value="L"]').hide(); jQuery('#redirect_type option[value="L"]').hide();
jQuery('#redirect_type option[value="R,L"]').hide(); jQuery('#redirect_type option[value="R,L"]').hide();
jQuery('#redirect_type option[value="R=301,L"]').hide();
jQuery('#redirect_type option[value="last"]').show(); jQuery('#redirect_type option[value="last"]').show();
jQuery('#redirect_type option[value="break"]').show(); jQuery('#redirect_type option[value="break"]').show();
...@@ -94,8 +95,9 @@ ...@@ -94,8 +95,9 @@
jQuery('#redirect_type option[value="R"]').show(); jQuery('#redirect_type option[value="R"]').show();
jQuery('#redirect_type option[value="L"]').show(); jQuery('#redirect_type option[value="L"]').show();
jQuery('#redirect_type option[value="R,L"]').show(); jQuery('#redirect_type option[value="R,L"]').show();
jQuery('#redirect_type option[value="R=301,L"]').show();
if(selected != "no" && selected != "" && selected != "R" && selected != "L" && selected != "R,L") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected'); if(selected != "no" && selected != "" && selected != "R" && selected != "L" && selected != "R,L" && selected != "R=301,L") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected');
} }
}); });
} }
......
...@@ -51,13 +51,14 @@ ...@@ -51,13 +51,14 @@
jQuery('#redirect_type option[value="R"]').hide(); jQuery('#redirect_type option[value="R"]').hide();
jQuery('#redirect_type option[value="L"]').hide(); jQuery('#redirect_type option[value="L"]').hide();
jQuery('#redirect_type option[value="R,L"]').hide(); jQuery('#redirect_type option[value="R,L"]').hide();
jQuery('#redirect_type option[value="R=301,L"]').hide();
if(selected != "no" && selected != "" && selected != "last" && selected != "break" && selected != "redirect" && selected != "permanent") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected'); if(selected != "no" && selected != "" && selected != "last" && selected != "break" && selected != "redirect" && selected != "permanent") jQuery('#redirect_type option[value="no"]').attr('selected', 'selected');
} else { } else {