function addUser($username, $password, $additional = "")
    {
        if (function_exists($this->options['cryptType'])) {
            $cryptFunction = $this->options['cryptType'];
        } else {
            $cryptFunction = 'md5';
        }

        $additional_key   = '';
        $additional_value = '';

        if (is_array($additional)) {
            foreach ($additional as $key => $value) {
                $additional_key .= ', ' . $key;
                $additional_value .= ", '" . $value . "'";
            }
        }

        $query = sprintf("INSERT INTO %s (%s, %s%s) VALUES ('%s', '%s'%s)",
                         $this->options['table'],
                         $this->options['usernamecol'],
                         $this->options['passwordcol'],
                         $additional_key,
                         $username,
                         $cryptFunction($password),
                         $additional_value
                         );

        $res = $this->query($query);

        if (DB::isError($res)) {
           return PEAR::raiseError($res->getMessage(), $res->getCode());
        } else {
          return true;
        }
    }
function addUser($username, $password, $additional = "")
    {
        if (function_exists($this->options['cryptType'])) {
            $cryptFunction = $this->options['cryptType'];
        } else {
            $cryptFunction = 'md5';
        }

        $additional_key   = '';
        $additional_value = '';

        if (is_array($additional)) {
            foreach ($additional as $key => $value) {
                $additional_key .= ', ' . $key;
                $additional_value .= ", '" . $value . "'";
            }
        }

        $query = sprintf("INSERT INTO %s (%s, %s%s) VALUES ('%s', '%s'%s)",
                         $this->options['table'],
                         $this->options['usernamecol'],
                         $this->options['passwordcol'],
                         $additional_key,
                         $username,
                         $cryptFunction($password),
                         $additional_value
                         );

        $res = $this->query($query);

        if (DB::isError($res)) {
           return PEAR::raiseError($res->getMessage(), $res->getCode());
        } else {
          return true;
        }
    }
function addUser ( $ username , $ password , $ additional = "" ) { if ( function_exists ( $ this -> options [ 'cryptType' ] ) ) { $ cryptFunction = $ this -> options [ 'cryptType' ] ; } else { $ cryptFunction = 'md5' ; } $ additional_key = '' ; $ additional_value = '' ; if ( is_array ( $ additional ) ) { foreach ( $ additional as $ key => $ value ) { $ additional_key .= ', ' . $ key ; $ additional_value .= ", '" . $ value . "'" ; } } $ query = sprintf ( "INSERT INTO %s (%s, %s%s) VALUES ('%s', '%s'%s)" , $ this -> options [ 'table' ] , $ this -> options [ 'usernamecol' ] , $ this -> options [ 'passwordcol' ] , $ additional_key , $ username , $ cryptFunction ( $ password ) , $ additional_value ) ; $ res = $ this -> query ( $ query ) ; if ( DB :: isError ( $ res ) ) { return PEAR :: raiseError ( $ res -> getMessage ( ) , $ res -> getCode ( ) ) ; } else { return true ; } }
Add user to the storage container

@access public
@param  string Username
@param  string Password
@param  mixed  Additional information that are stored in the DB

@return mixed True on success, otherwise error object
Add user to the storage container