die_with_msg($message); } else { list($width, $height) = getimagesize($new_file_path); if ($width > $config['member_pic_maxwidth'] || $width < $config['member_pic_minwidth'] || $height > $config['member_pic_maxheight'] || $height < $config['member_pic_minheight']) { $proceed = false; $color = '#DD0000'; $show_notification = 1; $message = $config['file_dimensions_error']; unset($_SESSION['security_token']); $security_token = randomcode(); $_SESSION['security_token'] = $security_token; //////////////////////////////////////////////////////////////// $capture = true; admin_msg($_SESSION['user_id']); $file_contents = 'Avatar upload error - width or height error - check 5' . "\n" . 'USER_ID ' . $_SESSION['user_id'] . "\n" . $use_date . "\n" . '=================================================================' . "\n"; write_debug_log($file_contents); //////////////////////////////////////////////////////////////// // keep image to look at //@unlink($new_file_path); die_with_msg($message); } } $sql = "SELECT * FROM pictures WHERE user_id = {$user_id}"; $result = @mysql_query($sql); // delete member avatar if they have one already if (@mysql_num_rows($result) != 0) { $result = @mysql_fetch_array($result); $existing_file = $result['file_name']; $filepath = installation_paths(); $filepath = $filepath . '/pictures/' . $existing_file; @unlink($filepath);
function ep_query($query) { global $ep_debug_logging; global $ep_debug_logging_all; global $ep_stack_sql_error; $result = mysql_query($query); if (mysql_errno()) { $ep_stack_sql_error = true; if ($ep_debug_logging == true) { // langer - will add time & date.. $string = "MySQL error " . mysql_errno() . ": " . mysql_error() . "\nWhen executing:\n{$query}\n"; write_debug_log($string); } } elseif ($ep_debug_logging_all == true) { $string = "MySQL PASSED\nWhen executing:\n{$query}\n"; write_debug_log($string); } return $result; }
* this is a rudimentary date integrity check for references to any non-existant product_id entries * this check ought to be last, so it checks the tasks just performed as a quality check of EP... * langer - to add: data present in table products, but not in descriptions.. user will need product info, and decide to add description, or delete product */ if ($_GET['dross'] == 'delete') { // let's delete data debris as requested... ep_purge_dross(); // now check it is really gone... $dross = ep_get_dross(); if (zen_not_null($dross)) { $string = "Product debris corresponding to the following product_id(s) cannot be deleted by EasyPopulate:\n"; foreach ($dross as $products_id => $langer) { $string .= $products_id . "\n"; } $string .= "It is recommended that you delete this corrupted data using phpMyAdmin.\n\n"; write_debug_log($string); $messageStack->add(EASYPOPULATE_MSGSTACK_DROSS_DELETE_FAIL, 'caution'); } else { $messageStack->add(EASYPOPULATE_MSGSTACK_DROSS_DELETE_SUCCESS, 'success'); } } else { // elseif ($_GET['dross'] == 'check') // we can choose a config option: check always, or only on clicking a button // default action when not deleting existing debris is to check for it and alert when discovered.. $dross = ep_get_dross(); if (zen_not_null($dross)) { $messageStack->add(sprintf(EASYPOPULATE_MSGSTACK_DROSS_DETECTED, count($dross), zen_href_link(FILENAME_EASYPOPULATE, 'dross=delete')), 'caution'); } } /** * Changes planned for below
function ep_4_remove_product($product_model) { global $db, $ep_debug_logging, $ep_debug_logging_all, $ep_stack_sql_error; $project = PROJECT_VERSION_MAJOR . '.' . PROJECT_VERSION_MINOR; $ep_uses_mysqli = PROJECT_VERSION_MAJOR > '1' || PROJECT_VERSION_MINOR >= '5.3' ? true : false; $sql = "SELECT products_id FROM " . TABLE_PRODUCTS . " WHERE products_model = '" . zen_db_input($product_model) . "'"; $products = $db->Execute($sql); if ($ep_uses_mysqli ? mysqli_errno($db->link) : mysql_errno()) { $ep_stack_sql_error = true; if ($ep_debug_logging == true) { $string = "MySQL error " . ($ep_uses_mysqli ? mysqli_errno($db->link) : mysql_errno()) . ": " . ($ep_uses_mysqli ? mysqli_error($db->link) : mysql_error()) . "\nWhen executing:\n{$sql}\n"; write_debug_log($string); } } elseif ($ep_debug_logging_all == true) { $string = "MySQL PASSED\nWhen executing:\n{$sql}\n"; write_debug_log($string); } while (!$products->EOF) { zen_remove_product($products->fields['products_id']); $products->MoveNext(); } return; }