I thought about adding a menu entry that would scan all the active addon's for an /addon/addonname/inc/login.php and select an addon that you wanted to use, but didn't want to invest the time in something that I didn't think at the time would get used.
I think with more people writing addons that are handling the authentication this will be an invaluable addition to roster, along with mod authors including authentication in their mods.
On a side note of mod authors including authentication, since the Vault is the first one I can think of that has it by default, smfsync's permissions work beautifully with it. (I apologize if i'm overlooking somebody else's addon, and I think I am, but can't think of what it might be.)
I know that you guys are waiting for R2 to add authentication, but I think this will allow the addon author's to make one for now.
- Code: Select all
if ($roster->config['use_external_auth'] == true){
foreach ($roster->addon_data as $addon_data) {
if ( file_exists (ROSTER_ADDONS . $addon_data['basename'] . DIR_SEP . 'inc' . DIR_SEP . 'login.php') == true)
{
require (ROSTER_ADDONS . $addon_data['basename'] . DIR_SEP . 'inc' . DIR_SEP . 'login.php');
$external = true;
break; //Stop after including a login.php
}
}
if ($external != true)
{
//This isn't pretty, but it's the best way I could think to do it.
//This will only run if a login.php doesnt exist in any of the active addons.
$query = "UPDATE `{$roster->db->prefix}config` SET `config_value` = '0' WHERE `config_name` = 'use_external_auth' LIMIT 1";
$result = $roster->db->query ( $query );
header ("Location: ".ROSTER_URL );
}
}else{
class RosterLogin
{
............
}
}