blob: eeae8619f5adb4c65837988e63e5e2c357e03c87 [file] [log] [blame]
droy43456e42007-11-27 18:55:10 +00001<?php
2/*******************************************************************************
3 * Copyright (c) 2007 Eclipse Foundation and others.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Paul Colton (Aptana)- initial API and implementation
11 * Eclipse Foundation
12*******************************************************************************/
droy43456e42007-11-27 18:55:10 +000013include("global.php");
droy2d5fd192007-11-28 14:42:45 +000014InitPage("");
droy43456e42007-11-27 18:55:10 +000015
droyfd2bab22007-11-27 21:08:43 +000016require_once(BABEL_BASE_DIR . "classes/system/user.class.php");
17require_once(BABEL_BASE_DIR . "classes/system/session.class.php");
18
19$pageTitle = "Babel Login";
20$pageKeywords = "translation,language,nlpack,pack,eclipse,babel";
21
22$USERNAME = $App->getHTTPParameter("username", "POST");
23$PASSWORD = $App->getHTTPParameter("password", "POST");
24$REMEMBER = $App->getHTTPParameter("remember", "POST");
25$SUBMIT = $App->getHTTPParameter("submit", "POST");
26
27if($SUBMIT == "Login") {
28 if($USERNAME != "" && $PASSWORD != ""){
29 $User = new User();
30 if(!$User->load($USERNAME, $PASSWORD)) {
31 $GLOBALS['g_ERRSTRS'][0] = "Authentication failed. Please verify your username and/or password are correct.";
32 }
33 else {
34 # create session
35 $Session = new Session();
36 $Session->create($User->userid, $REMEMBER);
37 SetSessionVar('User', $User);
droyfd2bab22007-11-27 21:08:43 +000038 exitTo(".");
39 }
40 }
41 else {
42 $GLOBALS['g_ERRSTRS'][0] = "Your username and password must not be empty.";
43 }
44}
droy43456e42007-11-27 18:55:10 +000045
46# TODO: finish the intro text
47
48
droyfd2bab22007-11-27 21:08:43 +000049include("head.php");
50
droy43456e42007-11-27 18:55:10 +000051include("content/en_login.php");
droyfd2bab22007-11-27 21:08:43 +000052
droy43456e42007-11-27 18:55:10 +000053include("foot.php");
54?>