I've fill the var $account with my vars, but ihave just the index for reg/login and etc and its dosent work.
here is my client.php
<?php
/**
*
* You do not have to edit sso.php file
*
* This file/code should get executed when Codoforum sends a request
* to the path <sso get user path> as defined in SSO plugin settings
* in Codoforum backend
*
*
*/
require 'sso.php';
/**
*
* The SSO client id and secret MUST be same as that set in the Codoforum
* SSO plugin settings
*/
$settings = array(
"client_id" => 'dbzforum',
"secret" => 'Xe24!rf',
"timeout" => 12000
);
$sso = new codoforum_sso($settings);
$account = array();
/**
*
* Here comes your logic to check if the user is logged in or not.
* A simple example would be using PHP SESSION
*/
if (USER_IS_LOGGED_IN) {
$account['uid'] = $personagem['id']; //Your logged in user's userid
$account['name'] = $personagem['nome']; //Your logged in user's username
$account['mail'] = $conta['email']; //Your logged in user's email id
$account['avatar'] = ''; //not used as of now
}
$sso->output_jsonp($account); //output above as JSON back to Codoforum
exit();
I've fill the var $account with my vars, but ihave just the index for reg/login and etc and its dosent work.
here is my client.php
````
<?php
/**
*
* You do not have to edit sso.php file
*
* This file/code should get executed when Codoforum sends a request
* to the path <sso get user path> as defined in SSO plugin settings
* in Codoforum backend
*
*
*/
require 'sso.php';
/**
*
* The SSO client id and secret MUST be same as that set in the Codoforum
* SSO plugin settings
*/
$settings = array(
"client_id" => 'dbzforum',
"secret" => 'Xe24!rf',
"timeout" => 12000
);
$sso = new codoforum_sso($settings);
$account = array();
/**
*
* Here comes your logic to check if the user is logged in or not.
* A simple example would be using PHP SESSION
*/
if (USER_IS_LOGGED_IN) {
$account['uid'] = $personagem['id']; //Your logged in user's userid
$account['name'] = $personagem['nome']; //Your logged in user's username
$account['mail'] = $conta['email']; //Your logged in user's email id
$account['avatar'] = ''; //not used as of now
}
$sso->output_jsonp($account); //output above as JSON back to Codoforum
exit();
````
edited Dec 11 '16 at 6:58 pm