]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-support.php
Fix for endless loop
[mailer.git] / inc / modules / member / what-support.php
index 1d2a0c4507a9492948af4ad86f056d9d9ceb30bc..a2cfff4929bbb88a4c30998cbca5ca0dd6be5d56 100644 (file)
@@ -17,7 +17,7 @@
  * 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 *
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
-       require($INC);
-}  elseif (!IS_MEMBER()){
-       redirectToUrl('modules.php?module=index');
-} elseif ((!EXT_IS_ACTIVE('support')) && (!IS_ADMIN())) {
-       addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('support'));
-       return;
+       die();
+}  elseif (!isMember()) {
+       redirectToIndexMemberOnlyModule();
 }
 
 // Add description as navigation point
-ADD_DESCR('member', __FILE__);
+addMenuDescription('member', __FILE__);
+
+if ((!isExtensionActive('support')) && (!isAdmin())) {
+       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('support'));
+       return;
+} // END - if
 
-if ((!isFormSent()) || (!REQUEST_ISSET_POST(('qsummary')))) {
+if ((!isFormSent()) || (!isPostRequestElementSet(('qsummary')))) {
        // Output form
-       LOAD_TEMPLATE('member_support_form');
+       loadTemplate('member_support_form');
 } else {
        // Load mail template based on your member's decision
-       if (GET_EXT_VERSION('admins') >= '0.4.1') {
-               $a_tpl = 'admin_support-' . REQUEST_POST('qsummary');
+       if (getExtensionVersion('admins') >= '0.4.1') {
+               $a_tpl = 'admin_support-' . postRequestElement('qsummary');
        } else {
-               $message_a = LOAD_EMAIL_TEMPLATE('admin_support-' . REQUEST_POST('qsummary'), array('text' => REQUEST_POST('qdetails')), getUserId());
+               $message_a = loadEmailTemplate('admin_support-' . postRequestElement('qsummary'), array('text' => postRequestElement('qdetails')), getUserId());
        }
-       $message_m = LOAD_EMAIL_TEMPLATE('member_support-' . REQUEST_POST('qsummary'), array('text' => REQUEST_POST('qdetails')), getUserId());
+       $message_m = loadEmailTemplate('member_support-' . postRequestElement('qsummary'), array('text' => postRequestElement('qdetails')), getUserId());
 
        // Select right subject
-       switch (REQUEST_POST('qsummary')) {
+       switch (postRequestElement('qsummary')) {
                case 'ordr':
                        $subj_a = getMessage('SUPPORT_SUBJ_ADMIN_ORDER');
                        $subj_m = getMessage('SUPPORT_SUBJ_MEMBER_ORDER');
@@ -81,16 +82,16 @@ if ((!isFormSent()) || (!REQUEST_ISSET_POST(('qsummary')))) {
        } // END - switch
 
        // Send mail to admin
-       sendAdminNotification($subj_a, $a_tpl, array('text' => REQUEST_POST('qdetails')), getUserId());
+       sendAdminNotification($subj_a, $a_tpl, array('text' => postRequestElement('qdetails')), getUserId());
 
        // Send mail to user
        sendEmail(getUserId(), $subj_m, $message_m);
 
        // Drop a message in the admin's area
-       createNewTask($subj_a, REQUEST_POST('qsummary') . ' : ' . REQUEST_POST('qdetails'), 'SUPPORT_MEMBER', getUserId());
+       createNewTask($subj_a, postRequestElement('qsummary') . ' : ' . postRequestElement('qdetails'), 'SUPPORT_MEMBER', getUserId());
 
        // Form sent
-       LOAD_TEMPLATE('member_support_contcted');
+       loadTemplate('member_support_contcted');
 }
 
 // [EOF]