diff options
author | root | 2019-02-19 18:53:50 +0100 |
---|---|---|
committer | root | 2019-02-19 18:53:50 +0100 |
commit | 0ad4c0f8196b61699754762aacbaab0223478ab9 (patch) | |
tree | de434c4aea8d07ecd01cd3badd48d057d62c2d1b /modules-available/backup/page.inc.php | |
parent | [usb-lock-off] Edit rule cleanup and fix of the dropdown boxes. (diff) | |
parent | [statistics] Fix RAM change warning to handle increase too (diff) | |
download | slx-admin-usb-lock-off.tar.gz slx-admin-usb-lock-off.tar.xz slx-admin-usb-lock-off.zip |
Merge branch 'master' into usb-lock-offusb-lock-off
Diffstat (limited to 'modules-available/backup/page.inc.php')
-rw-r--r-- | modules-available/backup/page.inc.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/modules-available/backup/page.inc.php b/modules-available/backup/page.inc.php index 949cd7f3..985f39ee 100644 --- a/modules-available/backup/page.inc.php +++ b/modules-available/backup/page.inc.php @@ -16,16 +16,19 @@ class Page_Backup extends Page Util::redirect('?do=Main'); } $this->action = Request::post('action'); - if ($this->action === 'backup' && User::hasPermission("create")) { + if ($this->action === 'backup') { + User::assertPermission("create"); $this->backup(); - } elseif ($this->action === 'restore' && User::hasPermission("restore")) { + } elseif ($this->action === 'restore') { + User::assertPermission("restore"); $this->restore(); } + User::assertPermission('*'); } protected function doRender() { - if ($this->action === 'restore' && User::hasPermission("restore")) { + if ($this->action === 'restore') { // TODO: We're in post mode, redirect with all the taskids first... Render::addTemplate('restore', $this->templateData); } else { $lastBackup = (int)Property::get(self::LAST_BACKUP_PROP, 0); @@ -34,9 +37,9 @@ class Page_Backup extends Page } else { $lastBackup = date('d.m.Y', $lastBackup); } - Render::addTemplate('_page', ['last_backup' => $lastBackup, - "createAllowed" => User::hasPermission("create"), - "restoreAllowed" => User::hasPermission("restore")]); + $params = ['last_backup' => $lastBackup]; + Permission::addGlobalTags($params['perms'], NULL, ['create', 'restore']); + Render::addTemplate('_page', $params); } } |