Commit f5d95441 authored by tbrehm's avatar tbrehm

Meerged revisions 2265-2278 from stable branch.

parent 00a055c4
......@@ -701,7 +701,7 @@ class remoting_lib {
function ispconfig_sysuser_update($params,$client_id){
global $app;
$username = $app->db->quote($params["username"]);
$password = $app->db->quote($params["password"]);
$clear_password = $app->db->quote($params["password"]);
$client_id = intval($client_id);
$salt="$1$";
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
......@@ -709,8 +709,9 @@ class remoting_lib {
$salt.=$base64_alphabet[mt_rand(0,63)];
}
$salt.="$";
$password = crypt(stripslashes($password),$salt);
$sql = "UPDATE sys_user set username = '$username', passwort = '$password' WHERE client_id = $client_id";
$password = crypt(stripslashes($clear_password),$salt);
if ($clear_password) $pwstring = ", passwort = '$password'"; else $pwstring ="" ;
$sql = "UPDATE sys_user set username = '$username' $pwstring WHERE client_id = $client_id";
$app->db->query($sql);
}
......@@ -719,6 +720,8 @@ class remoting_lib {
$client_id = intval($client_id);
$sql = "DELETE FROM sys_user WHERE client_id = $client_id";
$app->db->query($sql);
$sql = "DELETE FROM sys_group WHERE client_id = $client_id";
$app->db->query($sql);
}
function datalogSave($action,$primary_id, $record_old, $record_new) {
......
......@@ -150,6 +150,15 @@ class page_action extends tform_actions {
$active = 1;
$language = $app->db->quote($this->dataRecord["language"]);
$salt="$1$";
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
for ($n=0;$n<8;$n++) {
$salt.=$base64_alphabet[mt_rand(0,63)];
}
$salt.="$";
$password = crypt(stripslashes($password),$salt);
// Create the controlpaneluser for the client
//Generate ssh-rsa-keys
exec('ssh-keygen -t rsa -C '.$username.'-rsa-key-'.time().' -f /tmp/id_rsa -N ""');
$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;
......@@ -157,7 +166,7 @@ class page_action extends tform_actions {
// Create the controlpaneluser for the client
$sql = "INSERT INTO sys_user (username,passwort,modules,startmodule,app_theme,typ,active,language,groups,default_group,client_id)
VALUES ('$username',md5('$password'),'$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")";
VALUES ('$username','$password','$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")";
$app->db->query($sql);
//* 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 @@ class page_action extends tform_actions {
// password changed
if($conf['demo_mode'] != true && isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') {
$password = $app->db->quote($this->dataRecord["password"]);
$salt="$1$";
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
for ($n=0;$n<8;$n++) {
$salt.=$base64_alphabet[mt_rand(0,63)];
}
$salt.="$";
$password = crypt(stripslashes($password),$salt);
$client_id = $this->id;
$sql = "UPDATE sys_user SET passwort = md5('$password') WHERE client_id = $client_id";
$sql = "UPDATE sys_user SET passwort = '$password' WHERE client_id = $client_id";
$app->db->query($sql);
}
......@@ -232,4 +248,4 @@ class page_action extends tform_actions {
$page = new page_action;
$page->onLoad();
?>
?>
\ No newline at end of file
......@@ -150,9 +150,17 @@ class page_action extends tform_actions {
$active = 1;
$language = $app->db->quote($this->dataRecord["language"]);
$salt="$1$";
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
for ($n=0;$n<8;$n++) {
$salt.=$base64_alphabet[mt_rand(0,63)];
}
$salt.="$";
$password = crypt(stripslashes($password),$salt);
// Create the controlpaneluser for the reseller
$sql = "INSERT INTO sys_user (username,passwort,modules,startmodule,app_theme,typ,active,language,groups,default_group,client_id)
VALUES ('$username',md5('$password'),'$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")";
VALUES ('$username','$password','$modules','$startmodule','$usertheme','$type','$active','$language',$groups,$groupid,".$this->id.")";
$app->db->query($sql);
//* set the number of clients to 1
......@@ -188,7 +196,14 @@ class page_action extends tform_actions {
if($conf['demo_mode'] != true && isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') {
$password = $app->db->quote($this->dataRecord["password"]);
$client_id = $this->id;
$sql = "UPDATE sys_user SET passwort = md5('$password') WHERE client_id = $client_id";
$salt="$1$";
$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
for ($n=0;$n<8;$n++) {
$salt.=$base64_alphabet[mt_rand(0,63)];
}
$salt.="$";
$password = crypt(stripslashes($password),$salt);
$sql = "UPDATE sys_user SET passwort = '$password' WHERE client_id = $client_id";
$app->db->query($sql);
}
......
......@@ -131,7 +131,7 @@ while ($file = @readdir ($handle)) {
/* Which dashlets in which column */
/******************************************************************************/
$leftcol_dashlets = array('modules');
$leftcol_dashlets = array('modules','invoices');
$rightcol_dashlets = array('limits');
/******************************************************************************/
......
......@@ -12,7 +12,7 @@ $TTL {tmpl_var name='ttl'}
{tmpl_var name='name'} NS {tmpl_var name='data'}
</tmpl_if>
<tmpl_if name="type" op='==' value='A'>
{tmpl_var name='name'} A {tmpl_var name='data'}
{tmpl_var name='name'} {tmpl_var name='ttl'} A {tmpl_var name='data'}
</tmpl_if>
<tmpl_if name="type" op='==' value='AAAA'>
{tmpl_var name='name'} AAAA {tmpl_var name='data'}
......
......@@ -60,6 +60,7 @@ class maildeliver_plugin {
Register for the events
*/
$app->plugins->registerEvent('mail_user_insert','maildeliver_plugin','update');
$app->plugins->registerEvent('mail_user_update','maildeliver_plugin','update');
$app->plugins->registerEvent('mail_user_delete','maildeliver_plugin','delete');
......
......@@ -60,6 +60,7 @@ class maildrop_plugin {
Register for the events
*/
$app->plugins->registerEvent('mail_user_update','maildrop_plugin','insert');
$app->plugins->registerEvent('mail_user_update','maildrop_plugin','update');
$app->plugins->registerEvent('mail_user_delete','maildrop_plugin','delete');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment