X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=inc%2Fmodules%2Fadmin%2Fwhat-edit_user.php;h=f3d58632667a2c336cc8e16451ad628f085e7f56;hb=5bdeaf8b452206598b6c6cd4f941145b11a0eccc;hp=657f1273ba686de79e35152305034497e23a86f4;hpb=75ad748a68473ace540251427a74fb781b1145e9;p=mailer.git diff --git a/inc/modules/admin/what-edit_user.php b/inc/modules/admin/what-edit_user.php index 657f1273ba..f3d5863266 100644 --- a/inc/modules/admin/what-edit_user.php +++ b/inc/modules/admin/what-edit_user.php @@ -32,22 +32,23 @@ ************************************************************************/ // Some security stuff... -if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) -{ +if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } -// Add description as navigation point -ADD_DESCR("admin", basename(__FILE__)); -OPEN_TABLE("100%", "admin_content admin_content_align", ""); +// Add description as navigation point +ADD_DESCR("admin", __FILE__); // Fix a notice $result_main = false; if (isset($_GET['u_id'])) { // 0 1 2 3 4 5 6 7 8 9 10 11 - $result_main = SQL_QUERY_ESC("SELECT sex, surname, family, street_nr, zip, city, country, email, birth_day, birth_month, birth_year, max_mails FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1", - array(bigintval($_GET['u_id'])), __FILE__, __LINE__); + $result_main = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, zip, city, country, email, birth_day, birth_month, birth_year, max_mails +FROM `{!_MYSQL_PREFIX!}_user_data` +WHERE userid=%s +LIMIT 1", + array(bigintval($_GET['u_id'])), __FILE__, __LINE__); } if ((SQL_NUMROWS($result_main) == 1) || (empty($_GET['u_id']))) @@ -76,19 +77,19 @@ if ((SQL_NUMROWS($result_main) == 1) || (empty($_GET['u_id']))) if ($PASS) { // We have to add the following things: birthday and max receive mails - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET -sex='%s', + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET +gender='%s', surname='%s', family='%s', street_nr='%s', country='%s', -zip=%d, +zip=%s, city='%s', email='%s' ".$ADD." -WHERE userid=%d LIMIT 1", +WHERE userid=%s LIMIT 1", array( - substr($_POST['salut'], 0, 1), + substr($_POST['gender'], 0, 1), $_POST['surname'], $_POST['family_name'], $_POST['street_nr'], @@ -112,28 +113,28 @@ WHERE userid=%d LIMIT 1", else { // Display form to edit - list($sex, $surname, $family, $street, $zip, $city, $country, $email, $bday, $bmonth, $byear, $max) = SQL_FETCHROW($result_main); + list($gender, $surname, $family, $street, $zip, $city, $country, $email, $bday, $bmonth, $byear, $max) = SQL_FETCHROW($result_main); SQL_FREERESULT($result_main); // Transfer data to constants for the template - switch ($sex) + switch ($gender) { case "M": - define('_SEX_M', " selected=\"selected\""); - define('_SEX_F', ""); - define('_SEX_C', ""); + define('_GENDER_M', " selected=\"selected\""); + define('_GENDER_F', ""); + define('_GENDER_C', ""); break; case "F": - define('_SEX_M', ""); - define('_SEX_F', " selected=\"selected\""); - define('_SEX_C', ""); + define('_GENDER_M', ""); + define('_GENDER_F', " selected=\"selected\""); + define('_GENDER_C', ""); break; case "C": - define('_SEX_M', ""); - define('_SEX_F', ""); - define('_SEX_C', " selected=\"selected\""); + define('_GENDER_M', ""); + define('_GENDER_F', ""); + define('_GENDER_C', " selected=\"selected\""); break; } @@ -148,8 +149,8 @@ WHERE userid=%d LIMIT 1", else { // Account does not exists! - OUTPUT_HTML ("".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2.""); + LOAD_TEMPLATE("admin_settings_saved", false, "
".ADMIN_MEMBER_404_1.$_GET['u_id'].ADMIN_MEMBER_404_2."
"); } -CLOSE_TABLE(); + // ?>