Example #1
0
function listACLsByPath($pathname)
{
    $me = $_SERVER["PHP_SELF"];
    if (!canEdit($pathname)) {
        echo "Ihnen fehlt leider die Berechtigung, das Verzeichnis {$pathname} zu bearbeiten";
        return false;
    }
    // Verzeichnisobjekt holen
    $path = new Path();
    if (!$path->selectByName($pathname)) {
        fehlerausgabe("Das Verzeichnis {$pathname} konnte nicht aus der DB gewählt werden");
        return false;
    }
    // ACLs fuer das Verzeichnis holen
    $acllist = new ACLList();
    if (!$acllist->selectByPath($pathname)) {
        fehlerausgabe("Die zum Verzeichnis {$pathname} gehörigen ACLs konnten nicht aus der DB gewählt werden");
        return false;
    }
    echo "ACLs für Pfad {$pathname}:";
    echo <<<EOF
<form name="acleditor" method="post" action="{$me}">
<select name="cmd">
    <option value="edit">Eine ACL bearbeiten</option>
    <option value="del">L&ouml;schen</option>
</select>
<input type="hidden" name="pathname" value="{$pathname}" />
<input type="submit" value="Los" />
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed">
    <tr>
        <td>User</td>
        <td>L&ouml;schen</td>
        <td>Schreiben</td>
        <td>Lesen</td>
        <td>Umbenennen</td>
    </tr>
EOF;
    $user = new User();
    for ($i = 0; $i < count($acllist->list); $i++) {
        $acl = $acllist->list[$i];
        $user->selectByID($acl->user_id);
        echo <<<EOF
<tr>
    <td><input type="checkbox" name="aclid[]" value="{$acl->acl_id}" />{$user->loginname}</td>
    <td>{$acl->delete_path}</td>
    <td>{$acl->write_path}</td>
    <td>{$acl->read_path}</td>
    <td>{$acl->rename_path}</td>
</tr>
EOF;
    }
    echo <<<EOF
</table>
</form>
EOF;
    return true;
}