Ejemplo n.º 1
0
function chmod_return_only()
{
    unset($_GET["chmod_return_only"]);
    while (list($num, $ligne) = each($_GET)) {
        if ($ligne == 0) {
            $_GET["{$num}"] = "-";
        }
    }
    reset($_GET);
    if ($_GET["chmod_owner_read"] == 1) {
        $_GET["chmod_owner_read"] = "r";
    }
    if ($_GET["chmod_owner_write"] == 1) {
        $_GET["chmod_owner_write"] = "w";
    }
    if ($_GET["chmod_owner_execute"] == 1) {
        $_GET["chmod_owner_execute"] = "x";
    }
    if ($_GET["chmod_group_read"] == 1) {
        $_GET["chmod_group_read"] = "r";
    }
    if ($_GET["chmod_group_write"] == 1) {
        $_GET["chmod_group_write"] = "w";
    }
    if ($_GET["chmod_group_execute"] == 1) {
        $_GET["chmod_group_execute"] = "x";
    }
    if ($_GET["chmod_public_read"] == 1) {
        $_GET["chmod_public_read"] = "r";
    }
    if ($_GET["chmod_public_write"] == 1) {
        $_GET["chmod_public_write"] = "w";
    }
    if ($_GET["chmod_public_execute"] == 1) {
        $_GET["chmod_public_execute"] = "x";
    }
    $acl = new aclsdirs();
    $wxstr = "{$_GET["chmod_owner_read"]}{$_GET["chmod_owner_write"]}{$_GET["chmod_owner_execute"]}";
    $wxstr = $wxstr . "{$_GET["chmod_group_read"]}{$_GET["chmod_group_write"]}{$_GET["chmod_group_execute"]}";
    $wxstr = $wxstr . "{$_GET["chmod_public_read"]}{$_GET["chmod_public_write"]}{$_GET["chmod_public_execute"]}";
    echo "{$wxstr} | " . $acl->ModeRWX2Octal($wxstr);
}