Created
January 3, 2018 09:26
-
-
Save morozVA/d633dcd3cc58897a9c20ee49de49a71c to your computer and use it in GitHub Desktop.
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