diff --git a/compat/auth/dle.php b/compat/auth/dle.php index 10bae08e..bc4a7cec 100644 --- a/compat/auth/dle.php +++ b/compat/auth/dle.php @@ -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('Введены неверные данные'); } - -?> \ No newline at end of file +?> diff --git a/compat/auth/ipb.php b/compat/auth/ipb.php index cf9ace78..99ea456b 100644 --- a/compat/auth/ipb.php +++ b/compat/auth/ipb.php @@ -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'] : 'Ошибка при авторизации'); ?> diff --git a/compat/auth/phpbb.php b/compat/auth/phpbb.php index 724123af..4f80ad54 100644 --- a/compat/auth/phpbb.php +++ b/compat/auth/phpbb.php @@ -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'] : 'Ошибка при авторизации'); ?> diff --git a/compat/auth/wordpress.php b/compat/auth/wordpress.php index 95ff2d01..04903cae 100644 --- a/compat/auth/wordpress.php +++ b/compat/auth/wordpress.php @@ -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 : 'Ошибка при авторизации'); ?> diff --git a/compat/auth/xenforo.php b/compat/auth/xenforo.php index b40e7961..97f4ec80 100644 --- a/compat/auth/xenforo.php +++ b/compat/auth/xenforo.php @@ -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 : 'Ошибка при авторизации'); ?>