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
518866
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;
        }
    }
650268
public static void setUser(String userName, String password){
        getImpl().getDirectoryServiceClient().setUser(userName, password);
    }
1189030
public function login($username, $password)
  {
    $this->execute("login", array("client_login_name" => $username, "client_login_password" => $password));
    $this->whoamiReset();

    $crypt = new TeamSpeak3_Helper_Crypt($username);

    $this->setStorage("_login_user", $username);
    $this->setStorage("_login_pass", $crypt->encrypt($password));

    TeamSpeak3_Helper_Signal::getInstance()->emit("notifyLogin", $this);
  }
1240552
public static function addUser($username, $nickname, $password, $note = '', $status = 1)
    {
        $obj = new static();
        $obj->setAttributes([
            'username' => $username,
            'nickname' => $nickname,
            'password' => \Yii::$app->getSecurity()->generatePasswordHash($password, 4),
            'note' => $note,
            'status' => $status,
        ]);

        return $obj->save();
    }
354009
protected function checkUserPassword($username, $password)
    {
        if (!isset($this->users[$username]) || $this->users[$username] !== $password) {
            return false;
        }

        return true;
    }
849752
public function addUser($user)
    {
        //only add the information if there are username and password
        if ($user && $this->getPass()) {
            $this->fullUrl['credentials'] = $user . ':' . $this->getPass() . '@';
        }

        return $this;
    }
957807
public static function create(string $username, string $email, string $password) : User
    {
        $user = new User();
        $user->username = $username;
        $user->email    = $email;
        $user->status   = self::STATUS_ACTIVE;
        $user->setPassword($password);
        $user->generateAuthKey();
        return $user;
    }
736494
private function createUser($username, $password)
    {
        $user = new UserInformation(
            [
                'username' => $username,
                'acl'      => UserInformationInterface::ROLE_ALL
            ]
        );

        $user->set('password', $this->get('security.password_encoder')->encodePassword($user, $password));

        $user = $this->get('tenside.user_provider')->addUser($user)->refreshUser($user);

        return $user;
    }
272093
def add_to_user(self, name, **attrs):
        
        user = self.get_user(name=name)
        attrs_ = user['user']
        attrs_.update(**attrs)
424174
public static function logIn($username, $password)
    {
        if (!$username)
        {
            throw new AVException("Cannot log in user with an empty name");
        }
        if (!$password)
        {
            throw new AVException("Cannot log in user with an empty password.");
        }
        $data = array("username" => $username, "password" => $password);
        $result = AVClient::_request("GET", "/login", "", $data);
        $user = new AVUser();
        $user->_mergeAfterFetch($result);
        $user->handleSaveResult(true);
        AVClient::getStorage()->set("user", $user);

        return $user;
    }
1055987
async def add_user(self, username, password=None, display_name=None):
        
        if not display_name:
            display_name = username
        user_facade = client.UserManagerFacade.from_connection(
            self.connection())
        users = [client.AddUser(display_name=display_name,
                                username=username,
                                password=password)]
        results = await user_facade.AddUser(users)
        secret_key = results.results[0].secret_key
        return await self.get_user(username, secret_key=secret_key)
134461
public function addRole($username, $role)
    {
        $user = $this->findUserByUsernameOrThrowException($username);
        if ($user->hasRole($role)) {
            return false;
        }

        $user->addRole($role);
        $this->userManager->updateUser($user);

        return true;
    }
745168
public function connect($hostname, $username, $password)
    {
        try {
            $this->pdo = new \PDO('mysql:host=' . $hostname . ';', $username, $password);
            $result = Events::dispatch('onPDOCreated', array(&$this->pdo));
            if (intval($this->pdo->errorCode()) === 0) {
                $this->pdo->exec('SET NAMES utf8');
                $this->pdo->exec('SET sql_mode = \'\'');
                $this->pdo->exec('SET FOREIGN_KEY_CHECKS=0');
                return true;
            }
        } catch (\Exception $ex) {
//            print_debug($ex);
            Events::dispatch('onException', $ex);
            $this->lastError = $ex;
//            throw $ex;
        }
        return false;
    }
1230820
def add_user(username, password):
    

    user_model = Query()
    if db.search(user_model.username == username):
        return {
            'error': 'User {0} already exists'.format(username)
        }

    salt = hashlib.sha512(str(os.urandom(64)).encode('utf-8')).hexdigest()
    password = hash_password(password, salt)
    api_key = gen_api_key(username)

    user = {
        'username': username,
        'password': password,
        'salt': salt,
        'api_key': api_key
    }
    user_id = db.insert(user)

    return {
       'result': 'success',
       'eid': user_id,
       'user_created': user
    }
360785
public function create(User $user, $username, $password)
    {
        $this->authenticationService->create($user, $username, $password);
    }
851886
public function addDatabaseCredentials($acquiaDbName, $localDbName, $username, $password = null, $host = 'localhost', $port = 3306)
    {
        $connString = $username;
        if ($password !== null) {
            $connString . ':' . $password;
        }

        $this->creds['databases'][$acquiaDbName] = array(
            'id'  => '1',
            'role' => $this->sitegroup, // Is this right? For local doesn't really matter.
            'name' => $localDbName,
            'user' => $username,
            'pass' => $password,
            'db_url_ha' => array(
                $host => "mysqli://$connString@$host:$port/mysiteprod"
            ),
            'db_cluster_id' => '1',
            'port' => $port,
        );

        return $this;
    }
923075
public function add($username, $email, $password)
    {
        try {
            $this->database->table(self::TABLE_NAME)->insert([
                self::COLUMN_NAME => $username,
                self::COLUMN_PASSWORD_HASH => Passwords::hash($password),
                self::COLUMN_EMAIL => $email,
            ]);
        } catch (Nette\Database\UniqueConstraintViolationException $e) {
            throw new DuplicateNameException;
        }
    }