This commit is contained in:
Abdulrahman
2019-05-20 21:56:29 +03:00
parent eb788babd1
commit a9dd576094
12 changed files with 69 additions and 105 deletions

View File

@@ -17,20 +17,14 @@ if (! defined('IN_COMMON'))
class usrcp
{
// this function like a traffic sign :)
public function data ($name, $pass, $hashed = false, $expire = 86400, $loginadm = false)
{
global $config, $userinfo;
//return user system to normal
if (defined('DISABLE_INTR') || $config['user_system'] == '' || empty($config['user_system']))
{
$config['user_system'] = '1';
}
//expire
$expire = time() + ((int) $expire ? intval($expire) : 86400);
$name = trim($name);
$pass = trim($pass);
$return_now = $login_status = false;
@@ -42,19 +36,8 @@ class usrcp
}
if ((int) $config['user_system'] != 1)
{
if (file_exists(PATH . 'includes/auth_integration/' . trim($config['user_system']) . '.php'))
{
include_once PATH . 'includes/auth_integration/' . trim($config['user_system']) . '.php';
$login_status = kleeja_auth_login(trim($name), trim($pass), $hashed, $expire, $loginadm);
return $login_status;
}
}
//normal
return $this->normal(trim($name), trim($pass), $hashed, $expire, $loginadm);
return $this->normal($name, $pass, $hashed, $expire, $loginadm);
}
//get username by id
@@ -62,12 +45,6 @@ class usrcp
{
global $config;
//return user system to normal
if (defined('DISABLE_INTR'))
{
$config['user_system'] = 1;
}
$return_now = $auth_status = false;
is_array($plugin_run_result = Plugins::getInstance()->run('auth_func_usr_class', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
@@ -77,22 +54,13 @@ class usrcp
return $auth_status;
}
if ((int) $config['user_system'] != 1)
{
if (file_exists(PATH . 'includes/auth_integration/' . trim($config['user_system']) . '.php'))
{
include_once PATH . 'includes/auth_integration/' . trim($config['user_system']) . '.php';
return kleeja_auth_username($user_id);
}
}
//normal system
$u = $this->get_data('name', $user_id);
return $u['name'];
}
//now our table, normal user system
public function normal ($name, $pass, $hashed = false, $expire, $loginadm = false)
public function normal($name, $pass, $hashed = false, $expire, $loginadm = false)
{
global $SQL, $dbprefix, $config, $userinfo;