/**
     *	@author Anthony Boutinov
     *	
     *	@param string $login_or_email		Логин или email
     *	@retval array|false					Ассоциативный массив с ключами EMAIL, LOGIN, PASSWORD_RESET_TOKEN. Если пользователь с таким логином или email не найден, возвращается false
     */
    public function initiatePasswordReset($login_or_email)
    {
        $is_email = filter_var($login_or_email, FILTER_VALIDATE_EMAIL);
        $this->sanitize($login_or_email);
        $password_restore_token = CommonFunctions::generateRandomString(64);
        $this->sanitize($password_restore_token);
        $sql = 'update CM$DB_USER set PASSWORD_RESET_TOKEN=\'' . password_hash($password_restore_token, PASSWORD_BCRYPT) . '\' where ';
        if ($is_email) {
            $sql = $sql . 'ID_DB_USER=(
					select ID_DB_USER
					from SP$VAR
					where
						VALUE=\'' . $login_or_email . '\'
						and ID_DICTIONARY=(
							select ID_DICTIONARY
							from CM$DICTIONARY
							where SHORT_NAME=\'EMAIL\'
						)
				)';
        } else {
            $sql = $sql . 'login=\'' . $login_or_email . '\'';
        }
        $this->getQueryResultWithErrorNoticing($sql);
        $login = $login_or_email;
        $email = $login_or_email;
        if ($is_email) {
            $email = $login_or_email;
            $sql = 'select LOGIN
				from CM$DB_USER
				where ID_DB_USER=(
					select ID_DB_USER
					from SP$VAR
					where
						VALUE=\'' . $login_or_email . '\'
						and ID_DICTIONARY=(
							select ID_DICTIONARY
							from CM$DICTIONARY
							where SHORT_NAME=\'EMAIL\'
						)
				)';
            $result = $this->getQueryFirstRowResultWithErrorNoticing($sql, null, true);
            if (!$result) {
                return false;
            } else {
                $login = $result['LOGIN'];
            }
        } else {
            $sql = 'select VALUE as EMAIL from SP$VAR
				where ID_DB_USER=(
						select ID_DB_USER from CM$DB_USER
						where LOGIN=\'' . $login_or_email . '\'
					) and ID_DICTIONARY=(
						select ID_DICTIONARY from CM$DICTIONARY
						where SHORT_NAME=\'EMAIL\'
					)';
            $result = $this->getQueryFirstRowResultWithErrorNoticing($sql, null, true);
            if (!$result) {
                return false;
            } else {
                $email = $result['EMAIL'];
            }
        }
        return ['PASSWORD_RESET_TOKEN' => $password_restore_token, 'LOGIN' => $login, 'EMAIL' => $email];
    }