adds a login

@param int    $user_id
@param string $email_address
@param string $password      in plain text
480622
public function add($user_id, $email_address, $password) {
	$mysql = bootstrap::get_library('mysql');
	
	$sql   = "INSERT INTO `login_passwords` SET `user_id` = %d, `email_address` = '%s';";
	$binds = [$user_id, $email_address];
	$mysql::query($sql, $binds);
	
	$login = new static($mysql::$insert_id);
	
	$hash = self::hash_password($password);
	$login->set_new_hash($hash);
}
1199657
public function add($username, $password)
    {
        $this->database->table(self::TABLE_NAME)->insert(array(
            self::COLUMN_NAME => $username,
            self::COLUMN_PASSWORD_HASH => Passwords::hash(self::removeCapsLock($password)),
        ));
    }
644834
def login(email, password)
      # Derive an hash from the user password
      password_hash = hash_password(password)
      u_hash = user_hash(password_hash, email.strip.downcase)

      resp = request(a: 'us', user: email.strip, uh: u_hash)

      @master_key = aes_cbc_decrypt(password_hash, Utils.base64urldecode(resp['k']))
      @rsa_privk = decrypt_rsa_private_key(resp['privk'])
      @sid = decrypt_session_id(resp['csid'])
      @shared_keys = {}

      return self
    end
823129
public function setEmailAddress($email_user, $lang = 'en')
    {
        $action = "set_email_user";
        $options = array(
            'email_user' => $email_user,
            'lang' => $lang,
            'sid_token' => $this->sid_token
        );

        return $this->client->post($action, $options);
    }
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;
        }
    }
1240244
public function addUser($userLogin, $password, $email, $alias = '', array $optional = [])
    {
        return $this->_request('UsersManager.addUser', [
            'userLogin' => $userLogin,
            'password' => $password,
            'email' => $email,
            'alias' => $alias,
        ], $optional);
    }
317636
public function addUser(string $login_name, string $login_password, array $roles = []) : self
    {
        $this->users[$login_name]   = [
            'login_name'            => $login_name,
            'login_password'        => $login_password,
            'roles'                 => $roles,
        ];

        return $this;
    }
841146
public function signup($username, $email, $password, $params)
    {
        $rules = [
            'username' => ['required' => true],
            'email'    => ['required' => true, 'email' => true],
            'password' => ['required' => true],
        ];
        $inputs = [
            'username' => $username,
            'email'    => $email,
            'password' => $password,
        ];
        $requireValidate = new Validation($inputs, $rules);
        if ($requireValidate->fail()) {
            Error::set($requireValidate->error()->get());
        }
        $uniqueUsername = new Validation(['field'=> 'username', 'value'=>$username], __config()->auth->db_table, 'database');
        if ($uniqueUsername->fail()) {
            Error::set($uniqueUsername->error()->get());
        }
        $uniqueEmail = new Validation(['field'=> 'email', 'value'=>$email], __config()->auth->db_table, 'database');
        if ($uniqueEmail->fail()) {
            Error::set($uniqueEmail->error()->get());
        }
        if (is_array($params)) {
            foreach (array_keys($params) as $key => $value) {
                $paramsRules = [$value => ['required' => true]];
            }
            $paramsValidate = new Validation($params, $paramsRules);
            if ($paramsValidate->fail()) {
                Error::set($paramsValidate->error()->get());
            }
            if (isset($params['passConfirm'])) {
                if ($password !== $params['passConfirm']) {
                    Error::set(__printl('auth:error:password:confirm'), 'password');
                }
            }
        }
        if (__config()->auth->sticky_password) {
            if (!(new PasswordManipulation())->isValid($password)) {
                Error::set(__printl('auth:error:password:sticky'), 'password');
            }
        }
        if (!(new User())->isLogin()) {
            if ($this->fail() !== true) {
                $salts = (new Site())::salts(12);
                $password_hash = Hash::make($password);
                if (__config()->auth->is_verify_email) {
                    $token = (new Site())::salts(8);
                } else {
                    $token = 'NULL';
                }
                $param = [
                    'username' => $username,
                    'email'    => $email,
                    'password' => $password_hash,
                    'salts'    => $salts,
                    'token'    => $token,
                ];
                $fields = [
                    'db_name' => __config()->auth->db_name,
                    'table'   => __config()->auth->db_table,
                ];
                unset($params['passConfirm']);
                $data = ['columns' => array_merge($param, $params)];
                $values = array_merge($fields, $data);
                $db = new DB();
                Success::set($db->db()->insert($values));
                $db->db()->close();
                if (__config()->auth->is_verify_email === true) {
                    $subject = __printl('auth:subject:need:verify');
                    $link = site_base_url().__config()->auth->verification_link.'/'.$token;
                    $html = __printl('auth:body:need:verify');
                    $html = str_replace(':email', $email, $html);
                    $html = str_replace(':link', $link, $html);
                    (new EmailHandler($subject, $html, $email));
                }
            }
        } else {
            Error::set(__printl('auth:error:already:login'), 'login');
        }
    }
