Login integration - fudforum/FUDforum GitHub Wiki
FUDforum provides a login integration API that can be used to log users in from external applications (like wiki's and blogs) on to the forum.
To use the API, include the forum_login.php script into your project. This script can be found inside the forum's scripts/ directory.
This API provides the following functions:
Lookup a forum $user_id from a username and password combination:
int external_get_user_by_auth ( char $login, char $passwd )
Return a forum $user_id or NULL if the username and/or password is incorrect.
Log a user into the forum.
int external_fud_login ( int $user_id )
Return session id.
Register what the user is busy doing in the forum's iSpy action list.
void external_fud_status ( char $action )
Log a user out from the forum.
void external_fud_logout ( int $user_id )
Example PHP script to authenticate 'user1/pass' against the forum database and log them on to the forum:
<?php
ini_set('display_errors', 1);
include_once('GLOBALS.php');
include_once('forum_login.php');
echo 'Login to forum.<br />';
$ses_id = external_fud_login($user_id);
echo 'Set action.<br />';
external_fud_status('Busy doing laundry...');
// echo 'Log the user out.<br />';
// external_fud_logout($user_id);
?>
- FUDAPI, additional functions to help you integrate your application with FUDforum.