The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto-Assign Username
#1
Hello,

Don't want your users to pick their own usernames? Assign it yourself using these modifications!

The information below will assign a username of:
-First Initial Last Name, e.g. barsenault
-If that username exists, First Name, Last Initial, e.g. brandina
-If that username exists, email address of user

First, duplicate your
Code:
join.php
to usersc folder so you do not modify a CORE file.
Remove the
Code:
$username = Input::get('username');
around Line 70 and add the following haste after the
Code:
$email
value:
https://hastebin.com/ukojoqexut.php

Remove the validation for username around line 84, so instead of the first line after 83 being username, the first line should be
Code:
'fname' => array(
If you try to validate a non-field, it will fail.

Change Line 177 from:
Code:
'username' => Input::get('username'),
To:
Code:
'username' => $username,

In
Code:
users/views/_join.php
remove the Username label and input.

I recommend modifying the confirmation email or success page to include the users username, or advise them of the format (I recommend telling the user their username because it might not be in the format you provide them if the first format fails).
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)