<?php
/************************************************************************
- * MXChange v0.2.1 Start: 02/29/2004 *
- * ================ Last change: 04/23/2004 *
+ * Mailer v0.2.1-FINAL Start: 02/29/2004 *
+ * =================== Last change: 04/23/2004 *
* *
* -------------------------------------------------------------------- *
* File : what-support.php *
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Support kontaktieren *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
* -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
// Some security stuff...
if (!defined('__SECURITY')) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-} elseif (!IS_MEMBER()){
- LOAD_URL("modules.php?module=index");
-} elseif (!EXT_IS_ACTIVE("support")) {
- ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE, "support");
- return;
+ die();
+} elseif (!isMember()) {
+ redirectToIndexMemberOnlyModule();
}
// Add description as navigation point
-ADD_DESCR("member", basename(__FILE__));
+addYouAreHereLink('member', __FILE__);
-if ((!isset($_POST['ok'])) || (empty($_POST['qsummary'])))
-{
+if ((!isExtensionActive('support')) && (!isAdmin())) {
+ displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=support%}');
+ return;
+} // END - if
+
+if ((!isFormSent()) || (!isPostRequestElementSet('qsummary'))) {
// Output form
- LOAD_TEMPLATE("member_support_form");
-}
- else
-{
+ loadTemplate('member_support_form', false, getUserDataArray());
+} else {
// Load mail template based on your member's decision
- if (GET_EXT_VERSION("admins") >= "0.4.1") {
- $a_tpl = "admin_support-".$_POST['qsummary'];
+ if (isExtensionInstalledAndNewer('admins', '0.4.1')) {
+ $a_tpl = 'admin_support-' . postRequestElement('qsummary');
} else {
- $msg_a = LOAD_EMAIL_TEMPLATE("admin_support-".$_POST['qsummary'], $_POST['qdetails'], $GLOBALS['userid']);
+ $message_a = loadEmailTemplate('admin_support-' . postRequestElement('qsummary'), array('text' => postRequestElement('qdetails')), getMemberId());
}
- $msg_m = LOAD_EMAIL_TEMPLATE("member_support-".$_POST['qsummary'], $_POST['qdetails'], $GLOBALS['userid']);
+ $message_m = loadEmailTemplate('member_support-' . postRequestElement('qsummary'), array('text' => postRequestElement('qdetails')), getMemberId());
// Select right subject
- switch ($_POST['qsummary'])
- {
- case "ordr" : $subj_a = SUPPORT_SUBJ_ADMIN_ORDER; $subj_m = SUPPORT_SUBJ_MEMBER_ORDER; break;
- case "reflink" : $subj_a = SUPPORT_SUBJ_ADMIN_REFLINK; $subj_m = SUPPORT_SUBJ_MEMBER_REFLINK; break;
- case "unconfirmed": $subj_a = SUPPORT_SUBJ_ADMIN_UNCONFIRMED; $subj_m = SUPPORT_SUBJ_MEMBER_UNCONFIRMED; break;
- }
+ switch (postRequestElement('qsummary')) {
+ case 'ordr':
+ $subj_a = '{--ADMIN_SUPPORT_ORDER_SUBJECT--}';
+ $subj_m = '{--MEMBER_SUPPORT_ORDER_SUBJECT--}';
+ break;
+
+ case 'reflink':
+ $subj_a = '{--ADMIN_SUPPORT_REFERAL_LINK_SUBJECT--}';
+ $subj_m = '{--MEMBER_SUPPORT_REFERAL_LINK_SUBJECT--}';
+ break;
+
+ case 'unconfirmed':
+ $subj_a = '{--ADMIN_SUPPORT_UNCONFIRMED_SUBJECT--}';
+ $subj_m = '{--MEMBER_SUPPORT_UNCONFIRMED_SUBJECT--}';
+ break;
+ } // END - switch
// Send mail to admin
- SEND_ADMIN_NOTIFICATION($subj_a, $a_tpl, $_POST['qdetails'], $GLOBALS['userid']);
+ sendAdminNotification($subj_a, $a_tpl, array('text' => postRequestElement('qdetails')), getMemberId());
// Send mail to user
- SEND_EMAIL($GLOBALS['userid'], $subj_m, $msg_m);
+ sendEmail(getMemberId(), $subj_m, $message_m);
- // Drop a message in the admin's area
- $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_task_system (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','SUPPORT_MEMBER','%s','%s', UNIX_TIMESTAMP())",
- array($GLOBALS['userid'], addslashes($subj_a), addslashes($_POST['qsummary'].":".$_POST['qdetails'])), __FILE__, __LINE__);
+ // Drop a message in the admin's area (we ignore the task id here)
+ createNewTask($subj_a, postRequestElement('qsummary') . ' : ' . postRequestElement('qdetails'), 'MEMBER_SUPPORT', getMemberId());
// Form sent
- LOAD_TEMPLATE("member_support_contcted");
+ loadTemplate('member_support_contcted');
}
-//
+
+// [EOF]
?>