| 1 |
<?php |
<?php |
| 2 |
// $Id: webserver_auth.module,v 1.13 2006/03/03 05:02:28 weitzman Exp $ |
// $Id: webserver_auth.module,v 1.13.2.2 2006/03/03 05:06:18 weitzman Exp $ |
| 3 |
|
|
| 4 |
function webserver_auth_init() { |
function webserver_auth_init() { |
| 5 |
global $user, $account; |
global $user, $account; |
| 23 |
$user = user_external_load($account->name); |
$user = user_external_load($account->name); |
| 24 |
if (!$user->uid) { |
if (!$user->uid) { |
| 25 |
if (variable_get("user_register", 1) == 1) { |
if (variable_get("user_register", 1) == 1) { |
| 26 |
$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)); |
| 27 |
// TODO - the hook_user('register') will fire but only for loaded modules. cold be a problem for sites using page cache and that hook+operation |
// TODO - the hook_user('register') will fire but only for loaded modules. cold be a problem for sites using page cache and that hook+operation |
| 28 |
$user = user_save("", array_merge($user_default, (array)$account)); |
$user = user_save("", array_merge($user_default, (array)$account)); |
| 29 |
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")); |