X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-html_mail.php;h=a558191a21fd5be8facb90227895448c2aa7e0e2;hp=0fe44b6a964cff0751d0ee4fdcd58e86eca71d23;hb=916bba4f00ee924f0d88b8fc273dee5bfb798aed;hpb=8383fc52cd2340ea1756f9e1808fa3589e27c341 diff --git a/inc/modules/member/what-html_mail.php b/inc/modules/member/what-html_mail.php index 0fe44b6a96..a558191a21 100644 --- a/inc/modules/member/what-html_mail.php +++ b/inc/modules/member/what-html_mail.php @@ -10,9 +10,14 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : HTML-Mails * * -------------------------------------------------------------------- * - * * + * $Revision:: $ * + * $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 - 2008 by Roland Haeder * + * Copyright (c) 2003 - 2009 by Roland Haeder * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -32,51 +37,41 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) -{ - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; - require($INC); -} - elseif (!IS_LOGGED_IN()) -{ - LOAD_URL("modules.php?module=index"); -} - elseif ((!EXT_IS_ACTIVE("html_mail")) && (!IS_ADMIN())) -{ - ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "html_mail"); - return; +if (!defined('__SECURITY')) { + die(); +} elseif (!isMember()) { + redirectToIndexMemberOnlyModule(); } // Add description as navigation point -ADD_DESCR("member", basename(__FILE__)); +addMenuDescription('member', __FILE__); + +if ((!isExtensionActive('html_mail')) && (!isAdmin())) { + loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('html_mail')); + return; +} // END - if // Class was found and loaded -if (isset($_POST['ok'])) -{ +if (isFormSent()) { // Save settings - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET html='%s' WHERE userid=%d LIMIT 1", - array($_POST['html'], $GLOBALS['userid']), __FILE__, __LINE__); - LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_SETTINGS_SAVED); -} - else -{ + SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `html`='%s' WHERE `userid`=%s LIMIT 1", + array(postRequestElement('html'), getMemberId()), __FILE__, __LINE__); + loadTemplate('admin_settings_saved', false, getMessage('MEMBER_SETTINGS_SAVED')); +} else { // Load template for changing settings - $result = SQL_QUERY_ESC("SELECT html FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1", - array($GLOBALS['userid']), __FILE__, __LINE__); - list($mode) = SQL_FETCHROW($result); - SQL_FREERESULT($result); + if (!fetchUserData(getMemberId())) { + // Something really bad happened + debug_report_bug('No user account ' . getMemberId() . ' found.'); + } // END - if - if ($mode == 'Y') - { - define('HTML_Y', ' checked'); - define('HTML_N', ""); - } - else - { - define('HTML_N', ' checked'); - define('HTML_Y', ""); - } - LOAD_TEMPLATE("member_html_mail_settings"); + // Prepare it + $content['html_y'] = ''; + $content['html_n'] = ''; + $content['html_' . strtolower(getUserData('html'))] = ' checked="checked"'; + + // Load main template + loadTemplate('member_html_mail_settings', false, $content); } -// + +// [EOF] ?>