admin.lib -

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
<?php < /* * Invision Power File Manager * Admin Code Library * Copyright (c) 2003 Invision Power Services * ------------------------------------- * You may not remove the copyright or * redistribute the script in any form * * Authors: Stephen Ball <[email protected]> * * Last Modified: 17th March 2003 * */ // Check the user is autherised to access the control panel function auth() { global $cookie_admin, $adminpass; if (param($cookie_admin, "COOKIE") != $adminpass) { // The username in the cookie is not the admin password redirect("admin/login.php"); } return true; } // Return a formatted message function msg($msg, $title = "User Error") { // Format the message and return it $data = "<table border=\"0\" width=\"85%\" bgcolor=\"#000000\" cellpadding=\"4\" cellspacing=\"1\">\r\n"; $data .= " <tr>\r\n"; $data .= " <th align=\"left\" bgcolor=\"#4682B4\" valign=\"middle\"><font size=\"2\" face=\"Verdana, Geneva, Arial, Helvetica, Sans- Serif\" color=\"#FFFFFF\">" . $title . "</font></th>\r\n"; $data .= " </tr>\r\n"; $data .= " <tr>\r\n"; $data .= " <td align=\"left\" bgcolor=\"#F5F5F5\" valign=\"middle\"><font size=\"1\" face=\"Verdana, Geneva, Arial, Helvetica, Sans- Serif\" color=\"#000000\">" . $msg . "</font></td>\r\n"; $data .= " </tr>\r\n"; $data .= "</table>\r\n"; return $data; } // Find the user function find_user($user) { global $scripts, $script_dir; $found = FALSE; $usercheck = file($script_dir . "/settings/" . $scripts["userlist"]);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
while(list(,$value) = each($usercheck)) { list($username, $password, $htpasswd, $changepass, $chmod, $upload, $rename, $edit, $delete, $copy, $move, $newfolder, $newfile, $overwrite, $compress, $mysql, $dbhost, $dbuser, $dbpass, $dbname, $root_url, $root_dir, $max_space, $lang) = split("[|]", $value); $ if ($username == $user) { $params["name"] = trim($username); $params["password"] = trim($password); $params["htpasswd"] = trim($htpasswd); $params["change"] = trim($changepass); $params["CHMOD"] = trim($chmod); $params["upload"] = trim($upload); $params["rename"] = trim($rename); $params["edit"] = trim($edit); $params["delete"] = trim($delete); $params["copy"] = trim($copy); $params["move"] = trim($move); $params["newfolder"] = trim($newfolder); $params["newfile"] = trim($newfile); $params["overwrite"] = trim($overwrite); $params["compress"] = trim($compress); $params["mysql"] = trim($mysql); $params["dbhost"] = trim($dbhost); $params["dbuser"] = trim($dbuser); $params["dbpass"] = trim($dbpass); $params["dbname"] = trim($dbname); $params["root"] = trim($root_dir); $params["root_url"] = trim($root_url); $params["space"] = trim($max_space); $params["lang"] = trim($lang); } } return $params; } // Create a checkbox with the correct value function checkbox($name, $value) { if ($value == 1) { return "<input type=\"checkbox\" name=\"" . $name . "\" value=\"1\" checked=\"checked\" />"; } else { return "<input type=\"checkbox\" name=\"" . $name . "\" value=\"1\" />"; } } // Builds the drop down list for the users size limit, selecting a suitible size
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/18/2011 for the course CSE 099 taught by Professor Hawkins during the Spring '11 term at N. Arizona.

Page1 / 13

admin.lib -

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online