diff --git a/install/update.php b/install/update.php
index 87866582fea4a8f6f42abeeaa309ed59207c16f3..8e00a879fa37b9bbd147af5c5487202cde5f27dd 100644
--- a/install/update.php
+++ b/install/update.php
@@ -96,7 +96,7 @@ $conf["mysql"]["ispconfig_user"] = $conf_old["db_user"];
$conf["mysql"]["ispconfig_password"] = $conf_old["db_password"];
$conf['language'] = $conf_old['language'];
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(isset($conf_old["dbmaster_host"])) $conf["mysql"]["master_host"] = $conf_old["dbmaster_host"];
diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php
index 3e926aeec7bd37c23626343586062c062d486733..b744e35688c5cb21004195df82ee065d5408d919 100644
--- a/interface/lib/classes/functions.inc.php
+++ b/interface/lib/classes/functions.inc.php
@@ -45,6 +45,7 @@ class functions {
$content = file_get_contents($filepath);
$content = chunk_split(base64_encode($content));
$uid = strtoupper(md5(uniqid(time())));
+ $subject = "=?utf-8?B?".base64_encode($subject)."?=";
if($filename == '') {
$path_parts = pathinfo($filepath);
@@ -75,6 +76,7 @@ class functions {
$header = "From: $from\nReply-To: $from\n";
$header .= "Content-Type: text/plain;\n\tcharset=\"UTF-8\"\n";
$header .= "Content-Transfer-Encoding: 8bit\n\n";
+ $subject = "=?utf-8?B?".base64_encode($subject)."?=";
mail($to, $subject, $text, $header);
}
diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php
index cfdc227f484d6f0ec57e8e3dd91d265de3fb6d88..9f88cfc0fdd1c88a2c6ae7bd62c4a15ce4ddedad 100644
--- a/interface/lib/classes/remoting.inc.php
+++ b/interface/lib/classes/remoting.inc.php
@@ -348,8 +348,8 @@ class remoting {
$this->server->fault('permission_denied','You do not have the permissions to access this function.');
return false;
}
- $affected_rows = $this->deleteQuery('../mail/form/mail_user_filter.tform.php', $primary_id);
- $app->plugin->raiseEvent('mail:mail_user_filter:on_after_delete',$this);
+ $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);
return $affected_rows;
}
@@ -2180,20 +2180,29 @@ class remoting {
//* Get the SQL query
$sql = $app->remoting_lib->getSQL($params,'INSERT',0);
- $app->db->query($sql);
//* Check if no system user with that username exists
$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
";
+ //* Stop on error while preparing the sql query
if($app->remoting_lib->errorMessage != '') {
$this->server->fault('data_processing_error', $app->remoting_lib->errorMessage);
return false;
}
+ //* Execute the SQL query
+ $app->db->query($sql);
$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->dataRecord = $params;
@@ -2332,22 +2341,23 @@ class remoting {
// set a few values for compatibility with tform actions, mostly used by plugins
$this->oldDataRecord = $old_rec;
$this->id = $primary_id;
- $this->dataRecord = $params;
+ $this->dataRecord = $old_rec;
+ //$this->dataRecord = $params;
//* Get the SQL query
$sql = $app->remoting_lib->getDeleteSQL($primary_id);
-
+ $app->db->errorMessage = '';
$app->db->query($sql);
+ $affected_rows = $app->db->affectedRows();
if($app->db->errorMessage != '') {
-
- if($event_identifier != '') $app->plugin->raiseEvent($event_identifier,$this);
-
$this->server->fault('database_error', $app->db->errorMessage . ' '.$sql);
return false;
}
- $affected_rows = $app->db->affectedRows();
+ if($event_identifier != '') {
+ $app->plugin->raiseEvent($event_identifier,$this);
+ }
//* Save changes to Datalog
if($app->remoting_lib->formDef["db_history"] == 'yes') {
diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php
index 06d5dfd7b25316ba479ce7a465aa148bb354d720..1d732af854307e7dde55b7616c557a856f5d33e9 100644
--- a/interface/lib/classes/remoting_lib.inc.php
+++ b/interface/lib/classes/remoting_lib.inc.php
@@ -536,11 +536,16 @@ class remoting_lib {
if($field['formtype'] == 'PASSWORD') {
$sql_insert_key .= "`$key`, ";
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 {
- $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') {
$sql_insert_key .= "`$key`, ";
if($record[$key] == '') {
@@ -645,7 +650,11 @@ class remoting_lib {
foreach($primary_id as $key => $val) {
$key = $app->db->quote($key);
$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 = "SELECT * FROM ".$escape.$this->formDef['db_table'].$escape." WHERE ".$sql_where;
diff --git a/interface/web/admin/software_update_list.php b/interface/web/admin/software_update_list.php
index 03d2658667c4b00856ec4f6aa1b176baec28a7c0..734f369343b78ba3429d880f466c2d46f7ac1977 100644
--- a/interface/web/admin/software_update_list.php
+++ b/interface/web/admin/software_update_list.php
@@ -161,7 +161,7 @@ if(is_array($installed_packages)) {
foreach($installed_packages as $ip) {
// 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);
// Get all installable updates
diff --git a/interface/web/dns/dns_slave_edit.php b/interface/web/dns/dns_slave_edit.php
index dc43a4b905922e15a53dfd91e6859ea3d14954ff..4564da1dddd76503b6ef2a2ccc9aadfb2d656836 100644
--- a/interface/web/dns/dns_slave_edit.php
+++ b/interface/web/dns/dns_slave_edit.php
@@ -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();
}
diff --git a/interface/web/dns/dns_soa_edit.php b/interface/web/dns/dns_soa_edit.php
index 7ec02785668c5b97756c1e8e95a80ec2711a122b..173ec7b034b6988abec53b626cb348357a387cc5 100644
--- a/interface/web/dns/dns_soa_edit.php
+++ b/interface/web/dns/dns_soa_edit.php
@@ -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();
}
@@ -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
if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($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
$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"])) {
$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
$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() {
global $app, $conf;
@@ -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
if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($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
$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"])) {
$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
$app->db->query("UPDATE dns_rr SET sys_groupid = $client_group_id WHERE zone = ".$this->id);
}
diff --git a/interface/web/dns/form/dns_alias.tform.php b/interface/web/dns/form/dns_alias.tform.php
index 21089827195dfd4b4c06904efc78a6f007bc65b7..8d103f6be9f3bca3b0a048707db330c105d68b17 100644
--- a/interface/web/dns/form/dns_alias.tform.php
+++ b/interface/web/dns/form/dns_alias.tform.php
@@ -80,7 +80,7 @@ $form["tabs"]['dns'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'name_error_empty'),
1 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-]{1,64}$/',
+ 'regex' => '/^[\w\.\-]{1,255}$/',
'errmsg'=> 'name_error_regex'),
),
'default' => '',
diff --git a/interface/web/dns/form/dns_cname.tform.php b/interface/web/dns/form/dns_cname.tform.php
index 48ac925ead5bddbcdbbb9226a93b2463f2ae33d6..aedadc6ab1530fcec4486d5b9bc28e752524a9c9 100644
--- a/interface/web/dns/form/dns_cname.tform.php
+++ b/interface/web/dns/form/dns_cname.tform.php
@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-\*]{0,64}$/',
+ 'regex' => '/^[\w\.\-\*]{0,255}$/',
'errmsg'=> 'name_error_regex'),
),
'default' => '',
diff --git a/interface/web/dns/form/dns_ns.tform.php b/interface/web/dns/form/dns_ns.tform.php
index 8fbb157e86c812d55a4bd6c9af9e9925e35dfaac..6fcc7a56983b5fd8c2dda10dfc435ead25c6a795 100644
--- a/interface/web/dns/form/dns_ns.tform.php
+++ b/interface/web/dns/form/dns_ns.tform.php
@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-]{0,64}$/',
+ 'regex' => '/^[\w\.\-]{0,255}$/',
'errmsg'=> 'name_error_regex'),
),
'default' => '',
diff --git a/interface/web/dns/form/dns_rp.tform.php b/interface/web/dns/form/dns_rp.tform.php
index 938aa616db49adb50fc5fa630ddeb567fe204221..aa94b55caeffbbdebc93e4492d0c971eaaed6838 100644
--- a/interface/web/dns/form/dns_rp.tform.php
+++ b/interface/web/dns/form/dns_rp.tform.php
@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-]{0,64}$/',
+ 'regex' => '/^[\w\.\-]{0,255}$/',
'errmsg'=> 'name_error_regex'),
),
'default' => '',
diff --git a/interface/web/dns/form/dns_slave.tform.php b/interface/web/dns/form/dns_slave.tform.php
index 1094e7c71c3e4ab96c74d56f5fd5526df11f2932..097602e8e5f88faab9d2047e10334dc85f4e83a1 100644
--- a/interface/web/dns/form/dns_slave.tform.php
+++ b/interface/web/dns/form/dns_slave.tform.php
@@ -94,7 +94,7 @@ $form["tabs"]['dns_slave'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-]{1,64}$/',
+ 'regex' => '/^[\w\.\-]{1,255}$/',
'errmsg'=> 'ns_error_regex'),
),
'default' => '',
diff --git a/interface/web/dns/form/dns_soa.tform.php b/interface/web/dns/form/dns_soa.tform.php
index 4490d5573e2749aa5b336f6e04c76c7c8b934d9d..53b408ef3a1cab68a3a48c977815de7ec5765cd4 100644
--- a/interface/web/dns/form/dns_soa.tform.php
+++ b/interface/web/dns/form/dns_soa.tform.php
@@ -94,7 +94,7 @@ $form["tabs"]['dns_soa'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-]{1,64}$/',
+ 'regex' => '/^[\w\.\-]{1,255}$/',
'errmsg'=> 'ns_error_regex'),
),
'default' => '',
@@ -108,7 +108,7 @@ $form["tabs"]['dns_soa'] = array (
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'mbox_error_empty'),
1 => array ( 'type' => 'REGEX',
- 'regex' => '/^[[a-zA-Z0-9\.\-\_]{0,64}\.$/',
+ 'regex' => '/^[[a-zA-Z0-9\.\-\_]{0,255}\.$/',
'errmsg'=> 'mbox_error_regex'),
),
'default' => '',
diff --git a/interface/web/dns/form/dns_srv.tform.php b/interface/web/dns/form/dns_srv.tform.php
index 0de461656a20139925bfbf21bb067893a24581b6..a30f6f32bf470017b75d39eeee2105ee9e6f2b23 100644
--- a/interface/web/dns/form/dns_srv.tform.php
+++ b/interface/web/dns/form/dns_srv.tform.php
@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-]{0,64}$/',
+ 'regex' => '/^[\w\.\-]{0,255}$/',
'errmsg'=> 'name_error_regex'),
),
'default' => '',
diff --git a/interface/web/dns/form/dns_txt.tform.php b/interface/web/dns/form/dns_txt.tform.php
index a198d4e276eccf6d2c6e809c7c5ca2a073bba72c..e9d616d65d83da7a0d71d69fe0cb9d7eb4913330 100644
--- a/interface/web/dns/form/dns_txt.tform.php
+++ b/interface/web/dns/form/dns_txt.tform.php
@@ -78,7 +78,7 @@ $form["tabs"]['dns'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
- 'regex' => '/^[\w\.\-]{0,64}$/',
+ 'regex' => '/^[\w\.\-]{0,255}$/',
'errmsg'=> 'name_error_regex'),
),
'default' => '',
diff --git a/interface/web/dns/lib/lang/en_dns_soa.lng b/interface/web/dns/lib/lang/en_dns_soa.lng
index 5d45f3409b5aa0ee4633c7e37a17f772a5770e9b..95afad415f7063b30478cf3e4961a23efcca1024 100644
--- a/interface/web/dns/lib/lang/en_dns_soa.lng
+++ b/interface/web/dns/lib/lang/en_dns_soa.lng
@@ -28,4 +28,5 @@ $wb['seconds_txt'] = 'Seconds';
$wb['eg_domain_tld'] = 'e.g. domain.tld';
$wb['eg_ns1_domain_tld'] = 'e.g. ns1.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.';
?>
diff --git a/interface/web/dns/templates/dns_slave_edit.htm b/interface/web/dns/templates/dns_slave_edit.htm
index 3305e63bf1d54a0b2ea8b313132c6dd21ecf5112..4cc0fde05c261d72c8fbd9fcee963f32cb0be08f 100644
--- a/interface/web/dns/templates/dns_slave_edit.htm
+++ b/interface/web/dns/templates/dns_slave_edit.htm
@@ -7,10 +7,18 @@