mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-12 12:54:48 +00:00
Merged default into lightmap_optimizer_port_to_linux
--HG-- branch : lightmap_optimizer_port_to_linux
This commit is contained in:
commit
d89e6c9c2c
7 changed files with 27 additions and 23 deletions
|
@ -129,8 +129,8 @@ go_home = "Go Home"
|
||||||
userlist_info = "welcome to the userlist"
|
userlist_info = "welcome to the userlist"
|
||||||
|
|
||||||
[login]
|
[login]
|
||||||
login_info = "Please login with your Username and Password."
|
login_info = "Please login with your Email/Username and Password."
|
||||||
login_error_message = "The username/password were not correct!"
|
login_error_message = "The Email/username/password were not correct!"
|
||||||
login_register_message ="<strong>Register</strong> If you don't have an account yet, create one"
|
login_register_message ="<strong>Register</strong> If you don't have an account yet, create one"
|
||||||
login_here = "here"
|
login_here = "here"
|
||||||
login_forgot_password_message = "In case you forgot your password, click"
|
login_forgot_password_message = "In case you forgot your password, click"
|
||||||
|
|
|
@ -119,8 +119,8 @@ go_home = "Allez au main page"
|
||||||
userlist_info = "bienvenue sur le userlist page!"
|
userlist_info = "bienvenue sur le userlist page!"
|
||||||
|
|
||||||
[login]
|
[login]
|
||||||
login_info = "S'il vous plait vous connecter avec votre nom d'utilisateur et mot de passe."
|
login_info = "S'il vous plait vous connecter avec votre Email/nom d'utilisateur et mot de passe."
|
||||||
login_error_message = "Le remplie nom d'utilisateur / mot de passe ne sont pas correctes!"
|
login_error_message = "Le remplie Email/nom d'utilisateur / mot de passe ne sont pas correctes!"
|
||||||
login_register_message ="<strong> Inscrivez-vous </strong> Si vous n'avez pas encore de compte, creez-en un"
|
login_register_message ="<strong> Inscrivez-vous </strong> Si vous n'avez pas encore de compte, creez-en un"
|
||||||
login_here = "ici"
|
login_here = "ici"
|
||||||
login_forgot_password_message = "Dans le cas ou vous avez oublie votre mot de passe, cliquez"
|
login_forgot_password_message = "Dans le cas ou vous avez oublie votre mot de passe, cliquez"
|
||||||
|
|
|
@ -70,15 +70,15 @@ class WebUsers extends Users{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if the login username and password match the db.
|
* check if the login username/email and password match the db.
|
||||||
* @param $username the inserted username
|
* @param $value the inserted username or email
|
||||||
* @param $password the inserted password (unhashed)
|
* @param $password the inserted password (unhashed)
|
||||||
* @return the logged in user's db row as array if login was a success, else "fail" will be returned.
|
* @return the logged in user's db row as array if login was a success, else "fail" will be returned.
|
||||||
*/
|
*/
|
||||||
public static function checkLoginMatch($username,$password){
|
public static function checkLoginMatch($value,$password){
|
||||||
|
|
||||||
$dbw = new DBLayer("web");
|
$dbw = new DBLayer("web");
|
||||||
$statement = $dbw->execute("SELECT * FROM ams_user WHERE Login=:user", array('user' => $username));
|
$statement = $dbw->execute("SELECT * FROM ams_user WHERE Login=:value OR Email:value", array('value' => $value));
|
||||||
$row = $statement->fetch();
|
$row = $statement->fetch();
|
||||||
$salt = substr($row['Password'],0,2);
|
$salt = substr($row['Password'],0,2);
|
||||||
$hashed_input_pass = crypt($password, $salt);
|
$hashed_input_pass = crypt($password, $salt);
|
||||||
|
@ -91,7 +91,7 @@ class WebUsers extends Users{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns te id for a given username
|
* returns the id for a given username
|
||||||
* @param $username the username
|
* @param $username the username
|
||||||
* @return the user's id linked to the username
|
* @return the user's id linked to the username
|
||||||
*/
|
*/
|
||||||
|
@ -104,7 +104,7 @@ class WebUsers extends Users{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns te id for a given emailaddress
|
* returns the id for a given emailaddress
|
||||||
* @param $email the emailaddress
|
* @param $email the emailaddress
|
||||||
* @return the user's id linked to the emailaddress
|
* @return the user's id linked to the emailaddress
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,15 +9,16 @@ function login(){
|
||||||
global $INGAME_WEBPATH;
|
global $INGAME_WEBPATH;
|
||||||
global $WEBPATH;
|
global $WEBPATH;
|
||||||
try{
|
try{
|
||||||
$username = filter_var($_POST['Username'],FILTER_SANITIZE_STRING);
|
$login_value = filter_var($_POST['LoginValue'],FILTER_SANITIZE_STRING);
|
||||||
$password = filter_var($_POST['Password'],FILTER_SANITIZE_STRING);
|
$password = filter_var($_POST['Password'],FILTER_SANITIZE_STRING);
|
||||||
|
|
||||||
//check if the filtered sent POST data returns a match with the DB
|
//check if the filtered sent POST data returns a match with the DB
|
||||||
$result = WebUsers::checkLoginMatch($username, $password);
|
$result = WebUsers::checkLoginMatch($login_value, $password);
|
||||||
|
|
||||||
if( $result != "fail"){
|
if( $result != "fail"){
|
||||||
//handle successful login
|
//handle successful login
|
||||||
$_SESSION['user'] = $username;
|
$_SESSION['user'] = $result['Login'];
|
||||||
$_SESSION['id'] = WebUsers::getId($username);
|
$_SESSION['id'] = $result['UId'];
|
||||||
$_SESSION['ticket_user'] = serialize(Ticket_User::constr_ExternId($_SESSION['id']));
|
$_SESSION['ticket_user'] = serialize(Ticket_User::constr_ExternId($_SESSION['id']));
|
||||||
$user = new WebUsers($_SESSION['id']);
|
$user = new WebUsers($_SESSION['id']);
|
||||||
$_SESSION['Language'] = $user->getLanguage();
|
$_SESSION['Language'] = $user->getLanguage();
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
//load required pages and turn error reporting on/off
|
//load required pages and turn error reporting on/off
|
||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
ini_set('display_errors', 'on');
|
ini_set('display_errors', 'on');
|
||||||
require_once( '../../ams_lib/libinclude.php' );
|
|
||||||
if (!file_exists('../is_installed')) {
|
if (!file_exists('../is_installed')) {
|
||||||
//if is_installed doesnt exist run setup
|
//if is_installed doesnt exist run setup
|
||||||
require( 'installer/libsetup.php' );
|
require( 'installer/libsetup.php' );
|
||||||
|
@ -24,6 +23,7 @@ if (!file_exists('../is_installed')) {
|
||||||
//if config exists then include it
|
//if config exists then include it
|
||||||
require( '../config.php' );
|
require( '../config.php' );
|
||||||
}
|
}
|
||||||
|
require_once( $AMS_LIB.'/libinclude.php' );
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
//Running Cron?
|
//Running Cron?
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
* @author Daan Janssens, mentored by Matthew Lagoe
|
* @author Daan Janssens, mentored by Matthew Lagoe
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
//set permissions
|
//set permissions
|
||||||
if(is_writable('../../../www/login/logs')) {
|
if(is_writable('../../../www/login/logs')) {
|
||||||
echo "failed to get write permissions on logs";
|
echo "failed to get write permissions on logs";
|
||||||
|
@ -34,7 +37,7 @@
|
||||||
if (!isset($_POST['function'])) {
|
if (!isset($_POST['function'])) {
|
||||||
//require the pages that are being needed.
|
//require the pages that are being needed.
|
||||||
require_once( '../config.default.php' );
|
require_once( '../config.default.php' );
|
||||||
require_once( '../../ams_lib/libinclude.php' );
|
require_once( $AMS_LIB.'/libinclude.php' );
|
||||||
ini_set( "display_errors", true );
|
ini_set( "display_errors", true );
|
||||||
error_reporting( E_ALL );
|
error_reporting( E_ALL );
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
</div>
|
</div>
|
||||||
<form method="post" action="index.php{if isset($getstring)}{$getstring}{/if}" class="form-horizontal">
|
<form method="post" action="index.php{if isset($getstring)}{$getstring}{/if}" class="form-horizontal">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div data-rel="tooltip" class="input-prepend" data-original-title="Username">
|
<div data-rel="tooltip" class="input-prepend" data-original-title="Username/Email">
|
||||||
<span class="add-on"><i class="icon-user"></i></span><input type="text" value="" id="Username" name="Username" class="input-large span10" placeholder="Username">
|
<span class="add-on"><i class="icon-user"></i></span><input type="text" value="" id="LoginValue" name="LoginValue" class="input-large span10" placeholder="Username or Email">
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue