コード例 #1
0
ファイル: users.php プロジェクト: lavvy/openv
    if (!$a->CheckPermission('edit_permissions')) {
        echo '<center><b>You are not allowed to edit permissions.</b></center></body></html>';
        die;
    }
    $u->DropPermission($_GET['user'], $_GET['permission']);
    echo 'Permission &quot;' . $_GET['permission'] . '&quot; has been dropped for user &quot;' . $_GET['user'] . '&quot;<br><br>
	<a href="' . $_SERVER['PHP_SELF'] . '?do=edit_perm&user='******'user'] . '">Back to user\'s permissions</a>';
}
if ($_GET['do'] == 'add_permission') {
    if ($_GET['user'] == $_SESSION['login']) {
        echo '<center><b>You cannot edit yourself. Please use another account to edit yours.</b></center>';
        die;
    }
    if (!$a->CheckPermission('edit_permissions')) {
        echo '<center><b>You are not allowed to edit permissions.</b></center></body></html>';
        die;
    }
    if ($_GET['user'] == '') {
        die('No user given');
    }
    if ($_GET['permission'] == '') {
        die('No permission given');
    }
    $u->AddPermission($_GET['user'], $_GET['permission']);
    echo 'Permission &quot;' . $_GET['permission'] . '&quot; has been added for user &quot;' . $_GET['user'] . '&quot;<br><br>
	<a href="' . $_SERVER['PHP_SELF'] . '?do=edit_perm&user='******'user'] . '">Back to user\'s permissions</a>';
}
?>
</body>
</html>