Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes access permissions #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions htdocs/admin/config-process.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
admin/config-process.php

Access: namedadmins only
Access: admin only

Updates the system configuration.
*/
Expand All @@ -12,7 +12,7 @@
include_once("../include/config.php");
include_once("../include/amberphplib/main.php");

if (user_permissions_get("namedadmins"))
if (user_permissions_get("admin"))
{
/*
Fetch Configuration Data
Expand Down
232 changes: 135 additions & 97 deletions htdocs/admin/config.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion htdocs/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class page_output
function check_permissions()
{
// only allow namedadmins group members to have access
if (user_permissions_get("namedadmins"))
if (user_online())
{
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/user/options-process.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@


// administrator-only options
if (user_permissions_get("namedadmins"))
if (user_permissions_get("admin"))
{
// debugging
$sql_obj->string = "INSERT INTO users_options (userid, name, value) VALUES ($id, 'debug', '". $data["option_debug"] ."')";
Expand Down
43 changes: 23 additions & 20 deletions htdocs/user/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,27 +185,30 @@ function execute()


// administrator-only option
if (user_permissions_get("namedadmins"))
{
// debugging
$structure = NULL;
$structure["fieldname"] = "option_debug";
$structure["type"] = "checkbox";
$structure["defaultvalue"] = $options["debug"];
$structure["options"]["label"] = "Enable debug logging - this will impact performance a bit but will show a full trail of all functions and SQL queries made <i>(note: this option is only avaliable to administrators)</i>";
$this->obj_form->add_input($structure);

// concurrent logins
$structure = NULL;
$structure["fieldname"] = "option_concurrent_logins";
$structure["type"] = "checkbox";
$structure["defaultvalue"] = $options["concurrent_logins"];
$structure["options"]["label"] = "Permit this user to make multiple simultaneous logins</i>";
$this->obj_form->add_input($structure);

$this->obj_form->subforms["user_options"][] = "option_debug";
$this->obj_form->subforms["user_options"][] = "option_concurrent_logins";
// debugging
$structure = NULL;
$structure["fieldname"] = "option_debug";
$structure["type"] = "checkbox";
$structure["defaultvalue"] = $options["debug"];
$structure["options"]["label"] = "Enable debug logging - this will impact performance a bit but will show a full trail of all functions and SQL queries made <i>(note: this option is only avaliable to administrators)</i>";
if (!user_permissions_get("admin")) {
$structure["options"]["disabled"] = "yes";
}
$this->obj_form->add_input($structure);

// concurrent logins
$structure = NULL;
$structure["fieldname"] = "option_concurrent_logins";
$structure["type"] = "checkbox";
$structure["defaultvalue"] = $options["concurrent_logins"];
$structure["options"]["label"] = "Permit this user to make multiple simultaneous logins</i>";
if (!user_permissions_get("admin")) {
$structure["options"]["disabled"] = "yes";
}
$this->obj_form->add_input($structure);

$this->obj_form->subforms["user_options"][] = "option_debug";
$this->obj_form->subforms["user_options"][] = "option_concurrent_logins";


// remaining subforms
Expand Down
2 changes: 1 addition & 1 deletion htdocs/user/user-delete-process.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
include_once("../include/application/main.php");


if (user_permissions_get(namedadmins))
if (user_permissions_get("admin"))
{
/////////////////////////

Expand Down
4 changes: 2 additions & 2 deletions htdocs/user/user-edit-process.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
user/user-edit-process.php

Access: admin users only
Access: admin only

Updates or creates a user account based on the information provided to it.
*/
Expand All @@ -14,7 +14,7 @@
include_once("../include/application/main.php");


if (user_permissions_get(namedadmins))
if (user_permissions_get("admin"))
{
////// INPUT PROCESSING ////////////////////////

Expand Down
4 changes: 2 additions & 2 deletions htdocs/user/user-permissions-process.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
user/user-permissions-process.php

Access: admin users only
Access: admin only

Updates a user account's permissions.
*/
Expand All @@ -14,7 +14,7 @@
include_once("../include/application/main.php");


if (user_permissions_get(namedadmins))
if (user_permissions_get("admin"))
{
////// INPUT PROCESSING ////////////////////////

Expand Down
Loading