ftimme
2012-11-01 7fd3342945454649f583029f09ad982d0973ae8d
- Bugfix: system username was not changed when client username was modified.
2 files modified
10 ■■■■ changed files
interface/web/client/client_edit.php 2 ●●● patch | view | raw | blame | history
interface/web/client/reseller_edit.php 8 ●●●● patch | view | raw | blame | history
interface/web/client/client_edit.php
@@ -190,7 +190,7 @@
     the data was successful updated in the database.
    */
    function onAfterUpdate() {
        global $app;
        global $app, $conf;
        // username changed
        if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord['username']) && $this->dataRecord['username'] != '' && $this->oldDataRecord['username'] != $this->dataRecord['username']) {
            $username = $app->db->quote($this->dataRecord["username"]);
interface/web/client/reseller_edit.php
@@ -190,7 +190,7 @@
        global $app, $conf;
        
        // username changed
        if($conf['demo_mode'] != true && isset($this->dataRecord['username']) && $this->dataRecord['username'] != '' && $this->oldDataRecord['username'] != $this->dataRecord['username']) {
        if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord['username']) && $this->dataRecord['username'] != '' && $this->oldDataRecord['username'] != $this->dataRecord['username']) {
            $username = $app->db->quote($this->dataRecord["username"]);
            $client_id = $this->id;
            $sql = "UPDATE sys_user SET username = '$username' WHERE client_id = $client_id";
@@ -202,7 +202,7 @@
        }
        
        // password changed
        if($conf['demo_mode'] != true && isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') {
        if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord["password"]) && $this->dataRecord["password"] != '') {
            $password = $app->db->quote($this->dataRecord["password"]);
            $client_id = $this->id;
            $salt="$1$";
@@ -217,7 +217,7 @@
        }
        
        // language changed
        if($conf['demo_mode'] != true && isset($this->dataRecord['language']) && $this->dataRecord['language'] != '' && $this->oldDataRecord['language'] != $this->dataRecord['language']) {
        if(isset($conf['demo_mode']) && $conf['demo_mode'] != true && isset($this->dataRecord['language']) && $this->dataRecord['language'] != '' && $this->oldDataRecord['language'] != $this->dataRecord['language']) {
            $language = $app->db->quote($this->dataRecord["language"]);
            $client_id = $this->id;
            $sql = "UPDATE sys_user SET language = '$language' WHERE client_id = $client_id";
@@ -225,7 +225,7 @@
        }
        
        // ensure that a reseller is not converted to a client in demo mode when client_id <= 2
        if($conf['demo_mode'] == true && $this->id <= 2) {
        if(isset($conf['demo_mode']) && $conf['demo_mode'] == true && $this->id <= 2) {
            if(isset($this->dataRecord["limit_client"]) && $this->dataRecord["limit_client"] != -1) {
                $app->db->query('UPDATE client set limit_client = -1 WHERE client_id = '.$this->id);
            }