* * Last Modified: 4th March 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; // Add a slash as the selected file must be a directory $data["file"] = $data["file"] . $slash; $blocks = get_blocks(array("users"), $script_dir . "/settings/templates/lock.tpl"); if (file_exists($path . $slash .".htpasswd") == true) { $users = file($path . $slash . ".htpasswd"); // Import the file natcasesort($users); if ($users[0] != "") { // The password file already exists, so display the user list $user_list = array(); foreach ($users as $var) { $exploded = explode(":", $var); $user_list[] = trim($exploded[0]); } // Create the user list $users = dropdown($user_list, 0); } else { $blocks["users"] = ""; } } else { $blocks["users"] = ""; } $output = dyn_template($blocks, $script_dir . "/settings/templates/lock.tpl"); $javascript["cookie_temp"] = $cookie_temp; // Add the temp cookie name to the JS array // Finish up by outputting the completed page $lock = array("javascript" => template($javascript, $script_dir . "/settings/templates/javascript/lock.js"), "file" => preg_replace("/([\\][0-9]+)/", "\\\\$1", $data["file"]), "stats" => preg_replace("/%s/i", endtime($starttime), $misc["stats"]), "gzip" => preg_replace("/%g/i", $gzip, $misc["gzip"]), "charset" => $charset, "title" => $lock["title"], "main" => $scripts["main"], "copyright" => $copyright, "new" => $lock["new"], "user" => $lock["user"], "pass" => $lock["pass"], "close" => $lock["close"], "create" => $lock["create"], "existing" => $lock["existing"], "edit" => $lock["edit"], "delete" => $lock["delete"], "user_list" => $users, "dir" => str_replace("\\", "/", $dir), "filename" => $file); echo parse_dynamic($lock, $output); // We don't parse the global template for this window. ?>