summaryrefslogtreecommitdiffstats
path: root/modules-available/backup/page.inc.php
diff options
context:
space:
mode:
authorUdo Walter2017-12-14 14:40:53 +0100
committerUdo Walter2017-12-14 14:40:53 +0100
commit1a4fa4f756c9b58a5a4da6b4511ac9ceda866326 (patch)
tree45fe23b29be375f235c8d4861fff3b2edc69bc06 /modules-available/backup/page.inc.php
parent[webinterface] added permissions to edit https, password and design settings (diff)
downloadslx-admin-1a4fa4f756c9b58a5a4da6b4511ac9ceda866326.tar.gz
slx-admin-1a4fa4f756c9b58a5a4da6b4511ac9ceda866326.tar.xz
slx-admin-1a4fa4f756c9b58a5a4da6b4511ac9ceda866326.zip
[backup] added permissions to create and restore backups
Diffstat (limited to 'modules-available/backup/page.inc.php')
-rw-r--r--modules-available/backup/page.inc.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules-available/backup/page.inc.php b/modules-available/backup/page.inc.php
index 77d677c7..26182ca3 100644
--- a/modules-available/backup/page.inc.php
+++ b/modules-available/backup/page.inc.php
@@ -11,21 +11,21 @@ class Page_Backup extends Page
protected function doPreprocess()
{
User::load();
- if (!User::hasPermission('superadmin')) {
+ if (!User::isLoggedIn()) {
Message::addError('main.no-permission');
Util::redirect('?do=Main');
}
$this->action = Request::post('action');
- if ($this->action === 'backup') {
+ if ($this->action === 'backup' && User::hasPermission("create")) {
$this->backup();
- } elseif ($this->action === 'restore') {
+ } elseif ($this->action === 'restore' && User::hasPermission("restore")) {
$this->restore();
}
}
protected function doRender()
{
- if ($this->action === 'restore') {
+ if ($this->action === 'restore' && User::hasPermission("restore")) {
Render::addTemplate('restore', $this->templateData);
} else {
$lastBackup = (int)Property::get(self::LAST_BACKUP_PROP, 0);
@@ -34,7 +34,9 @@ class Page_Backup extends Page
} else {
$lastBackup = date('d.m.Y', $lastBackup);
}
- Render::addTemplate('_page', ['last_backup' => $lastBackup]);
+ Render::addTemplate('_page', ['last_backup' => $lastBackup,
+ "createAllowed" => User::hasPermission("create"),
+ "restoreAllowed" => User::hasPermission("restore")]);
}
}