tiki-confirm_user_email.php 1013 Bytes
Newer Older
1
<?php
changi67's avatar
changi67 committed
2 3 4
/**
 * @package tikiwiki
 */
5
// (c) Copyright 2002-2015 by authors of the Tiki Wiki CMS Groupware Project
changi67's avatar
changi67 committed
6
// 
7 8
// 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.
changi67's avatar
changi67 committed
9
// $Id$
10 11 12

require_once ('tiki-setup.php');

13
if ((isset($prefs['email_due']) && $prefs['email_due'] < 0 ) && $prefs['validateUsers'] != 'y') {
14
	$smarty->assign('msg', tra('This feature is disabled') . ': validateUsers');
15 16 17 18 19 20
	$smarty->display('error.tpl');
	die;
}

if (isset($_REQUEST['user']) && isset($_REQUEST['pass'])) {
	if ($userlib->confirm_email($_REQUEST['user'], $_REQUEST['pass'])) {
21 22 23
		if (empty($user)) {
			$_SESSION["$user_cookie_site"] = $user = $_REQUEST['user'];
		}
Jyhem's avatar
Jyhem committed
24
		header('Location: tiki-information.php?msg='.urlencode(tra('Account validated successfully.')));
25 26 27
		die;
	}
}
28

29 30
$smarty->assign('msg', tra('Problem. Try to log in again to receive new confirmation instructions.'));
$smarty->display('error.tpl');