How can I log out of the IPB system from the outside?

I built a system SSO (Single Sign-On)for use between our main site and software Invision Power Board, but I'm not sure how to start registering a user from IPBwhen they exit the main site?

Also, what files will I need to upload to an external file to do this?

+4
source share
2 answers

Edit: in order to use the IPB code for this, you must enable

require_once( IPS_ROOT_PATH . 'applications/core/modules_public/global/login.php' );

then to continue public_core_global_loginand to call the method doLogout() for this you need to install $this->member->setMember( $member_id ); I personally have never done this before, so you can do it manually:

IPB cookie . - IPB; ( query and updatecookie - , cookie ):

  query("DELETE FROM ".$ibf_prefix."sessions WHERE member_id = $userid");

  updatecookie($ibf_cookieid."member_id",0,time()-1800);
  updatecookie($ibf_cookieid."pass_hash",0,time()-1800);
  updatecookie($ibf_cookieid."session_id",0,time()-1800);

$ibf_prefix conf_global.php:

$ibf_prefix = $INFO[sql_tbl_prefix];

$ibf_cookieid:

$ibf_cache = query_first("SELECT cs_value FROM " . $ibf_prefix . "cache_store WHERE cs_key = 'settings'");
$ibf_cache = unserialize($ibf_cache['cs_value']);

$ibf_cookieid = $ibf_cache['cookie_id'];

doLogout admin/applications/core/modules_public/global/login.php

IPB API .

+2

session_destroy();

" ", cookie pass_hash.

0

Source: https://habr.com/ru/post/1534405/


All Articles