getOwnerID() != $_SESSION['uid']) { header("Location: app.php?msg=no_permission"); die(); } if ($newnote && $SETTINGS['note_limit'] !== false && !(new User($_SESSION['uid']))->hasPermission($SETTINGS['unlimited_permission'])) { $notecount = $database->count("notes", ['ownerid' => $_SESSION['uid']]); if ($notecount >= $SETTINGS['note_limit']) { header("Location: app.php?msg=quota_reached"); } } $note->saveNote(); ?>