[Web] Start work on ACL; [Helper] Nextcloud helper script
This commit is contained in:
1 parent
988978b351
commit
db5a3ae47f
6 files changed
+53
-10
No files matched your search
@@ -244,6 +244,23 @@ function set_acl() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function get_acl($username) {
|
||||
global $pdo;
|
||||
if ($_SESSION['mailcow_cc_role'] != "admin") {
|
||||
return false;
|
||||
}
|
||||
$username = strtolower(trim($username));
|
||||
$stmt = $pdo->prepare("SELECT * FROM `user_acl` WHERE `username` = :username");
|
||||
$stmt->execute(array(':username' => $username));
|
||||
$acl = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
unset($acl['username']);
|
||||
if (!empty($acl)) {
|
||||
return $acl;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function formatBytes($size, $precision = 2) {
|
||||
if(!is_numeric($size)) {
|
||||
return "0";
|
||||
|
||||
Reference in new issue
Block a user