public function log_with_hash($uid, $hash) { if (!$this->db_conn) { $this->connectdb(); } if (!$this->db_conn) { return false; } $query = 'SELECT user_pass FROM ' . self::$params['wordpress_db_prefix'] . 'users WHERE user_login = "******"', '""', $uid) . '"AND user_status = 0'; $result = $this->wp_instance->db->query($query); if ($result && mysqli_num_rows($result) > 0) { $ro = mysqli_fetch_array($result); if ($hash == sha1($ro[0])) { //Some line from lib/user.php $enabled = OC_User::isEnabled($uid); if ($uid && $enabled) { //session_regenerate_id(true); OC_User::setUserId($uid); //OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid, 'password'=>$password )); return true; } } } return false; }