summaryrefslogtreecommitdiff
path: root/contact.php
diff options
context:
space:
mode:
authorbitweaver.org <bitweaver@users.sourceforge.net>2005-06-19 04:56:31 +0000
committerbitweaver.org <bitweaver@users.sourceforge.net>2005-06-19 04:56:31 +0000
commitdb60c85506a212d5eae4ffc6eecf43ece2a9b7f9 (patch)
tree441c9f624e4d6dd5beb28ce677c4955f5811022b /contact.php
downloadmessages-db60c85506a212d5eae4ffc6eecf43ece2a9b7f9.tar.gz
messages-db60c85506a212d5eae4ffc6eecf43ece2a9b7f9.tar.bz2
messages-db60c85506a212d5eae4ffc6eecf43ece2a9b7f9.zip
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'contact.php')
-rw-r--r--contact.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/contact.php b/contact.php
new file mode 100644
index 0000000..7db2dfb
--- /dev/null
+++ b/contact.php
@@ -0,0 +1,62 @@
+<?php
+
+// $Header: /cvsroot/bitweaver/_bit_messages/contact.php,v 1.1 2005/06/19 04:56:31 bitweaver Exp $
+
+// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
+// All Rights Reserved. See copyright.txt for details and a complete list of authors.
+// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
+
+// Initialization
+require_once( '../bit_setup_inc.php' );
+
+include_once( MESSU_PKG_PATH.'messu_lib.php' );
+
+if (!$user) {
+ $smarty->assign('msg', tra("You are not logged in"));
+
+ $gBitSystem->display( 'error.tpl' );
+ die;
+}
+
+if ($feature_contact != 'y') {
+ $smarty->assign('msg', tra("This feature is disabled").": feature_contact");
+
+ $gBitSystem->display( 'error.tpl' );
+ die;
+}
+
+$gBitSystem->display( 'bitpackage:messu/contact.tpl');
+
+$email = $userlib->get_user_email($contact_user);
+$smarty->assign('email', $email);
+
+if ($user and $feature_messages == 'y' and $bit_p_messages == 'y') {
+ $smarty->assign('sent', 0);
+
+ if (isset($_REQUEST['send'])) {
+
+ $smarty->assign('sent', 1);
+
+ $message = '';
+
+ // Validation:
+ // must have a subject or body non-empty (or both)
+ if (empty($_REQUEST['subject']) && empty($_REQUEST['body'])) {
+ $smarty->assign('message', tra('ERROR: Either the subject or body must be non-empty'));
+
+ die;
+ }
+
+ $message = tra('Message sent to'). ':' . $contact_user . '<br/>';
+ $messulib->post_message($contact_user, $user, $_REQUEST['to'],
+ '', $_REQUEST['subject'], $_REQUEST['body'], $_REQUEST['priority']);
+
+ $smarty->assign('message', $message);
+ }
+}
+
+$smarty->assign('priority', 3);
+
+
+
+?>