Archived
1
0

Changes of the last few months including restructuring system from using only ranks to permissions

This commit is contained in:
Marcel
2018-12-26 18:19:28 +01:00
parent 72f3434803
commit 1a1ac17ecf
38 changed files with 845 additions and 361 deletions

View File

@@ -499,14 +499,17 @@ class User extends MY_Controller
$_SESSION['profileEditNotification'] .= "<div class='alert alert-danger' role='alert'><b>Bitte gib dein Passwort ein!</b> Das Ändern der E-Mail-Adresse ist ein tiefgreifender Eingriff in den Account. Daher benötigen wir zur Sicherheit nochmal dein Passwort.</div>";
}
}
// Notifications
if (isset($_POST['email-notifications'])) {
$newData['receiveEmails'] = filter_var($_POST['email-notifications'], FILTER_VALIDATE_BOOLEAN);
}
// Newsletter
if (isset($_POST['newsletter'])) {
$newData['receiveNewsletter'] = filter_var($_POST['newsletter'], FILTER_VALIDATE_BOOLEAN);
}
// Password
if (isset($_POST['passwordNew'])) {
if (isset($_POST['passwordOld'])) {
@@ -536,7 +539,7 @@ class User extends MY_Controller
}
}
if (isset($_POST['showAds'])) {
if (isset($_SESSION['user']) && $_SESSION['user']['rank'] >= 2) {
if ($this->hasPermission('user.disableAds')) {
$newData['showAds'] = filter_var($_POST['email-notifications'], FILTER_VALIDATE_BOOLEAN);
} else {
$_SESSION['profileEditNotification'] .= "<div class='alert alert-danger' role='alert'><b>Du bist dazu nicht berechtigt!</b> Um diese Einstellung zu verändern, musst du mindestens ein Premium-Nutzer oder höher sein!</div>";