Hi, I added two settings to user.module, giving a little more control over the distributed authentication.
- Textfield 'Default Auth Server': A server to authenticate against if
a) the username entered does not contain the @ sign and there no such local account
b) the setting 'restrict to default server' is set. This will make Drupal ignore anything
after @ in the login and force the usage of the default server.
- Checkbox: 'Restrict to default server': Forces authentication against the default server even if the
user enteres something like user@example.com into the login box.
Local accounts always take precedence. The admin account is local after all and we don't want to be locked out of our site, do we? Works for me with distributed auth via jabber.module.
YMMV. Comments and suggestions welcome.
-silence
854,857c854,862
< // Strip name and server from ID:
< if ($server = strrchr($name, '@')) {
< $name = substr($name, 0, strlen($name) - strlen($server));
< $server = substr($server, 1);
---
> // Handle distributed authentication
> list($name, $server) = explode('@', $name);
>
> if(variable_get(only_default_server, 1) &&
> (variable_get(default_auth_server, '') != '')) {
> $server = variable_get(default_auth_server, '');
> }
> elseif(($server == '') && (variable_get(default_auth_server, '') != '')) {