<commit_before><?php

// $Header: /cvsroot/tikiwiki/tiki/tiki-contact.php,v 1.25.2.3 2008-02-06 14:06:18 sylvieg Exp $

// Copyright (c) 2002-2007, <NAME>, <NAME>, <NAME>, 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 ('tiki-setup.php');

include_once ('lib/messu/messulib.php');
include_once ('lib/userprefs/scrambleEmail.php');


if ($prefs['feature_contact'] != 'y') {
	$smarty->assign('msg', tra('This feature is disabled').': feature_contact');
	$smarty->display('error.tpl');
	die;
}
if ($prefs['contact_anon'] != 'y' && !$user) {
	$smarty->assign('msg', 'You are not logged in');
	$smarty->display('error.tpl');
	die;
}

$smarty->assign('mid', 'tiki-contact.tpl');

$email = $userlib->get_admin_email();
$email = scrambleEmail($email, $tikilib->get_user_preference('admin', "email is public"));

$smarty->assign('email', $email);

if ($user == '' and $prefs['contact_anon'] == 'y') {
  $user = 'anonymous';
	$smarty->assign('sent', 0);
	if (isset($_REQUEST['send'])) {
		check_ticket('contact');
		$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: you must include a subject or a message at least'));
			$smarty->assign('priority', $_REQUEST['priority']);
			$smarty->display("tiki.tpl");
			die;
		}
		if ((!$user || $user == 'anonymous') && $feature_antibot == 'y') {
			if((!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) {
				$smarty->assign('message',tra("You have mistyped the anti-bot verification code; please try again."));
				if (!empty($_REQUEST['subject'])) $smarty->assign_by_ref('subject', $_REQUEST['subject']);
				if (!empty($_REQUEST['body'])) $smarty->assign_by_ref('body', $_REQUEST['body']);
				if (!empty($_REQUEST['priority'])) $smarty->assign_by_ref('priority', $_REQUEST['priority']);
				$smarty->display("tiki.tpl");
				die;
			}
		}
		$messulib->post_message($prefs['contact_user'], $user, $_REQUEST['to'],
			'', $_REQUEST['subject'], $_REQUEST['body'], $_REQUEST['priority']);
		$message = tra('Message sent to'). ':' . $prefs['contact_user'] . '<br />';
		$smarty->assign('message', $message);
	}
}<commit_msg>[FIX]contact: do not show the quick edit box in the contact page<commit_after><?php

// $Header: /cvsroot/tikiwiki/tiki/tiki-contact.php,v 1.25.2.4 2008-02-06 14:11:46 sylvieg Exp $

// Copyright (c) 2002-2007, <NAME>, <NAME>, <NAME>, 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 ('tiki-setup.php');

include_once ('lib/messu/messulib.php');
include_once ('lib/userprefs/scrambleEmail.php');


if ($prefs['feature_contact'] != 'y') {
	$smarty->assign('msg', tra('This feature is disabled').': feature_contact');
	$smarty->display('error.tpl');
	die;
}
if ($prefs['contact_anon'] != 'y' && !$user) {
	$smarty->assign('msg', 'You are not logged in');
	$smarty->display('error.tpl');
	die;
}

$smarty->assign('mid', 'tiki-contact.tpl');

$email = $userlib->get_admin_email();
$email = scrambleEmail($email, $tikilib->get_user_preference('admin', "email is public"));

$smarty->assign('email', $email);

if ($user == '' and $prefs['contact_anon'] == 'y') {
	$smarty->assign('sent', 0);
	if (isset($_REQUEST['send'])) {
		check_ticket('contact');
		$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: you must include a subject or a message at least'));
			$smarty->assign('priority', $_REQUEST['priority']);
			$smarty->display("tiki.tpl");
			die;
		}
		if ($feature_antibot == 'y') {
			if((!isset($_SESSION['random_number']) || $_SESSION['random_number'] != $_REQUEST['antibotcode'])) {
				$smarty->assign('message',tra("You have mistyped the anti-bot verification code; please try again."));
				if (!empty($_REQUEST['subject'])) $smarty->assign_by_ref('subject', $_REQUEST['subject']);
				if (!empty($_REQUEST['body'])) $smarty->assign_by_ref('body', $_REQUEST['body']);
				if (!empty($_REQUEST['priority'])) $smarty->assign_by_ref('priority', $_REQUEST['priority']);
				$smarty->display("tiki.tpl");
				die;
			}
		}
		$messulib->post_message($prefs['contact_user'], 'Anonymous', $_REQUEST['to'],
			'', $_REQUEST['subject'], $_REQUEST['body'], $_REQUEST['priority']);
		$message = tra('Message sent to'). ':' . $prefs['contact_user'] . '<br />';
		$smarty->assign('message', $message);
	}
}
{'fraction_non_alphanumeric': 0.2233169129720854, 'fraction_numerical': 0.011904761904761904, 'mean_word_length': 5.320363164721141, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2080901', 'n_tokens_mistral': 1779, 'n_tokens_neox': 1631, 'n_words': 354}