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';
34 require_once('../../../www/include/login-form.php');
36 $plugin = plugin_get_object('authbuiltin');
38 $return_to = getStringFromRequest('return_to');
39 $login = getStringFromRequest('login');
40 $form_loginname = getStringFromRequest('form_loginname');
41 $form_pw = getStringFromRequest('form_pw');
42 $triggered = getIntFromRequest('triggered');
48 $tmpreturn=explode('?',$return_to);
49 $rtpath = $tmpreturn[0] ;
51 if (@is_file(forge_get_config('url_root').$rtpath)
52 || @is_dir(forge_get_config('url_root').$rtpath)
53 || (strpos($rtpath,'/projects') == 0)
54 || (strpos($rtpath,'/plugins/mediawiki') == 0)) {
62 if (forge_get_config('use_ssl') && !session_issecure()) {
63 //force use of SSL for login
64 header('Location: https://'.getStringFromServer('HTTP_HOST').getStringFromServer('REQUEST_URI'));
67 // ###### first check for valid login, if so, redirect
70 if (!form_key_is_valid(getStringFromRequest('form_key'))) {
71 exit_form_double_submit();
73 if (session_check_credentials_in_database(strtolower($form_loginname),$form_pw,false)) {
74 if ($plugin->isSufficient()) {
75 $plugin->startSession($form_loginname);
78 header ("Location: " . util_make_url($return_to));
81 header ("Location: " . util_make_url("/my"));
85 if ($form_loginname && $form_pw) {
86 $warning_msg = _('Invalid Password Or User Name');
88 $warning_msg = _('Missing Password Or Users Name');
94 $HTML->header(array('title'=>'Login'));
97 form_release_key(getStringFromRequest('form_key'));
99 if (!isset($userstatus)) {
100 if (isset ($form_loginname)) {
101 $u = user_get_object_by_name($form_loginname) ||
102 user_get_object_by_email($form_loginname) ;
104 $warning_msg .= '<br /><p>'. _('Your account does not exist.').'</p>';
107 } else if ($userstatus == "P") {
108 $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)));
110 if ($userstatus == "D") {
111 $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"));
114 html_error_top($error_msg);
115 html_warning_top($warning_msg);
116 html_feedback_top($feedback);
119 // Otherwise, display the login form again
120 display_login_form($return_to, $triggered);
122 $HTML->footer(array());
126 // c-file-style: "bsd"