1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-26 05:32:59 +00:00

Link to usertable in guiconfig

This commit is contained in:
Starbeamrainbowlabs 2018-05-13 23:37:26 +01:00
parent 5961d11e76
commit f95e482d85
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 24 additions and 10 deletions

View file

@ -396,7 +396,7 @@ if($settings->sessionprefix == "auto")
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/** The version of Pepperminty Wiki currently running. */ /** The version of Pepperminty Wiki currently running. */
$version = "v0.17-dev"; $version = "v0.17-dev";
$commit = "aac9d15eb946b8c53b31112d5b21d9476fa862c2"; $commit = "5961d11e765945453569c0a85b62d05d5f459f39";
/// Environment /// /// Environment ///
/** Holds information about the current request environment. */ /** Holds information about the current request environment. */
$env = new stdClass(); $env = new stdClass();
@ -2990,7 +2990,7 @@ function render_comments($comments_data, $depth = 0)
register_module([ register_module([
"name" => "Settings GUI", "name" => "Settings GUI",
"version" => "0.1.1", "version" => "0.1.2",
"author" => "Starbeamrainbowlabs", "author" => "Starbeamrainbowlabs",
"description" => "The module everyone has been waiting for! Adds a web based gui that lets mods change the wiki settings.", "description" => "The module everyone has been waiting for! Adds a web based gui that lets mods change the wiki settings.",
"id" => "feature-guiconfig", "id" => "feature-guiconfig",
@ -3088,6 +3088,13 @@ SCRIPT;
$reverse = true; $reverse = true;
$inputControl = "<input type='checkbox' id='$configKey' name='$configKey' " . ($settings->$configKey ? " checked" : "") . " />"; $inputControl = "<input type='checkbox' id='$configKey' name='$configKey' " . ($settings->$configKey ? " checked" : "") . " />";
break; break;
case "usertable":
$label = "";
if(module_exists("feature-user-table"))
$inputControl = "<p>The users can be managed in the <a href='?action=user-table'>User Table</a>.</p>";
else
$inputControl = "<p><em>The users can be managed in the user table, but the required module <code>feature-user-table</code> is not installed.</em></p>";
break;
default: default:
$label = ""; $label = "";
$inputControl = "<p><em>Sorry! The <code>$configKey</code> setting isn't editable yet through the gui. Please try editing <code>peppermint.json</code> for the time being.</em></p>"; $inputControl = "<p><em>Sorry! The <code>$configKey</code> setting isn't editable yet through the gui. Please try editing <code>peppermint.json</code> for the time being.</em></p>";
@ -5890,7 +5897,7 @@ register_module([
if(!$env->is_logged_in || !$env->is_admin) { if(!$env->is_logged_in || !$env->is_admin) {
http_response_code(401); http_response_code(401);
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%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("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%2Findex.hp%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>"));
} }
$content = "<h2>User Table</h2> $content = "<h2>User Table</h2>
@ -7541,7 +7548,7 @@ register_module([
// The user wants to log in // The user wants to log in
$user = $_POST["user"]; $user = $_POST["user"];
$pass = $_POST["pass"]; $pass = $_POST["pass"];
if(verify_password($pass, $settings->users->$user->password)) if(!empty($settings->users->$user) && verify_password($pass, $settings->users->$user->password))
{ {
// Success! :D // Success! :D

View file

@ -64,11 +64,11 @@
}, },
{ {
"name": "Settings GUI", "name": "Settings GUI",
"version": "0.1.1", "version": "0.1.2",
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "The module everyone has been waiting for! Adds a web based gui that lets mods change the wiki settings.", "description": "The module everyone has been waiting for! Adds a web based gui that lets mods change the wiki settings.",
"id": "feature-guiconfig", "id": "feature-guiconfig",
"lastupdate": 1524415857, "lastupdate": 1526250969,
"optional": false "optional": false
}, },
{ {
@ -140,7 +140,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds a organiser page that lets moderators (or better) control the reegistered user accounts, and perform adminstrative actions such as password resets, and adding \/ removing accounts.", "description": "Adds a organiser page that lets moderators (or better) control the reegistered user accounts, and perform adminstrative actions such as password resets, and adding \/ removing accounts.",
"id": "feature-user-table", "id": "feature-user-table",
"lastupdate": 1526161887, "lastupdate": 1526250680,
"optional": false "optional": false
}, },
{ {
@ -212,7 +212,7 @@
"author": "Starbeamrainbowlabs", "author": "Starbeamrainbowlabs",
"description": "Adds a pair of actions (login and checklogin) that allow users to login. You need this one if you want your users to be able to login.", "description": "Adds a pair of actions (login and checklogin) that allow users to login. You need this one if you want your users to be able to login.",
"id": "page-login", "id": "page-login",
"lastupdate": 1526038530, "lastupdate": 1526227977,
"optional": false "optional": false
}, },
{ {

View file

@ -1,7 +1,7 @@
<?php <?php
register_module([ register_module([
"name" => "Settings GUI", "name" => "Settings GUI",
"version" => "0.1.1", "version" => "0.1.2",
"author" => "Starbeamrainbowlabs", "author" => "Starbeamrainbowlabs",
"description" => "The module everyone has been waiting for! Adds a web based gui that lets mods change the wiki settings.", "description" => "The module everyone has been waiting for! Adds a web based gui that lets mods change the wiki settings.",
"id" => "feature-guiconfig", "id" => "feature-guiconfig",
@ -99,6 +99,13 @@ SCRIPT;
$reverse = true; $reverse = true;
$inputControl = "<input type='checkbox' id='$configKey' name='$configKey' " . ($settings->$configKey ? " checked" : "") . " />"; $inputControl = "<input type='checkbox' id='$configKey' name='$configKey' " . ($settings->$configKey ? " checked" : "") . " />";
break; break;
case "usertable":
$label = "";
if(module_exists("feature-user-table"))
$inputControl = "<p>The users can be managed in the <a href='?action=user-table'>User Table</a>.</p>";
else
$inputControl = "<p><em>The users can be managed in the user table, but the required module <code>feature-user-table</code> is not installed.</em></p>";
break;
default: default:
$label = ""; $label = "";
$inputControl = "<p><em>Sorry! The <code>$configKey</code> setting isn't editable yet through the gui. Please try editing <code>peppermint.json</code> for the time being.</em></p>"; $inputControl = "<p><em>Sorry! The <code>$configKey</code> setting isn't editable yet through the gui. Please try editing <code>peppermint.json</code> for the time being.</em></p>";

View file

@ -33,7 +33,7 @@ register_module([
if(!$env->is_logged_in || !$env->is_admin) { if(!$env->is_logged_in || !$env->is_admin) {
http_response_code(401); http_response_code(401);
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%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("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%2Findex.hp%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>"));
} }
$content = "<h2>User Table</h2> $content = "<h2>User Table</h2>