Custom RosterLogin class

Posts from previous Beta sessions

Custom RosterLogin class

Postby boyo » Thu Nov 29, 2007 8:40 am

I am wondering if there are any plans of implementing an ability for addons to use their own RosterLogin class. For my own use, I have hacked /inc/login.php to be the code below. I did this to allow smfsync to be able to take over all of the login authentication stuff.

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
        {
        ............
        }
}
Last edited by boyo on Thu Nov 29, 2007 8:41 am, edited 1 time in total.
boyo
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 103
Joined: Wed Jan 24, 2007 7:37 am

Custom RosterLogin class

Postby zanix » Thu Nov 29, 2007 12:40 pm

Yes, I was planning it but I must have forgotten

I will add this in tonight
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Custom RosterLogin class

Postby boyo » Thu Nov 29, 2007 12:48 pm

Cool, I will look forward to that, and to rewriting my code to accommodate.
Haven't thought of anything to do to it lately.
boyo
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 103
Joined: Wed Jan 24, 2007 7:37 am

Custom RosterLogin class

Postby zanix » Thu Nov 29, 2007 1:07 pm

It will be in svn[1488] and will have a selectable menu in RosterCP->Main Settings
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Custom RosterLogin class

Postby boyo » Thu Nov 29, 2007 1:28 pm

Ok, I have to say that was brilliant how you did that. WAY better then how I did it. Awesome, thanks.
boyo
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 103
Joined: Wed Jan 24, 2007 7:37 am

Custom RosterLogin class

Postby mdeshane » Thu Nov 29, 2007 11:21 pm

Ooooh... I'll have to check this out! It could be very useful... And will probably be better than the current method I had of user authentication (setting the roster cookie based on group id). Of course, now I have a ton of new ideas to go with this.
Last edited by mdeshane on Thu Nov 29, 2007 11:25 pm, edited 1 time in total.
Image
Accounts Addon - Roster v2 User Account Addon

PKC Dev Site - http://dev.pkcomp.net
My Roster Dev Site - http://myroster.dontexist.net
User avatar
mdeshane
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 204
Joined: Sun Dec 10, 2006 4:54 am
Location: Grand Rapids, MI USA
Realm: Khadgar (PvE) - US


Return to Archived

Who is online

Users browsing this forum: No registered users and 1 guest

cron