我正在为社区开发一个小型手工制作的门户网站,我希望它有一个带有 IP.Board 的登录系统(对最终用户来说更容易)。
我在同一主机上拥有论坛和应用程序。对于登录,用户单击一个按钮并被重定向到此页面:
<?php
require_once '../www/forum/init.php';
include_once 'includes/functions.php';
error_reporting(E_ALL);
session_start();
\IPS\Session\Front::i();
print_r( \IPS\Member::loggedIn());
if(\IPS\Member::loggedIn()->member_id) {
$name = \IPS\Member::loggedIn()->name;
if(checkUserExistance($name)==0){
//header("Location: ../index.php");
print("LOGED EXIT!!!!!!!!!!!!!!!!!!!!");
}else{
print("LOGED INNNN!!!!!!!!!!!!!!!!!!!!");
$_SESSION['authenticated'] = 'yes';
$_SESSION['user'] = $name;
$userphoto = \IPS\Member::loggedIn()->photo;
$result = getUserData($_SESSION['user']);
$_SESSION['isLeader'] = $result['isLeader'];
$_SESSION['isAdmin'] = $result['isAdmin'];
}
} else{
print("LOGED OUT!!!!!!!!!!!!!!!!!!!!");
$_SESSION['authenticated'] = 'no';
if(session_destroy()){ // Destroying All Sessions
//header("Location: index.php");
}
}
//echo "Auth by LOGIN";
?>
如果未登录 IP.Board 会话(论坛),则返回index.php
现在我正在开发它的基本版本,一旦我开始工作,将会做更多的改进。
如您所见,我有一个print
用于调试一些数据的工具。在Edge上一切正常,但在Firefox或chrome上,我得到一个 32 个字符的字符串,每次都是不同的,而不是获取用户名。我在Firefox和Chrome中得到的示例。
ef5cd2de05387b9b01048efad2173efd
有谁知道这是为什么?
信息:我关注了:IP.Board SSO 文档
INFO2: 论坛帖子
我使用 IPS 社区套件作为“主人”。
编辑1:调试\IPS\Member::loggedIn()
IPS\Member Object ( [nodeClass:protected] => IPS\awards\Cats [_followData] => [_previousPhotoType:protected] => [_group] => [restrictions:protected] => [modPermissions:protected] => [calculatedLanguageId :protected] => [markers] => Array () [markersResetTimes:protected] => Array () [haveAllMarkers:protected] => [defaultStreamId:protected] => [changedCustomFields] => Array () [previousName:protected] => [_socialGroups:protected] => [sessionData:protected] => [_lang:protected] => [_url:protected] => [profileFields] => [_reputationData:protected] => [_following:protected] => 数组( ) [reportCount:protected] => [ignorePreferences:protected] => [_ppdLimit:protected] => [_data:protected] => 数组 ( [member_group_id] => 2 [mgroup_others] =>[加入] => 1483440989 [ip_address] => 83.36.150.111 [timezone] => UTC [allow_admin_mails] => 1 [pp_photo_type] => [member_posts] => 0 [pp_main_photo] => [pp_thumb_photo] => [failed_logins] => [pp_reputation_points] => 0 [签名] => [auto_track] => {"content":0,"comments":0,"method":"immediate"} ) [_new:protected] => 1 [更改] => Array ( [member_group_id] => 2 [mgroup_others] => [joined] => 1483440989 [ip_address] => 83.36.150.111 [timezone] => UTC [allow_admin_mails] => 1 [pp_photo_type] => [member_posts] => 0 ) [skipCloneDuplication] => )[pp_thumb_photo] => [failed_logins] => [pp_reputation_points] => 0 [签名] => [auto_track] => {"content":0,"comments":0,"method":"immediate"} ) [_new :protected] => 1 [更改] => 数组 ( [member_group_id] => 2 [mgroup_others] => [joined] => 1483440989 [ip_address] => 83.36.150.111 [timezone] => UTC [allow_admin_mails] => 1 [pp_photo_type] => [member_posts] => 0) [skipCloneDuplication] =>)[pp_thumb_photo] => [failed_logins] => [pp_reputation_points] => 0 [签名] => [auto_track] => {"content":0,"comments":0,"method":"immediate"} ) [_new :protected] => 1 [更改] => 数组 ( [member_group_id] => 2 [mgroup_others] => [joined] => 1483440989 [ip_address] => 83.36.150.111 [timezone] => UTC [allow_admin_mails] => 1 [pp_photo_type] => [member_posts] => 0) [skipCloneDuplication] =>)111 [时区] => UTC [allow_admin_mails] => 1 [pp_photo_type] => [member_posts] => 0 ) [skipCloneDuplication] => )111 [时区] => UTC [allow_admin_mails] => 1 [pp_photo_type] => [member_posts] => 0 ) [skipCloneDuplication] => )