The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Auto-Assign Username - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28) +--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29) +--- Thread: Auto-Assign Username (/showthread.php?tid=551) |
Auto-Assign Username - Brandin - 04-29-2017 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 Remove the Code: $username = Input::get('username'); Code: $email 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( Change Line 177 from: Code: 'username' => Input::get('username'), Code: 'username' => $username, In Code: users/views/_join.php 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). |