3 * Registration verification page
5 * This page is accessed with the link sent in account confirmation
8 * Copyright 1999-2001 (c) VA Linux Systems
10 * This file is part of GForge.
12 * GForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * GForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with GForge; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 require_once('../env.inc.php');
28 require_once $gfcommon.'include/pre.php';
30 $confirm_hash = getStringFromRequest('confirm_hash');
32 if (getStringFromRequest('submit')) {
33 $loginname = getStringFromRequest('loginname');
34 $passwd = getStringFromRequest('passwd');
38 _('Missing paramater'),
39 _('You must enter a user name.')
43 $u = user_get_object_by_name($loginname);
44 if (!$u && forge_get_config('require_unique_email')) {
45 $u = user_get_object_by_email ($loginname);
47 if (!$u || !is_object($u)) {
48 exit_error('Error','Could Not Get User');
49 } elseif ($u->isError()) {
50 exit_error('Error',$u->getErrorMessage());
53 if ($u->getStatus()=='A'){
55 _('Invalid operation'),
56 _('Account already active.')
60 $confirm_hash = html_clean_hash_string($confirm_hash);
62 if ($confirm_hash != $u->getConfirmHash()) {
64 _('Invalid parameter'),
65 _('Cannot confirm account identity - invalid confirmation hash (or login name)')
69 if (!session_login_valid($loginname, $passwd, 1)) {
72 _('Credentials you entered do not correspond to valid account.')
76 if (!$u->setStatus('A')) {
78 _('Could not activate account'),
79 _('Error while activiting account').': '.$u->getErrorMessage()
83 session_redirect("/account/first.php");
86 $HTML->header(array('title'=>'Verify'));
88 echo _('<p>In order to complete your registration, login now. Your account will then be activated for normal logins.</p>');
90 if (isset($GLOBALS['error_msg'])) {
91 print '<p><span class="error">'.$GLOBALS['error_msg'].'</span>';
95 <form action="<?php echo util_make_url('/account/verify.php'); ?>" method="post">
98 if (forge_get_config('require_unique_email')) {
99 echo _('Login name or email address:');
101 echo _('Login name:');
104 <br /><input type="text" name="loginname" /></p>
105 <p><?php echo _('Password:'); ?>
106 <br /><input type="password" name="passwd" /></p>
107 <input type="hidden" name="confirm_hash" value="<?php print htmlentities($confirm_hash); ?>" />
108 <p><input type="submit" name="submit" value="<?php echo _('Login'); ?>" /></p>
112 $HTML->footer(array());