X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-mydata.php;h=a805b179bc13d439212c642f1754fb4adafe426b;hb=7cfec287d338c5b3af01b1a79881302505b3a795;hp=4f5d1142d61d6d594234d42aa934f2de2328a717;hpb=57227d33e870ec5cd271209c4a978a52b45c2dd6;p=mailer.git diff --git a/inc/modules/member/what-mydata.php b/inc/modules/member/what-mydata.php index 4f5d1142d6..a805b179bc 100644 --- a/inc/modules/member/what-mydata.php +++ b/inc/modules/member/what-mydata.php @@ -14,10 +14,9 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * + * Copyright (c) 2009, 2010 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -52,17 +51,15 @@ if ((!isExtensionActive('mydata')) && (!isAdmin())) { } // END - if // Add userid -$content = array( - 'userid' => getMemberId() -); +$content = array(); // Init variable to prevent notices -$URL = ''; +$url = ''; // Detect what the member wants to do $mode = 'show'; // Show his data if (isPostRequestParameterSet('save')) $mode = 'save'; // Save entered data -if (isPostRequestParameterSet('edit')) $mode = 'edit'; // Edit data +if (isFormSent('edit')) $mode = 'edit'; // Edit data if (isPostRequestParameterSet('notify')) $mode = 'notify'; // Switch off notification switch ($mode) { @@ -71,13 +68,12 @@ switch ($mode) { $content = merge_array($content, getUserDataArray()); // Translate some things - $content['gender'] = translateGender($content['gender']); $content['last_update'] = generateDateTime($content['last_update'], 0); // How far is last change on his profile away from now? if ((($content['last_update'] + getConfig('profile_lock')) > time()) && (!isAdmin()) && (getConfig('profile_lock') > 0)) { // You cannot change your account - $content['change'] = loadTemplate('admin_settings_saved', true, '
' . getMaskedMessage('MEMBER_PROFILE_LOCKED', generateDateTime($content['last_update'] + getConfig('profile_lock'), 0)) . '
'); + $content['change'] = loadTemplate('admin_settings_saved', true, '
' . getMaskedMessage('MEMBER_PROFILE_LOCKED', generateDateTime($content['last_update'] + getConfig('profile_lock'), 0)) . '
'); } else { // He is allowed to change his profile $content['change'] = loadTemplate('member_mydata_button', true); @@ -172,15 +168,15 @@ LIMIT 1", if (isExtensionActive('country')) { // Generate selection box - $OUT = "'; $whereStatement = "WHERE `is_active`='Y'"; if (isAdmin()) $whereStatement = ''; $OUT .= generateOptionList('countries', 'id', 'descr', $content['country_code'], 'code', $whereStatement); - $OUT .= ""; + $OUT .= ''; $content['country'] = $OUT; } else { // Ouput default input box - $content['country'] = ''; + $content['country'] = ''; } // Load template @@ -203,7 +199,7 @@ LIMIT 1", loadTemplate('admin_settings_saved', false, $content['update_check']); } elseif ((!isEmailValid(postRequestParameter('email'))) && (!isAdmin())) { // Invalid email address! - loadTemplate('admin_settings_saved', false, getMessage('INVALID_EMAIL_ENTERED')); + loadTemplate('admin_settings_saved', false, '{--INVALID_EMAIL_ENTERED--}'); } else { // Generate hash $hash = generateHash(postRequestParameter('pass1'), substr($content['password'], 0, -40)); @@ -215,7 +211,7 @@ LIMIT 1", // Did the user changed the password? if ($hash != $content['password']) { $AND = ", `password`='" . $hash . "'"; - $mode = 'pass'; + $mode = 'password'; } // END - if // Or did he changed his password? @@ -305,11 +301,11 @@ LIMIT 1", sendModeMails ('mydata', $modes); } else { // Something went wrong - loadTemplate('admin_settings_saved', false, getMessage('MEMBER_UPDATE_FAILED')); + loadTemplate('admin_settings_saved', false, '{--MEMBER_UPDATE_FAILED--}'); } } else { // Entered wrong pass for updating profile - loadTemplate('admin_settings_saved', false, getMessage('MEBER_UPDATE_PWD_WRONG')); + loadTemplate('admin_settings_saved', false, '{--MEBER_UPDATE_PWD_WRONG--}'); } } break; @@ -317,13 +313,13 @@ LIMIT 1", case 'notify': // Switch off notfication SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `notified`='N', `last_update`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1", array(getMemberId()), __FILE__, __LINE__); - $URL = 'modules.php?module=login&what=welcome&code=' . urlencode(getMessage('PROFILE_UPDATED')); + $url = 'modules.php?module=login&what=mydata&code=' . getCode('PROFILE_UPDATED'); break; } // END - switch -if (!empty($URL)) { +if (!empty($url)) { // Load generated URL - redirectToUrl($URL); + redirectToUrl($url); } // END - if // [EOF]