1
0

Danish translations by Henrick Schack

This commit is contained in:
Garvin Hicking
2006-11-02 11:26:10 +00:00
parent 1b1991a697
commit 4bf4baa47e
7 changed files with 733 additions and 463 deletions

View File

@ -3299,3 +3299,41 @@ function &serendipity_getMediaPaths() {
return $paths;
}
/**
* Checks whether a user has access to write into a directory
*
* @access public
* @param string Directory to check
* @return boolean
*/
function serendipity_checkDirUpload($dir) {
global $serendipity;
/*
if (serendipity_checkPermission('adminImagesMaintainOthers')) {
return true;
}
*/
$allowed = serendipity_ACLGet(0, 'directory', 'write', $dir);
$mygroups = serendipity_checkPermission(null, null, true);
// Usergroup "0" always means that access is granted. If no array exists, no ACL restrictions have been set and all is fine.
if (!is_array($allowed) || isset($allowed[0])) {
return true;
}
if (!is_array($mygroups)) {
return true;
}
foreach($mygroups AS $grpid => $grp) {
if (isset($allowed[$grpid])) {
return true;
break;
}
}
return false;
}