summaryrefslogtreecommitdiffstats
path: root/modules-available/dozmod/page.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/dozmod/page.inc.php')
-rw-r--r--modules-available/dozmod/page.inc.php50
1 files changed, 37 insertions, 13 deletions
diff --git a/modules-available/dozmod/page.inc.php b/modules-available/dozmod/page.inc.php
index 9c247770..93d38f48 100644
--- a/modules-available/dozmod/page.inc.php
+++ b/modules-available/dozmod/page.inc.php
@@ -27,7 +27,7 @@ class Page_DozMod extends Page
{
User::load();
- if (!User::hasPermission('superadmin')) {
+ if (!User::isLoggedIn()) {
Message::addError('main.no-permission');
Util::redirect('?do=Main');
}
@@ -50,15 +50,30 @@ class Page_DozMod extends Page
$action = Request::post('action', false, 'string');
if ($action === 'mail') {
- $this->mailHandler();
+ if (User::hasPermission("mail.save")) {
+ $this->mailHandler();
+ } else {
+ Message::addError('main.no-permission');
+ Util::redirect('?do=dozmod&section=mailconfig');
+ }
} elseif ($action === 'runtime') {
- $this->runtimeHandler();
+ if (User::hasPermission("runtimeconfig.save")) {
+ $this->runtimeHandler();
+ } else {
+ Message::addError('main.no-permission');
+ Util::redirect('?do=dozmod&section=runtimeconfig');
+ }
} elseif ($action === 'delimages') {
- $result = $this->handleDeleteImages();
- if (!empty($result)) {
- Message::addInfo('delete-images', $result);
+ if (User::hasPermission("images.delete")) {
+ $result = $this->handleDeleteImages();
+ if (!empty($result)) {
+ Message::addInfo('delete-images', $result);
+ }
+ Util::redirect('?do=DozMod');
+ } else {
+ Message::addError('main.no-permission');
+ Util::redirect('?do=dozmod');
}
- Util::redirect('?do=DozMod');
} elseif ($action !== false) {
Util::traceError('Invalid action: ' . $action);
}
@@ -180,6 +195,7 @@ class Page_DozMod extends Page
$row['name_extra_class'] = 'slx-strike';
}
$row['version'] = date('d.m.Y H:i:s', $row['createtime']);
+ $row['rawfilesize'] = $row['filesize'];
$row['filesize'] = Util::readableFileSize($row['filesize']);
$rows[] = $row;
}
@@ -203,8 +219,6 @@ class Page_DozMod extends Page
protected function doAjax()
{
User::load();
- if (!User::hasPermission('superadmin'))
- return;
$this->setupSubPage();
if ($this->subPage !== false) {
@@ -213,10 +227,19 @@ class Page_DozMod extends Page
}
$action = Request::post('action');
+
if ($action === 'mail') {
- $this->handleTestMail();
+ if (User::hasPermission("mail.testmail")) {
+ $this->handleTestMail();
+ } else {
+ die('No permission');
+ }
} elseif ($action === 'delimages') {
- die($this->handleDeleteImages());
+ if (User::hasPermission("images.delete")) {
+ die($this->handleDeleteImages());
+ } else {
+ die('No permission');
+ }
} elseif ($action === 'getblockinfo') {
$this->ajaxGetBlockInfo();
}
@@ -328,8 +351,9 @@ class Page_DozMod extends Page
$params = [
'int' => [
- 'maxImageValidityDays' => array('min' => 7, 'max' => 999),
- 'maxLectureValidityDays' => array('min' => 7, 'max' => 999),
+ 'maxImageValidityDays' => array('min' => 7, 'max' => 9999),
+ 'maxLectureValidityDays' => array('min' => 7, 'max' => 9999),
+ 'maxLocationsPerLecture' => array('min' => 0, 'max' => 999),
'maxTransfers' => array('min' => 1, 'max' => 10),
],
'bool' => [