broken commit

This commit is contained in:
Stanislas Dolcini 2018-10-03 22:09:28 +02:00
parent b3f31f7d5f
commit d5f2c226ca
2 changed files with 87 additions and 77 deletions

View file

@ -6,14 +6,14 @@ set_error_handler('err_callback');
// For error handling, buffer all output // For error handling, buffer all output
ob_start('ob_callback_r2login'); ob_start('ob_callback_r2login');
include_once 'config.php'; include_once '../config.php';
include_once 'login_translations.php'; include_once '../login_translations.php';
include_once '../tools/nel_message.php'; include_once '../../tools/nel_message.php';
include_once '../tools/domain_info.php'; include_once '../../tools/domain_info.php';
include_once 'login_service_itf.php'; include_once '../login_service_itf.php';
include_once '../ring/join_shard.php'; include_once '../../ring/join_shard.php';
include_once './class/CWwwLog.php'; include_once './CWwwLog.php';
include_once './class/LoginCb.php'; include_once './LoginCb.php';
class ConnectionHandler class ConnectionHandler
{ {
@ -174,14 +174,9 @@ class ConnectionHandler
if ($stmt = mysqli_prepare("SELECT 1 FROM user WHERE Login='?'")) { if ($stmt = mysqli_prepare("SELECT 1 FROM user WHERE Login='?'")) {
$stmt->bind_param("s", $login); $stmt->bind_param("s", $login);
$stmt->execute(); $stmt->execute();
$stmt->bind_result($result) or die(errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link))); $stmt->bind_result($row) or die(errorMsgBlock(3006, $query, 'main', $DBName, $DBHost, $DBUserName, mysqli_error($link)));
$stmt->fetch(); $stmt->fetch();
$numrows = $stmt->num_rows; if ($stmt->num_rows) {
$stmt->close();
}
if ($numrows >= 0) {
$row = $mysqli->fetch_assoc();
$salt = get_salt($row["Password"]); $salt = get_salt($row["Password"]);
if (($cp && $row["Password"] == $password) || (!$cp && $row["Password"] == crypt($password, $salt))) { if (($cp && $row["Password"] == $password) || (!$cp && $row["Password"] == crypt($password, $salt))) {
// Store the real login (with correct case) // Store the real login (with correct case)
@ -248,6 +243,10 @@ class ConnectionHandler
$reason = errorMsg(2004, 'user'); $reason = errorMsg(2004, 'user');
} }
} }
$stmt->close();
}
$mysqli->close(); $mysqli->close();
return $res; return $res;
} }

View file

@ -1,5 +1,16 @@
<?php <?php
error_reporting(E_ERROR | E_PARSE);
set_error_handler('err_callback');
// For error handling, buffer all output
ob_start('ob_callback_r2login');
include_once 'config.php';
include_once 'login_translations.php';
include_once '../tools/nel_message.php';
include_once '../tools/domain_info.php';
include_once 'login_service_itf.php';
include_once '../ring/join_shard.php';
include_once './class/connection_handler.php'; include_once './class/connection_handler.php';
include_once './class/nel_command.php'; include_once './class/nel_command.php';