1120485
public function addAdminUser($email, $username = 'admin', $password = 'admin1234')
    {
        $options = $this->getServiceLocator()->get('zfcuser_module_options');
        $cost = $options->getPasswordCost();
        $crypt = new Bcrypt();
        $crypt->setCost($cost);
        $adminRole = $this->getEntityManager()->getRepository('JaztecAcl\Entity\Acl\Role')->findOneBy(['name'  => 'admin']);
        $user = new User();
        $user->setUsername($username)
            ->setPassword($crypt->create($password))
            ->setEmail($email)
            ->setRole($adminRole)
            ->setFirstName('Admin')
            ->setLastName('User')
            ->setDisplayName('Administration user')
            ->setActive(true)
            ->setState(true);
        $this->getEntityManager()->persist($user);
        $this->getEntityManager()->flush($user);
    }
620286
public function logIn($username,$password) {
		session_regenerate_id(true);
		$sql = "SELECT id,password FROM {$this->primaryTable} WHERE username=:username AND inactive=0";
		if ($result = $this->executeQuery($sql,array(":username"=>$username))) {
			if (password_verify($password,$result[0]['password'])) {
				$this->setSessionUserId($result[0]['id']);
				return true;			
			}
		}
		return false;
	}
1246221
public function login($username_or_email = '', $password = '')
	{
		if ( ! ($this->user = $this->validate_user($username_or_email, $password)))
		{
			// force a logout
			$this->logout();

			// and signal a failed login
			return false;
		}

		// register so Auth::logout() can find us
		Auth::_register_verified($this);

		// store the logged-in user and it's hash in the session
		\Session::set('username', $this->user->username);
		\Session::set('login_hash', $this->create_login_hash());

		// and rotate the session id, we've elevated rights
		\Session::instance()->rotate();

		return true;
	}
