Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- Am_Di::getInstance()->hook->add(Am_Event::GENERATE_LOGIN, function (Am_Event $e) {
- $user = $e->getUser();
- if ($_ = preg_replace('/[^0-9a-zA-Z]/', '', "{$user->name_f}{$user->name_l}")) {
- $i = 1;
- $l = $_;
- while (!$e->getDi()->userTable->checkUniqLogin($l)) {
- $l = $_ . $i++;
- }
- $e->setReturn(array($l));
- }
- });
Add Comment
Please, Sign In to add comment