2 /************************************************************************
3 * MXChange v0.2.1 Start: 06/19/2004 *
4 * ================ Last change: 06/19/2004 *
6 * -------------------------------------------------------------------- *
7 * File : what-admins_contact.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Contact an admin through mail or message *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Admin per Mail oder Nachricht kontaktieren *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN()))
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
40 // Add description as navigation point
41 ADD_DESCR("admin", basename(__FILE__));
43 if (($_POST['ok'] != '') && ($_GET['admin'] != ''))
45 // Send mail or message
46 if ((EXT_IS_ACTIVE("msg")) && ($_POST['type'] == "msg"))
49 $msg = LOAD_EMAIL_TEMPLATE("admins_msg_contact_admin", $_POST['text'], "0");
50 SEND_ADMIN_MESSAGE($_GET['admin'], ADMINS_MSG_FROM_ADMIN, $msg);
55 $result = SQL_QUERY("SELECT email FROM "._MYSQL_PREFIX."_admins WHERE id='".$_GET['admin']."' LIMIT 1", __FILE__, __LINE__);
56 list($email) = SQL_FETCHROW($result);
57 $msg = LOAD_EMAIL_TEMPLATE("admins_mail_contact_admin", $_POST['text'], "0");
58 SEND_EMAIL($email, ADMINS_MSG_FROM_ADMIN, $msg);
60 // Mail / message dropped
61 LOAD_TEMPLATE("admin_settings_saved", false, ADMINS_ADMIN_CONTACTED);
63 elseif ($_GET['admin'] != '')
65 // Load contact form template
66 define('__ADMIN', $_GET['admin']);
67 if (EXT_IS_ACTIVE("msg"))
69 // Add option to select between mail and message
70 define('ADMINS_MESSAGING_SELECTION', "<TR>
71 <TD colspan=\"3\" align=\"center\" class=\"admin_title bottom2\" height=\"28\">".ADMINS_SELECT_CONTACT_TYPE."</TD>
73 <TR><TD colspan=\"3\" class=\"seperator\"> </TD></TR>
75 <TD align=\"right\"><INPUT type=\"radio\" name=\"type\" class=\"admin_normal\" value=\"mail\" checked> ".ADMINS_CONTACT_TYPE_MAIL."</TD>
76 <TD width=\"10\" class=\"seperator\"> </TD>
77 <TD><INPUT type=\"radio\" name=\"type\" class=\"admin_normal\" value=\"msg\"> ".ADMINS_CONTACT_TYPE_MSG."</TD>
82 // Outout hidden input
83 define('ADMINS_MESSAGING_SELECTION', "<TR>
84 <TD colspan=\"3\" align=\"center\" class=\"admin_title bottom2\" height=\"28\">
85 ".ADMINS_CONTACT_DEFAULT_MAIL."
86 <INPUT type=\"hidden\" name=\"type\" value=\"mail\">
90 LOAD_TEMPLATE("admin_admins_contact_form");
94 // Please select an admin!
95 LOAD_TEMPLATE("admin_settings_saved", false, ADMINS_SELECT_ADMIN);