tbrehm
2012-01-03 91ac76131620cb062d3128f2fc23d6d174d9e3ba
Fixed: FS#1905 - client_add function in remote api adds duplicate user after returining correct dupliate error.
1 files modified
5 ■■■■■ changed files
interface/lib/classes/remoting.inc.php 5 ●●●●● patch | view | raw | blame | history
interface/lib/classes/remoting.inc.php
@@ -2158,6 +2158,11 @@
        $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'");
        if($tmp['number'] > 0) $app->remoting_lib->errorMessage .= "Duplicate username<br />";
        if($app->remoting_lib->errorMessage != '') {
            $this->server->fault('data_processing_error', $app->remoting_lib->errorMessage);
            return false;