Skip to content

Commit f5d9544

Browse files
committed
Meerged revisions 2265-2278 from stable branch.
1 parent 00a055c commit f5d9544

File tree

7 files changed

+46
-10
lines changed

7 files changed

+46
-10
lines changed

interface/lib/classes/remoting_lib.inc.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,16 +701,17 @@ function ispconfig_sysuser_add($params,$insert_id){
701701
function ispconfig_sysuser_update($params,$client_id){
702702
global $app;
703703
$username = $app->db->quote($params["username"]);
704-
$password = $app->db->quote($params["password"]);
704+
$clear_password = $app->db->quote($params["password"]);
705705
$client_id = intval($client_id);
706706
$salt="$1$";
707707
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
708708
for ($n=0;$n<8;$n++) {
709709
$salt.=$base64_alphabet[mt_rand(0,63)];
710710
}
711711
$salt.="$";
712-
$password = crypt(stripslashes($password),$salt);
713-
$sql = "UPDATE sys_user set username = '$username', passwort = '$password' WHERE client_id = $client_id";
712+
$password = crypt(stripslashes($clear_password),$salt);
713+
if ($clear_password) $pwstring = ", passwort = '$password'"; else $pwstring ="" ;
714+
$sql = "UPDATE sys_user set username = '$username' $pwstring WHERE client_id = $client_id";
714715
$app->db->query($sql);
715716
}
716717

@@ -719,6 +720,8 @@ function ispconfig_sysuser_delete($client_id){
719720
$client_id = intval($client_id);
720721
$sql = "DELETE FROM sys_user WHERE client_id = $client_id";
721722
$app->db->query($sql);
723+
$sql = "DELETE FROM sys_group WHERE client_id = $client_id";
724+
$app->db->query($sql);
722725
}
723726

724727
function datalogSave($action,$primary_id, $record_old, $record_new) {

interface/web/client/client_edit.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,23 @@ function onAfterInsert() {
150150
$active = 1;
151151
$language = $app->db->quote($this->dataRecord["language"]);
152152

153+
$salt="$1$";
154+
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
155+
for ($n=0;$n<8;$n++) {
156+
$salt.=$base64_alphabet[mt_rand(0,63)];
157+
}
158+
$salt.="$";
159+
$password = crypt(stripslashes($password),$salt);
160+
161+
// Create the controlpaneluser for the client
153162
//Generate ssh-rsa-keys
154163
exec('ssh-keygen -t rsa -C '.$username.'-rsa-key-'.time().' -f /tmp/id_rsa -N ""');
155164
$app->db->query("UPDATE client SET created_at = ".time().", id_rsa = '".file_get_contents('/tmp/id_rsa')."', ssh_rsa = '".file_get_contents('/tmp/id_rsa.pub')."' WHERE client_id = ".$this->id;
156165
exec('rm -f /tmp/id_rsa /tmp/id_rsa.pub');
157166

158167
// Create the controlpaneluser for the client
159168
$sql = "INSERT INTO sys_user (username,passwort,modules,startmodule,app_theme,typ,active,language,groups,default_group,client_id)
160-
VALUES ('$username',md5('$password'),'$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")";
169+
VALUES ('$username','$password','$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")";
161170
$app->db->query($sql);
162171

163172
//* If the user who inserted the client is a reseller (not admin), we will have to add this new client group
@@ -198,8 +207,15 @@ function onAfterUpdate() {
198207
// password changed
199208
if($conf['demo_mode'] != true && isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') {
200209
$password = $app->db->quote($this->dataRecord["password"]);
210+
$salt="$1$";
211+
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
212+
for ($n=0;$n<8;$n++) {
213+
$salt.=$base64_alphabet[mt_rand(0,63)];
214+
}
215+
$salt.="$";
216+
$password = crypt(stripslashes($password),$salt);
201217
$client_id = $this->id;
202-
$sql = "UPDATE sys_user SET passwort = md5('$password') WHERE client_id = $client_id";
218+
$sql = "UPDATE sys_user SET passwort = '$password' WHERE client_id = $client_id";
203219
$app->db->query($sql);
204220
}
205221

@@ -232,4 +248,4 @@ function onAfterUpdate() {
232248
$page = new page_action;
233249
$page->onLoad();
234250

235-
?>
251+
?>

interface/web/client/reseller_edit.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,17 @@ function onAfterInsert() {
150150
$active = 1;
151151
$language = $app->db->quote($this->dataRecord["language"]);
152152

153+
$salt="$1$";
154+
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
155+
for ($n=0;$n<8;$n++) {
156+
$salt.=$base64_alphabet[mt_rand(0,63)];
157+
}
158+
$salt.="$";
159+
$password = crypt(stripslashes($password),$salt);
160+
153161
// Create the controlpaneluser for the reseller
154162
$sql = "INSERT INTO sys_user (username,passwort,modules,startmodule,app_theme,typ,active,language,groups,default_group,client_id)
155-
VALUES ('$username',md5('$password'),'$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")";
163+
VALUES ('$username','$password','$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")";
156164
$app->db->query($sql);
157165

158166
//* set the number of clients to 1
@@ -188,7 +196,14 @@ function onAfterUpdate() {
188196
if($conf['demo_mode'] != true && isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') {
189197
$password = $app->db->quote($this->dataRecord["password"]);
190198
$client_id = $this->id;
191-
$sql = "UPDATE sys_user SET passwort = md5('$password') WHERE client_id = $client_id";
199+
$salt="$1$";
200+
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
201+
for ($n=0;$n<8;$n++) {
202+
$salt.=$base64_alphabet[mt_rand(0,63)];
203+
}
204+
$salt.="$";
205+
$password = crypt(stripslashes($password),$salt);
206+
$sql = "UPDATE sys_user SET passwort = '$password' WHERE client_id = $client_id";
192207
$app->db->query($sql);
193208
}
194209

interface/web/dashboard/dashboard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131

132132
/* Which dashlets in which column */
133133
/******************************************************************************/
134-
$leftcol_dashlets = array('modules');
134+
$leftcol_dashlets = array('modules','invoices');
135135
$rightcol_dashlets = array('limits');
136136
/******************************************************************************/
137137

server/conf/bind_pri.domain.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $TTL {tmpl_var name='ttl'}
1212
{tmpl_var name='name'} NS {tmpl_var name='data'}
1313
</tmpl_if>
1414
<tmpl_if name="type" op='==' value='A'>
15-
{tmpl_var name='name'} A {tmpl_var name='data'}
15+
{tmpl_var name='name'} {tmpl_var name='ttl'} A {tmpl_var name='data'}
1616
</tmpl_if>
1717
<tmpl_if name="type" op='==' value='AAAA'>
1818
{tmpl_var name='name'} AAAA {tmpl_var name='data'}

server/plugins-available/maildeliver_plugin.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ function onLoad() {
6060
Register for the events
6161
*/
6262

63+
$app->plugins->registerEvent('mail_user_insert','maildeliver_plugin','update');
6364
$app->plugins->registerEvent('mail_user_update','maildeliver_plugin','update');
6465
$app->plugins->registerEvent('mail_user_delete','maildeliver_plugin','delete');
6566

server/plugins-available/maildrop_plugin.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ function onLoad() {
6060
Register for the events
6161
*/
6262

63+
$app->plugins->registerEvent('mail_user_update','maildrop_plugin','insert');
6364
$app->plugins->registerEvent('mail_user_update','maildrop_plugin','update');
6465
$app->plugins->registerEvent('mail_user_delete','maildrop_plugin','delete');
6566

0 commit comments

Comments
 (0)