function data($name, $pass, $hashed = false, $expire = 86400, $loginadm = false) { global $config; //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); ($hook = kleeja_run_hook('data_func_usr_class')) ? eval($hook) : null; //run hook 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_login(trim($name), trim($pass), $hashed, $expire, $loginadm) ? true : false; } } //normal return $this->normal(trim($name), trim($pass), $hashed, $expire, $loginadm); }
/** * Login into Kleeja * * @param mexied $name The username if not hashed, ID if hashed * @param string $pass The password * @param mixed $hashed does the givvn password hashed or not * @param int $expire The time will the user stay logon * @param bool $loginadm If this is a login for admin area, then true * @return bool true or false */ public function login($name, $pass, $hashed = false, $expire = 86400, $loginadm = false) { global $config, $plugin; #login expire after? $expire = time() + ((int) $expire ? intval($expire) : 86400); ($hook = $plugin->run_hook('data_func_usr_class')) ? eval($hook) : null; //run hook #if the user system integrated, then get the right file if ($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_data = kleeja_auth_login(trim($name), trim($pass), $hashed, $expire, $loginadm); #set current system $this->system = $config['user_system']; #now return data #there should [mail, name, last_login, id] return $login_status; } } #or just use the default system $this->system = 'default'; return $this->normal(trim($name), trim($pass), $hashed, $expire, $loginadm); }
function kleeja_auth_username($user_id) { return kleeja_auth_login($user_id, false, false, 0, false, true); }