mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
Fix ipb.php! (fixed locale). (#42)
* Fix ipb.php! (fixed locale). * Fix phpbb.php! * wordpress.php locale! * Fix xenforo.php! (locale) * Update ipb.php * Fix dle die logging! * Update dle.php
This commit is contained in:
parent
f79799bee1
commit
3962041825
5 changed files with 20 additions and 19 deletions
|
@ -12,7 +12,7 @@ $auth = [
|
|||
if( isset( $auth['login'] ) AND isset( $auth['password'] ) ) {
|
||||
|
||||
define( 'DATALIFEENGINE', true );
|
||||
require_once( __DIR__ . '/engine/classes/mysql.php' );
|
||||
require( __DIR__ . '/engine/classes/mysql.php' );
|
||||
require_once( __DIR__ . '/engine/data/dbconfig.php' );
|
||||
|
||||
$auth['login'] = $db->safesql( $auth['login'] );
|
||||
|
@ -24,7 +24,7 @@ if( isset( $auth['login'] ) AND isset( $auth['password'] ) ) {
|
|||
|
||||
if( !$member_id['name'] AND !$member_id['email'] ) {
|
||||
|
||||
die('Введены неверные данные');
|
||||
exit('Введены неверные данные');
|
||||
}
|
||||
|
||||
if( strlen($member_id['password']) == 32 && ctype_xdigit($member_id['password']) ) {
|
||||
|
@ -71,12 +71,13 @@ if( isset( $auth['login'] ) AND isset( $auth['password'] ) ) {
|
|||
|
||||
$db->query( "UPDATE LOW_PRIORITY dle_users SET {$new_pass_hash}hash='{$hash}' WHERE name='{$member_id['name']}'" );
|
||||
|
||||
die('OK:'.$member_id['name'].'');
|
||||
exit('OK:'.$member_id['name'].'');
|
||||
|
||||
} else {
|
||||
|
||||
die('Ошибка при авторизации');
|
||||
exit('Ошибка при авторизации');
|
||||
}
|
||||
} else {
|
||||
exit('Введены неверные данные');
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -5,12 +5,12 @@ header("Content-Type: text/plain; charset=UTF-8");
|
|||
$login = $_GET['login'];
|
||||
$password = $_GET['password'];
|
||||
if(empty($login) || empty($password)) {
|
||||
exit('Empty login or password');
|
||||
exit('Введены неверные данные');
|
||||
}
|
||||
|
||||
// Load IPB core
|
||||
define('IPB_THIS_SCRIPT', 'public');
|
||||
require_once('initdata.php');
|
||||
require('initdata.php'); // not once!!!
|
||||
require_once(IPS_ROOT_PATH . 'sources/base/ipsRegistry.php');
|
||||
$reg = ipsRegistry::instance();
|
||||
$reg->init();
|
||||
|
@ -19,10 +19,10 @@ $reg->init();
|
|||
$member = IPSMember::load(IPSText::parseCleanValue($login), 'all', 'username');
|
||||
$member_id = $member['member_id'];
|
||||
if (!$member_id) {
|
||||
exit('Incorrect login');
|
||||
exit('Введены неверные данные');
|
||||
}
|
||||
|
||||
// Try authenticate
|
||||
$success = IPSMember::authenticateMember($member_id, md5(IPSText::parseCleanValue($password)));
|
||||
echo($success ? 'OK:' . $member['name'] : 'Incorrect login or password');
|
||||
echo($success ? 'OK:' . $member['name'] : 'Ошибка при авторизации');
|
||||
?>
|
||||
|
|
|
@ -5,7 +5,7 @@ header("Content-Type: text/plain; charset=UTF-8");
|
|||
$login = $_GET['login'];
|
||||
$password = $_GET['password'];
|
||||
if(empty($login) || empty($password)) {
|
||||
exit('Empty login or password');
|
||||
exit('Введены неверные данные');
|
||||
}
|
||||
|
||||
// Load PHPBB Core
|
||||
|
@ -16,5 +16,5 @@ include($phpbb_root_path . 'common.' . $phpEx);
|
|||
|
||||
// Try authenticate
|
||||
$result = $auth->login($login, $password, false, false, false);
|
||||
echo($result['status'] === LOGIN_SUCCESS ? 'OK:' . $result['user_row']['username'] : 'Incorrect login or password');
|
||||
echo($result['status'] === LOGIN_SUCCESS ? 'OK:' . $result['user_row']['username'] : 'Ошибка при авторизации');
|
||||
?>
|
||||
|
|
|
@ -5,11 +5,11 @@ header("Content-Type: text/plain; charset=UTF-8");
|
|||
$login = $_GET['login'];
|
||||
$password = $_GET['password'];
|
||||
if(empty($login) || empty($password)) {
|
||||
exit('Empty login or password');
|
||||
exit('Введены неверные данные');
|
||||
}
|
||||
|
||||
// Try authenticate
|
||||
require_once('wp-load.php');
|
||||
$user = wp_authenticate($login, $password);
|
||||
echo($user instanceof WP_User ? 'OK:' . $user->user_login : 'Incorrect login or password');
|
||||
echo($user instanceof WP_User ? 'OK:' . $user->user_login : 'Ошибка при авторизации');
|
||||
?>
|
||||
|
|
|
@ -5,7 +5,7 @@ header("Content-Type: text/plain; charset=UTF-8");
|
|||
$login = $_GET['login'];
|
||||
$password = $_GET['password'];
|
||||
if(empty($login) || empty($password)) {
|
||||
exit('Empty login or password');
|
||||
exit('Введены неверные данные');
|
||||
}
|
||||
|
||||
// Load XenForo core
|
||||
|
@ -20,7 +20,7 @@ $db = XenForo_Application::get('db');
|
|||
// Resolve user_id by login
|
||||
$result = $db->fetchRow('SELECT user_id, username FROM xf_user WHERE username=' . $db->quote($login) . ' OR email=' . $db->quote($login));
|
||||
if(!count($result)) {
|
||||
exit('Incorrect login');
|
||||
exit('Введены неверные данные');
|
||||
}
|
||||
$user_id = $result['user_id'];
|
||||
$username = $result['username'];
|
||||
|
@ -28,7 +28,7 @@ $username = $result['username'];
|
|||
// Get user data
|
||||
$result = $db->fetchCol('SELECT data FROM xf_user_authenticate WHERE user_id=' . $db->quote($user_id));
|
||||
if(!count($result)) {
|
||||
exit('Unable to get user data: ' . $user_id);
|
||||
exit('Внутренняя ошибка'); // rare!
|
||||
}
|
||||
$data = $result[0];
|
||||
|
||||
|
@ -38,10 +38,10 @@ if(class_exists('XenForo_Authentication_Core12')) {
|
|||
$auth = new XenForo_Authentication_Core12;
|
||||
} else if(class_exists('XenForo_Authentication_Core')) {
|
||||
$auth = new XenForo_Authentication_Core;
|
||||
} else exit('Unable to select authentication core');
|
||||
} else exit('Внутренняя ошибка'); // rare!
|
||||
|
||||
// Try authenticate
|
||||
$auth->setData($data);
|
||||
$success = $auth->authenticate($user_id, $password);
|
||||
echo($success ? 'OK:' . $username : 'Incorrect login or password');
|
||||
echo($success ? 'OK:' . $username : 'Ошибка при авторизации');
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue