* * Last Modified: 22nd February 2003 * */ error_reporting(0); if (!(include("./modules/header.lib.php"))) { die("
There was an error loading the header module
"); } // Get the variables $file = param("f", "GET"); $dir = param("d", "GET"); // Clean the paths $file = cleanpath($file); $dir = cleanpath($dir); if (eregi("win", PHP_OS) == TRUE) { // Check for / in the URL even though the system is Windows (i.e. the user is using Opera) $dir = str_replace("/", "\\", $dir); } $path = $dir == "" ? $params["root"] . $file : $params["root"] . $dir . $slash . $file; // Parse some variables $data["file"] = $dir == "" ? $slash . $file : $slash . $dir . $slash . $file; if (is_dir($path) == TRUE) { // The user is CHMODding a directory so add a slash $data["file"] = $data["file"] . $slash; } $data["file1"] = $file; $data["dir"] = $dir; $data["main"] = $scripts["main"]; $data["invalid"] = $javascript["octal_error"]; $data["close"] = $chmod["close"]; $data["chmod"] = chmod_value($path); // Get the CHMOD "parts" $hund = substr($data["chmod"], 0, 1) . "00"; $tens = substr($data["chmod"], 1, 1) . "0"; $unit = substr($data["chmod"], 2, 1); $check_hund = array("700" => array("check1" => "", "check2" => "", "check3" => ""), "600" => array("check1" => "", "check2" => "", "check3" => ""), "500" => array("check1" => "", "check2" => "", "check3" => ""), "400" => array("check1" => "", "check2" => "", "check3" => ""), "300" => array("check1" => "", "check2" => "", "check3" => ""), "200" => array("check1" => "", "check2" => "", "check3" => ""), "100" => array("check1" => "", "check2" => "", "check3" => ""), "000" => array("check1" => "", "check2" => "", "check3" => "")); // Build an array of what to check for the possible hundred values $check_tens = array("70" => array("check4" => "", "check5" => "", "check6" => ""), "60" => array("check4" => "", "check5" => "", "check6" => ""), "50" => array("check4" => "", "check5" => "", "check6" => ""), "40" => array("check4" => "", "check5" => "", "check6" => ""), "30" => array("check4" => "", "check5" => "", "check6" => ""), "20" => array("check4" => "", "check5" => "", "check6" => ""), "10" => array("check4" => "", "check5" => "", "check6" => ""), "00" => array("check4" => "", "check5" => "", "check6" => "")); // Build an array of what to check for the possible ten values $check_unit = array("7" => array("check7" => "", "check8" => "", "check9" => ""), "6" => array("check7" => "", "check8" => "", "check9" => ""), "5" => array("check7" => "", "check8" => "", "check9" => ""), "4" => array("check7" => "", "check8" => "", "check9" => ""), "3" => array("check7" => "", "check8" => "", "check9" => ""), "2" => array("check7" => "", "check8" => "", "check9" => ""), "1" => array("check7" => "", "check8" => "", "check9" => ""), "0" => array("check7" => "", "check8" => "", "check9" => "")); // Build an array of what to check for the possible unit values // Populate the "read" check boxes foreach($check_hund as $key => $var) { if ($key == $hund) { $data["check1"] = $var["check1"]; $data["check2"] = $var["check2"]; $data["check3"] = $var["check3"]; break; // No need to check anymore } } // Populate the "write" check boxes foreach($check_tens as $key => $var) { if ($key == $tens) { $data["check4"] = $var["check4"]; $data["check5"] = $var["check5"]; $data["check6"] = $var["check6"]; break; // No need to check anymore } } // Populate the "execute" check boxes foreach($check_unit as $key => $var) { if ($key == $unit) { $data["check7"] = $var["check7"]; $data["check8"] = $var["check8"]; $data["check9"] = $var["check9"]; break; // No need to check anymore } } // Parse the language pack foreach($chmod as $key => $var) { $data[$key] = $var; } // Finish up by outputting the completed page $javascript["main"] = $scripts["main"]; $data["javascript"] = template($javascript, $script_dir . "/settings/templates/javascript/chmod.js"); $data["charset"] = $charset; $data["gzip"] = preg_replace("/%g/i", $gzip, $misc["gzip"]); $data["copyright"] = $copyright; $data["stats"] = preg_replace("/%s/i", endtime($starttime), $misc["stats"]); echo template($data, $script_dir . "/settings/templates/chmod.tpl"); // We don't parse the global template for this window. ?>