/[drupal]/contributions/modules/webserver_auth/webserver_auth.module
ViewVC logotype

Diff of /contributions/modules/webserver_auth/webserver_auth.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.17, Tue Apr 24 01:09:26 2007 UTC revision 1.18, Tue Apr 24 01:17:45 2007 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: webserver_auth.module,v 1.16 2006/03/25 06:01:54 weitzman Exp $  // $Id: webserver_auth.module,v 1.17 2007/04/24 01:09:26 weitzman Exp $
3    
4  function webserver_auth_init() {  function webserver_auth_init() {
5    global $user, $account;    global $user, $account;
# Line 25  function webserver_auth_init() { Line 25  function webserver_auth_init() {
25        }        }
26    
27        // try to log into Drupal. if unsuccessful, register the user        // try to log into Drupal. if unsuccessful, register the user
28        $user = user_external_load($account->name);        $test_user = user_external_load($account->name);
29        if (!$user->uid) {        if (!$test_user->uid) {
30          if (variable_get("user_register", 1) == 1) {          if (variable_get("user_register", 1) == 1) {
31            $user_default = array("name" => $account->name, "pass" => "cyan", "init" => db_escape_string($name), "authname_webserver_auth" => $account->name, "status" => 1, "roles" => array(DRUPAL_AUTHENTICATED_RID));            $user_default = array("name" => $account->name, "pass" => "cyan", "init" => db_escape_string($name), "authname_webserver_auth" => $account->name, "status" => 1, "roles" => array(DRUPAL_AUTHENTICATED_RID));
32            // TODO - the hook_user('register') will fire but only for loaded modules. could be a problem for sites using page cache and that hook+operation            // TODO - the hook_user('register') will fire but only for loaded modules. could be a problem for sites using page cache and that hook+operation
# Line 34  function webserver_auth_init() { Line 34  function webserver_auth_init() {
34            watchdog("user", "new user: $user->name (webserver_auth)", l(t("edit user"), "admin/user/edit/$user->uid"));            watchdog("user", "new user: $user->name (webserver_auth)", l(t("edit user"), "admin/user/edit/$user->uid"));
35          }          }
36        }        }
37          else{
38            $user = $test_user;
39          }
40      }      }
41      else {      else {
42        // do nothing. user isn't logged into web server        // do nothing. user isn't logged into web server

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.2