I need to modify user login name in the front login page like this: replace @ with __ (2 underscores) replace . with _ (1 underscore).
I look at src/login.php but don't know where to start. I don't know PHP and really appreciate for any helps.
I am hosting multiple virtual domains with Sendmail (virtusertable) and Dovecot for IMAP. I want to modify the login name to have the it automatically changed (by login.php) to the real local account as specified in the virtusertable of Sendmail.
For example, the virtusertable looks like: [EMAIL PROTECTED] client1__domain1_com
and end users just log in SM using [EMAIL PROTECTED] as login name and password of local account client1__domain1_com
I think it's a simple job but I don't know PHP. I read the PHP manual and
played with the script src/login.php using str_replace() and $loginnam and
$loginname_value like this:
$loginname = str_replace("@", "__", $loginname);
$loginname = str_replace(".", "_", $loginname);
$loginname_value = (sqGetGlobalVar('loginname', $loginname) ?
htmlspecialchars($loginname) : '');
Looks like you're not doing things in the correct order. Send exact code if you need help, although doing this as a plugin will allow you to upgrade SM without having to re-hack the upgraded code.
I also tried the virtusertable plug-in but it doesn't work either. Still saying "Unknown user or password incorrect."
Vlogin can also use your sendmail virtualusertable and is also more powerful.
You can use vlogin to do this, although you could argue that vlogin gives you a lot more than you need. You'd need to turn off all other vlogin functionality.
http://www.squirrelmail.org/plugin_view.php?id=47
It would also be quite easy to use the same approach that vlogin does to modifying the username. You could strip down vlogin to a mere few lines to do what you need.
Thanks for your suggestion. I haven't tried vlogin. I thought it might be overkill for what I need. If I can get either virtusertable or modifying src/login.php worked, I will try vlogin plugin.
Vlogin has the added bonus that your users can just log in with "client1" and the domain information will be added automatically from the URL.
- Paul
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
--
squirrelmail-users mailing list
List Address: [EMAIL PROTECTED]
List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
