diff options
author | Simon Rettberg | 2018-02-16 14:45:16 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-02-16 14:45:16 +0100 |
commit | be2712827e4bec519a5704551832acb419f9ec3b (patch) | |
tree | d20e2c785e24d52c6ac723bcba40f1e02c78e9a2 /modules-available/webinterface/page.inc.php | |
parent | [vmstore] Simplify permissions (diff) | |
download | slx-admin-be2712827e4bec519a5704551832acb419f9ec3b.tar.gz slx-admin-be2712827e4bec519a5704551832acb419f9ec3b.tar.xz slx-admin-be2712827e4bec519a5704551832acb419f9ec3b.zip |
[webinterface] Use permission helpers; disable inputs individually
Diffstat (limited to 'modules-available/webinterface/page.inc.php')
-rw-r--r-- | modules-available/webinterface/page.inc.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/modules-available/webinterface/page.inc.php b/modules-available/webinterface/page.inc.php index 41636c19..806ffd59 100644 --- a/modules-available/webinterface/page.inc.php +++ b/modules-available/webinterface/page.inc.php @@ -16,13 +16,16 @@ class Page_WebInterface extends Page } switch (Request::post('action')) { case 'https': - if (User::hasPermission("edit.https")) $this->actionConfigureHttps(); + User::assertPermission("edit.https"); + $this->actionConfigureHttps(); break; case 'password': - if (User::hasPermission("edit.password")) $this->actionShowHidePassword(); + User::assertPermission("edit.password"); + $this->actionShowHidePassword(); break; case 'customization': - if (User::hasPermission("edit.design")) $this->actionCustomization(); + User::assertPermission("edit.design"); + $this->actionCustomization(); break; } } @@ -123,7 +126,7 @@ class Page_WebInterface extends Page } } $data[$type . 'Selected'] = true; - $data["editAllowed"] = User::hasPermission("edit.https"); + Permission::addGlobalTags($data['perms'], null, ['edit.https']); Render::addTemplate('https', $data); // // Password fields @@ -133,8 +136,11 @@ class Page_WebInterface extends Page $data['selected_show'] = 'checked'; else $data['selected_hide'] = 'checked'; - $data["editAllowed"] = User::hasPermission("edit.password"); + Permission::addGlobalTags($data['perms'], null, ['edit.password']); Render::addTemplate('passwords', $data); + // + // Colors/Prefix + // $data = array('prefix' => Property::get('page-title-prefix')); $data['colors'] = array_map(function ($i) { return array('color' => $i ? '#' . $i : '', 'text' => Render::readableColor($i)); }, array('', 'f00', '0f0', '00f', 'ff0', 'f0f', '0ff', 'fff', '000', 'f90', '09f', '90f', 'f09', '9f0')); @@ -150,7 +156,7 @@ class Page_WebInterface extends Page if ($color) { $data['colors'][] = array('color' => $color, 'selected' => 'selected'); } - $data["editAllowed"] = User::hasPermission("edit.design"); + Permission::addGlobalTags($data['perms'], null, ['edit.design']); Render::addTemplate('customization', $data); } |