From 56a3b2c38a4951fb3be2dc287715bf1d1d5e9222 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 04 Apr 2011 09:38:36 -0400
Subject: [PATCH] Fixed: FS#1570 - Password broken when client is updated with the remote api.
---
interface/lib/classes/remoting_lib.inc.php | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/interface/lib/classes/remoting_lib.inc.php b/interface/lib/classes/remoting_lib.inc.php
index 57ff998..1a62b23 100644
--- a/interface/lib/classes/remoting_lib.inc.php
+++ b/interface/lib/classes/remoting_lib.inc.php
@@ -701,7 +701,7 @@
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 @@
$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);
}
--
Gitblit v1.9.1