Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Preselecting a domain when logging in?

Quote Reply
Preselecting a domain when logging in?
I can use the following URL to prefill the username and domain fields (so users don't have to scroll to find their domain from a list), but it reports Auth Error. Is there any way to prefill without getting errors?

http://example.com/cgi-bin/webmail/user/login.cgi?username=jason&domain=example.com

Jason
Quote Reply
Re: [wickedmoon] Preselecting a domain when logging in? In reply to
Without changing code, you can't prefil the Username or Password field without it giving auth errors, as it automatically attempts to authenticate if a username and/or password are provided.

You can easily add some code to the authentication module, so that if you have, say noauth=1, then it won't do the automatic authentication. In admin/GMail/Auth.pm around line 47:

Code:
# User is initially logging in.
if ($IN->param ('username') or $IN->param('password')) {
if (!$IN->param('username')) { return $self->error('AUTHERR_FAILED', 'WARN') }
if (!$IN->param('password')) { return $self->error('AUTHERR_FAILED', 'WARN') }
You can add:

Code:
if ($IN->param('noauth')) {
return;
}
before it checks for username and password, so that it will just return if you have noauth=1. Then you should be able to use:
http://example.com/cgi-bin/webmail/user/login.cgi?username=jason&domain=example.com&noauth=1



Adrian