"description"=>"Adds a organiser page that lets moderators (or better) control the registered user accounts, and perform administrative actions such as password resets, and adding / removing accounts.",
exit(page_renderer::render_main("Unauthorised - User Table - $settings->sitename","<p>Only moderators (or better) may access the user table. You could try <a href='?action=logout'>logging out</a> and then <a href='?action=login&returnto=index.php%3Faction%3Duser-table'>logging in</a> again as a moderator, or alternatively visit the <a href='?action=user-list'>user list</a> instead, if that's what you're after.</p>"));
<p>(Warning!Deletingauserwillwipe<em>all</em>theiruserdata!Itwon't delete any pages they'vecreated,theiruserpage,ortheiravatarthough,asthosearepartofthewikiitself.)</p>
exit(page_renderer::render_main("Error: Unauthorised - Add User - $settings->sitename","<p>Only moderators (or better) may create users. You could try <a href='?action=logout'>logging out</a> and then <a href='?action=login&returnto%2Findex.php%3Faction%3Duser-table'>logging in</a> again as a moderator, or alternatively visit the <a href='?action=user-list'>user list</a> instead, if that's what you're after.</p>"));
exit(page_renderer::render_main("Error: Invalid Username - Add User - $settings->sitename","<p>The username <code>".htmlentities($new_username)."</code> contains some invalid characters. Only <code>a-z</code>, <code>A-Z</code>, <code>0-9</code>, <code>-</code>, and <code>_</code> are allowed in usernames. <a href='javascript:window.history.back();'>Go back</a>.</p>"));
exit(page_renderer::render_main("Error: Failed to save settings - Add User - $settings->sitename","<p>$settings->sitename failed to save the new user's data to disk. Please contact ".htmlentities($settings->admindetails_name)." for assistance (their email address can be found at the bottom of this page).</p>"));
$welcome_email_result=email_user($new_username,"Welcome!","Welcome to $settings->sitename, {username}! $env->user has created you an account. Here are your details:
Itisadvisedthatyouchangeyourpasswordassoonasyoulogin.Youcandothisbyclickingthecognexttoyournameonceyou've logged in, and scrolling to the 'changepassword'heading.
exit(page_renderer::render_main("Error - Set Password - $settings->sitename","<p>Error: You aren't logged in as a moderator, so you don't have permission to set a user's password.</p>"));
}
if(empty($_POST["user"])){
http_response_code(400);
exit(page_renderer::render_main("Error - Set Password - $settings->sitename","<p>Error: No username was provided via the 'user' POST parameter.</p>"));
}
if(empty($_POST["new-pass"])){
http_response_code(400);
exit(page_renderer::render_main("Error - Set Password - $settings->sitename","<p>Error: No password was provided via the 'new-pass' POST parameter.</p>"));
exit(page_renderer::render_main("User not found - Set Password - $settings->sitename","<p>Error: No user called '".htmlentities($_POST["user"])."' was found, so their password can't be set. Perhaps you forgot to create the user first?</p>"));
exit(page_renderer::render_main("Server Error - Set Password - $settings->sitename","<p>Error: $settings->sitename couldn't save the settings back to disk! Nothing has been changed. Please context ".htmlentities($settings->admindetails_name).", whose email address can be found at the bottom of this page.</p>"));
exit(page_renderer::render_main("Set Password - $settings->sitename","<p>".htmlentities($_POST["user"])."'s password has been set successfully. <a href='?action=user-table'>Go back</a> to the user table.</p>"));
exit(page_renderer::render_main("Error - Delete User - $settings->sitename","<p>Error: You aren't logged in as a moderator, so you don't have permission to delete a user's account.</p>"));
}
if(empty($_GET["user"])){
http_response_code(400);
exit(page_renderer::render_main("Error - Delete User - $settings->sitename","<p>Error: No username was provided in the <code>user</code> POST variable.</p>"));
exit(page_renderer::render_main("User not found - Delete User - $settings->sitename","<p>Error: No user called ".htmlentities($_GET["user"])." was found, so their account can't be delete. Perhaps you spelt their account name incorrectly?</p>"));
exit(page_renderer::render_main("Server Error - Delete User - $settings->sitename","<p>Error: $settings->sitename couldn't save the settings back to disk! Nothing has been changed. Please context ".htmlentities($settings->admindetails_name).", whose email address can be found at the bottom of this page.</p>"));
exit(page_renderer::render_main("Delete User - $settings->sitename","<p>".htmlentities($_GET["user"])."'s account has been deleted successfully. <a href='?action=user-table'>Go back</a> to the user table.</p>"));
if($env->is_admin)add_help_section("949-user-table","Managing User Accounts","<p>As a moderator on $settings->sitename, you can use the <a href='?action=user-table'>User Table</a> to administrate the user accounts on $settings->sitename. It allows you to perform actions such as adding and removing accounts, and resetting passwords.</p>");