blob: dd1cf46a92bcc52cbd366a002c0a43390099655c [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");
droyfd2bab22007-11-27 21:08:43 +000014InitPage("login");
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);
38 $Crap = GetSessionVar('User');
39 echo "User class: ". get_class($Crap); exit;
40 exitTo(".");
41 }
42 }
43 else {
44 $GLOBALS['g_ERRSTRS'][0] = "Your username and password must not be empty.";
45 }
46}
droy43456e42007-11-27 18:55:10 +000047
48# TODO: finish the intro text
49
50
droyfd2bab22007-11-27 21:08:43 +000051include("head.php");
52
droy43456e42007-11-27 18:55:10 +000053include("content/en_login.php");
droyfd2bab22007-11-27 21:08:43 +000054
droy43456e42007-11-27 18:55:10 +000055include("foot.php");
56?>