droy | 43456e4 | 2007-11-27 18:55:10 +0000 | [diff] [blame] | 1 | <?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 | *******************************************************************************/ |
droy | 43456e4 | 2007-11-27 18:55:10 +0000 | [diff] [blame] | 13 | include("global.php"); |
droy | fd2bab2 | 2007-11-27 21:08:43 +0000 | [diff] [blame^] | 14 | InitPage("login"); |
droy | 43456e4 | 2007-11-27 18:55:10 +0000 | [diff] [blame] | 15 | |
droy | fd2bab2 | 2007-11-27 21:08:43 +0000 | [diff] [blame^] | 16 | require_once(BABEL_BASE_DIR . "classes/system/user.class.php"); |
| 17 | require_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 | |
| 27 | if($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 | } |
droy | 43456e4 | 2007-11-27 18:55:10 +0000 | [diff] [blame] | 47 | |
| 48 | # TODO: finish the intro text |
| 49 | |
| 50 | |
droy | fd2bab2 | 2007-11-27 21:08:43 +0000 | [diff] [blame^] | 51 | include("head.php"); |
| 52 |
|
droy | 43456e4 | 2007-11-27 18:55:10 +0000 | [diff] [blame] | 53 | include("content/en_login.php"); |
droy | fd2bab2 | 2007-11-27 21:08:43 +0000 | [diff] [blame^] | 54 | |
droy | 43456e4 | 2007-11-27 18:55:10 +0000 | [diff] [blame] | 55 | include("foot.php");
|
| 56 | ?> |