Proposed code change to add AUTO_LOGIN plugin hook [message #184653] |
Tue, 14 January 2014 11:26 |
|
kmoradha
Messages: 8 Registered: January 2014
Karma: 0
|
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))) {
|
|
|
|
|
|
|
|
|