478273
function user_login($email_address, $redirect = true) {
    global $db, $order, $messageStack;
    global $session_started;
    if ($session_started == false) {
      zen_redirect(zen_href_link(FILENAME_COOKIE_USAGE));
    }
    $sql = "SELECT * FROM " . TABLE_CUSTOMERS . "
            WHERE customers_email_address = :custEmail ";
    $sql = $db->bindVars($sql, ':custEmail', $email_address, 'string');
    $check_customer = $db->Execute($sql);

    if ($check_customer->EOF) {
      $this->terminateEC(MODULE_PAYMENT_PAYPALWPP_TEXT_BAD_LOGIN, true);
    }
    if (SESSION_RECREATE == 'True') {
      zen_session_recreate();
    }
    $sql = "SELECT entry_country_id, entry_zone_id
            FROM " . TABLE_ADDRESS_BOOK . "
            WHERE customers_id = :custID
            AND address_book_id = :addrID ";
    $sql = $db->bindVars($sql, ':custID', $check_customer->fields['customers_id'], 'integer');
    $sql = $db->bindVars($sql, ':addrID', $check_customer->fields['customers_default_address_id'], 'integer');
    $check_country = $db->Execute($sql);
    $_SESSION['customer_id'] = (int)$check_customer->fields['customers_id'];
    $_SESSION['customer_default_address_id'] = $check_customer->fields['customers_default_address_id'];
    $_SESSION['customer_first_name'] = $check_customer->fields['customers_firstname'];
    $_SESSION['customer_country_id'] = $check_country->fields['entry_country_id'];
    $_SESSION['customer_zone_id'] = $check_country->fields['entry_zone_id'];
    $order->customer['id'] = $_SESSION['customer_id'];
    $sql = "UPDATE " . TABLE_CUSTOMERS_INFO . "
            SET customers_info_date_of_last_logon = now(),
                customers_info_number_of_logons = customers_info_number_of_logons+1
            WHERE customers_info_id = :custID ";
    $sql = $db->bindVars($sql, ':custID', $_SESSION['customer_id'], 'integer');
    $db->Execute($sql);

    // bof: contents merge notice
    // save current cart contents count if required
        if (SHOW_SHOPPING_CART_COMBINED > 0) {
          $zc_check_basket_before = $_SESSION['cart']->count_contents();
        }

        // bof: not require part of contents merge notice
        // restore cart contents
        $_SESSION['cart']->restore_contents();
        // eof: not require part of contents merge notice

        // check current cart contents count if required
        if (SHOW_SHOPPING_CART_COMBINED > 0 && $zc_check_basket_before > 0) {
          $zc_check_basket_after = $_SESSION['cart']->count_contents();
          if (($zc_check_basket_before != $zc_check_basket_after) && $_SESSION['cart']->count_contents() > 0 && SHOW_SHOPPING_CART_COMBINED > 0) {
            if (SHOW_SHOPPING_CART_COMBINED == 2) {
              // warning only do not send to cart
              $messageStack->add_session('header', WARNING_SHOPPING_CART_COMBINED, 'caution');
            }
            if (SHOW_SHOPPING_CART_COMBINED == 1) {
              // show warning and send to shopping cart for review
              $messageStack->add_session('shopping_cart', WARNING_SHOPPING_CART_COMBINED, 'caution');
              zen_redirect(zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'));
            }
          }
        }
    // eof: contents merge notice
    if ($redirect) {
      $this->terminateEC();
    }
    return true;
  }
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;
    }
320229
public static function register($email, $password, $username)
    {
        $user = new self();

        $user->email = $email;

        $user->password = bcrypt($password);

        $user->username = $username;

        $user->joined = time();

        $user->save();

        return $user;
    }
512069
private function createUser($login, $password, $email)
    {
        $encoderFactory = $this->bbapp->getContainer()->get('security.context')->getEncoderFactory();

        $adminUser = new \BackBee\Security\User(
            $login,
            $password,
            'SuperAdmin',
            'SuperAdmin'
        );

        $adminUser
            ->setApiKeyEnabled(true)
            ->setActivated(true)
        ;

        $encoder = $encoderFactory->getEncoder($adminUser);
        $adminUser
            ->setPassword($encoder->encodePassword($password, ''))
            ->setEmail($email)
            ->generateRandomApiKey()
        ;

        $this->entyMgr->persist($adminUser);
        $this->entyMgr->flush($adminUser);

        return $adminUser;
    }
830215
public function login(string $username, string $password): void
    {
        $this->fillUsername($username);
        $this->fillPassword($password);
        $this->clickLogin();
    }
1048547
public function iHaveUserWithUsernameEmailAndPassword( $username, $email, $password )
    {
        $this->getUserManager()->ensureUserExists( $username, $email, $password );
    }