evo webloginPe auth by email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
В методе function Register в классе webloginPe просто | |
1. Напишите вместо строки | |
<code>$username = $_POST['username'];</code> | |
строку | |
<code>$username = $modx->db->escape($modx->stripTags($_POST['email']));</code> | |
2. Закомментируйте кусок кода чуть ниже (валидация username) | |
<code>if (!ctype_alnum($username)) | |
{ | |
return $this->FormatMessage($this->LanguageArray[32]); | |
}</code> | |
3. Сделайте в форме регистрации | |
<input type="hidden" name="username" value=""> | |
4. Сделайте при регистрации поле email обязательным | |
И все — вы получите username=email, а email — валидируется по правилам email и не допускает повторения. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment