FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Proposed code change to add AUTO_LOGIN plugin hook
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Return to the default flat view Create a new topic Submit Reply
Proposed code change to add AUTO_LOGIN plugin hook [message #184653] Tue, 14 January 2014 11:26 Go to previous message
kmoradha is currently offline  kmoradha
Messages: 8
Registered: January 2014
Karma:
Junior Member
add to buddy list
ignore all messages by this user
This code change adds a new plugin hook named "AUTO_LOGIN" to allow automatic user login based on external authentication methods. We are currently using this in combination with a Basic Authentication configuration on the web server.

The plugin hook is only used if a saved session is not initially identifiable, and before an anonymous session is created.

Please review the code change below:

--- users.inc.t-orig    2014-01-14 11:08:47.608988091 -0500
+++ users.inc.t 2014-01-14 11:13:50.702268354 -0500
@@ -655,6 +655,11 @@
        $sq = 0;
        /* Fetch an object with the user's session, profile & theme info. */
        if (!($u = ses_get())) {
+               /* Call auto-login plugins. */
+               $u = plugin_call_hook('AUTO_LOGIN');
+       }
+
+       if (!$u) {
                /* New anon user. */
                $u = ses_anon_make();
        } else if ($u->id != 1 && (!$GLOBALS['is_post'] || sq_check(1, $u->sq, $u->id, $u->ses_id))) {
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Proposed code change for potentially more unique sysid
Next Topic: Map BBCode
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Sep 20 23:08:20 EDT 2017

Total time taken to generate the page: 0.00758 seconds