3 * FusionForge login page
5 * This is main login page. It takes care of different account states
6 * (by disallowing logging in with non-active account, with appropriate
9 * Copyright 1999-2001 (c) VA Linux Systems
11 * This file is part of FusionForge.
13 * FusionForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * FusionForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with FusionForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 Header( "Expires: Wed, 11 Nov 1998 11:11:11 GMT");
29 Header( "Cache-Control: no-cache");
30 Header( "Cache-Control: must-revalidate");
32 require_once('../../../www/env.inc.php');
33 require_once $gfcommon.'include/pre.php';
35 $plugin = plugin_get_object('authbuiltin');
37 $return_to = getStringFromRequest('return_to');
38 $login = getStringFromRequest('login');
39 $form_loginname = getStringFromRequest('form_loginname');
40 $form_pw = getStringFromRequest('form_pw');
41 $feedback = htmlspecialchars(getStringFromRequest('feedback'));
42 $warning_msg = htmlspecialchars(getStringFromRequest('warning_msg'));
43 $error_msg = htmlspecialchars(getStringFromRequest('error_msg'));
44 $triggered = getIntFromRequest('triggered');
50 $tmpreturn=explode('?',$return_to);
51 $rtpath = $tmpreturn[0] ;
53 if (@is_file(forge_get_config('url_root').$rtpath)
54 || @is_dir(forge_get_config('url_root').$rtpath)
55 || (strpos($rtpath,'/projects') == 0)
56 || (strpos($rtpath,'/plugins/mediawiki') == 0)) {
64 if (forge_get_config('use_ssl') && !session_issecure()) {
65 //force use of SSL for login
66 header('Location: https://'.getStringFromServer('HTTP_HOST').getStringFromServer('REQUEST_URI'));
69 // ###### first check for valid login, if so, redirect
72 if (!form_key_is_valid(getStringFromRequest('form_key'))) {
73 exit_form_double_submit();
75 $success = session_check_credentials_in_database(strtolower($form_loginname),$form_pw,false);
77 if ($plugin->isSufficient()) {
78 $plugin->login($form_loginname);
81 header ("Location: " . util_make_url($return_to));
84 header ("Location: " . util_make_url("/my"));
88 if ($form_loginname && $form_pw) {
89 $warning_msg = _('Invalid Password Or User Name');
91 $warning_msg = _('Missing Password Or Users Name');
97 $HTML->header(array('title'=>'Login'));
99 if ($login && !$success) {
100 form_release_key(getStringFromRequest('form_key'));
102 if (!isset($userstatus)) {
103 if (isset ($form_loginname)) {
104 $u = user_get_object_by_name($form_loginname) ||
105 user_get_object_by_email($form_loginname) ;
107 $warning_msg .= '<br /><p>'. _('Your account does not exist.').'</p>';
110 } else if ($userstatus == "P") {
111 $warning_msg .= '<br />'. sprintf(_('<p>Your account is currently pending your email confirmation. Visiting the link sent to you in this email will activate your account. <p>If you need this email resent, please click below and a confirmation email will be sent to the email address you provided in registration. <p><a href="%1$s">[Resend Confirmation Email]</a> <br><hr> <p>'), util_make_url ("/account/pending-resend.php?form_user=".htmlspecialchars($form_loginname)));
113 if ($userstatus == "D") {
114 $error_msg .= '<br />'.sprintf(_('<p>Your %1$s account has been removed by %1$s staff. This may occur for two reasons, either 1) you requested that your account be removed; or 2) some action has been performed using your account which has been seen as objectionable (i.e. you have breached the terms of service for use of your account) and your account has been revoked for administrative reasons. Should you have questions or concerns regarding this matter, please log a <a href="%2$s">support request</a>.</p><p>Thank you, <br><br>%1$s Staff</p>'), forge_get_config ('forge_name'), util_make_url ("/support/?group_id=1"));
117 html_error_top($error_msg);
118 html_warning_top($warning_msg);
119 html_feedback_top($feedback);
123 $params['return_to'] = $return_to;
124 plugin_hook('display_auth_form');
126 $HTML->footer(array());
130 // c-file-style: "bsd"