function deleteImage($id) { $id = secureInput($id); //look up old image path and remove image from image folder $sql = "SELECT thumb_path,img_path FROM users WHERE id = '" . $id . "'"; $res = mysql_query($sql); $row = mysql_fetch_assoc($res); $del = $row["thumb_path"]; $delg = $row["img_path"]; if (!empty($del)) { $dir = pathinfo($del, PATHINFO_DIRNAME); $ext = pathinfo($del, PATHINFO_EXTENSION); $base = pathinfo($del, PATHINFO_FILENAME); $base_path = "{$dir}/{$base}"; unlink("{$base_path}" . "." . "{$ext}"); } if (!empty($delg)) { $dirg = pathinfo($delg, PATHINFO_DIRNAME); $extg = pathinfo($delg, PATHINFO_EXTENSION); $baseg = pathinfo($delg, PATHINFO_FILENAME); $gbase_path = "{$dirg}/{$baseg}"; unlink("{$gbase_path}" . "." . "{$extg}"); } $sql = "UPDATE users SET thumb_path = '', img_path = '' WHERE id = '" . $id . "'"; $res = mysql_query($sql); if ($res) { return 99; } else { return 1; } }
DEFINE('INCLUDE_CHECK', 1); require_once '../lib/connections/db.php'; include '../lib/functions/functions.php'; checkLogin('1'); $id = 0; if (isset($_GET['id'])) { if (is_numeric($_GET['id'])) { $id = strip_tags($_GET['id']); $id = secureInput($_GET['id']); } } $action = ""; if (isset($_GET['action'])) { $action = strip_tags($_GET['action']); $action = secureInput($_GET['action']); } if ($action == "suspend") { $res = suspendUser($id); if ($res == 1) { header("Location: manage_users.php?error=An error occured while attempting to suspend user. Please try again."); } if ($res == 2) { header("Location: manage_users.php?error=An error occured selecting user to suspend."); } if ($res == 99) { header("Location: manage_users.php?message=User suspended."); } } if ($action == "unsuspend") { $res = unsuspendUser($id);
<?php require_once '../lib/connections/db.php'; include '../lib/functions/functions.php'; checkLogin('1'); $id = 0; if (isset($_GET['id'])) { if (is_numeric($_GET['id'])) { $id = strip_tags($_GET['id']); $id = secureInput($_GET['id']); } } $getuser = getUserRecords($id); ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Change User Password</title> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <meta name="robots" content="index, follow" /> <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> <link rel="stylesheet" type="text/css" href="../css/style.css" media="screen" /> <script type="text/javascript" src="../js/jquery-1.6.2.js"></script> <script type="text/javascript" src="../js/script.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#updatepassForm').submit(function(e) {
$maxPOI = secureInput($_GET['maxPOI']); } else { $maxPOI = 10; } if (isset($_GET['lg'])) { $language = secureInput($_GET['lg']); } else { $language = 'en'; } if (isset($_GET['displayImg'])) { $displayImg = secureInput($_GET['displayImg']); } else { $displayImg = 0; } if (isset($_GET['wikivoyage'])) { $wikivoyageSupport = secureInput($_GET['wikivoyage']); } else { $wikivoyageSupport = 0; } //============> INFO SECTION $output['infos']['source'] = "WikiJourney API"; $output['infos']['link'] = "http://wikijourney.eu/"; $output['infos']['api_version'] = "alpha 0.0.4"; //============> INFO POINT OF INTEREST & WIKIVOYAGE GUIDES if (!isset($error)) { // ==================================> Put in the output the user location (can be useful) $output['user_location']['latitude'] = $user_latitude; $output['user_location']['longitude'] = $user_longitude; // ==================================> Wikivoyage requests : find travel guides around if ($wikivoyageSupport == 1) { if ($displayImg == 1) {
<?php DEFINE('INCLUDE_CHECK', 1); require_once 'lib/connections/db.php'; include 'lib/functions/functions.php'; $id = ''; if (isset($_GET['id'])) { if (is_numeric($_GET['id'])) { $id = secureInput($_GET['id']); } } $new = ''; if (isset($_GET['new'])) { $new = secureInput($_GET['new']); } $res = confirm_pass($id, $new); if ($res == 1) { $error = "Unable to update new password. Please contact the site admin."; } if ($res == 2) { $error = "The new password is already confirmed or is incorrect!"; } if ($res == 3) { $error = "This user does not exist."; } if ($res == 99) { $message = "Your new password has been confirmed. You may <a href='login.php'>login</a> using it."; } $sitesettings = getSiteSettings(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
$language = secureInput($_GET['lg']); } else { $language = 'en'; } if (isset($_GET['displayImg'])) { $displayImg = secureInput($_GET['displayImg']); } else { $displayImg = 0; } if (isset($_GET['wikivoyage'])) { $wikivoyageSupport = secureInput($_GET['wikivoyage']); } else { $wikivoyageSupport = 0; } if (isset($_GET['thumbnailWidth'])) { $thumbnailWidth = secureInput($_GET['thumbnailWidth']); } else { $thumbnailWidth = 500; } if (!(is_numeric($range) && is_numeric($maxPOI) && is_numeric($thumbnailWidth))) { $error = "Error : maxPOI, thumbnailWidth and range should be numeric values."; } } //============> INFO POINT OF INTEREST & WIKIVOYAGE GUIDES if (!isset($error)) { // ==================================> Put in the output the user location (can be useful) $output['user_location']['latitude'] = floatval($user_latitude); $output['user_location']['longitude'] = floatval($user_longitude); // ==================================> Wikivoyage requests : find travel guides around if ($wikivoyageSupport == 1) { if ($displayImg == 1) {