Add "Change Password" link to SquirrelMail login page (CODE INCLUDED)

SlashChick

Verified User
Joined
Oct 14, 2003
Messages
54
Hello,

I'd like to see this in a future DirectAdmin release.

I don't expect all of our customers to remember the CMD_CHANGE_EMAIL_PASSWORD link, so I've added a link to the bottom of the SquirrelMail login page that says, quite simply, "Change Your Email Password."

Here's how to add this to your server.

Edit your /var/www/html/squirrelmail/src/login.php file. Right before the
Code:
echo "</body>\n". 
     "</html>\n";
?>

(three lines before the bottom), add:

Code:
echo "<p align=\"center\"><a href=\"http://" . gethostbyaddr (gethostbyname
($SERVER_NAME)) . ":2222/CMD_CHANGE_EMAIL_PASSWORD\">Change Your Email
Password</a></p>";

So the bottom part of src/login.php should look like this:

Code:
do_hook('login_bottom');
echo "<p align=\"center\"><a href=\"http://" . gethostbyaddr (gethostbyname
($SERVER_NAME)) . ":2222/CMD_CHANGE_EMAIL_PASSWORD\">Change Your Email
Password</a></p>";
echo "</body>\n". 
     "</html>\n";
?>

This adds the simple link to change your password (and guesses your hostname properly.) Since it will probably get wiped out if you upgrade DA, I'd like to see this included by default.

Hope this helps!
 
SlashChick said:
This adds the simple link to change your password (and guesses your hostname properly.)
Nice, but add one caveat...

In your code, change http to https if you're using secure logins to your server.

You are using secure logins to your server, aren't you :eek: ?
Since it will probably get wiped out if you upgrade DA, I'd like to see this included by default.
I'd like to see it added by default as well, but the file didn't change since install, so I think it's safe from automatic upgrades.

Squirrelmail upgrades will definitely remove it, but of course you should realize that if you update Squirrelmail you'll have to recreate the change.

Can we get this moved to the How-To section?

Jeff
 
I may get some SM RPMS available soon that will include this, give me a couple of days to get everything sorted out :)

(Going to leave it here for now since it is actually a feature request!)

Chris
 
I leave it to your superior judgement, Chris, but in the meantime it's also a rather neat little How-To; it took me less than five minutes to implement.

Jeff
 
May I ask how this script retrieves the correct hostname? I would like to use this for a different webmail program.
 
Nice, but add one caveat...

In your code, change http to https if you're using secure logins to your server.

You are using secure logins to your server, aren't you ?
Since it will probably get wiped out if you upgrade DA, I'd like to see this included by default.
I'd like to see it added by default as well, but the file didn't change since install, so I think it's safe from automatic upgrades.

Squirrelmail upgrades will definitely remove it, but of course you should realize that if you update Squirrelmail you'll have to recreate the change.

Can we get this moved to the How-To section?

Jeff

It looks like it does not work for assigned IP to customers if they dont have an SSL certificate for their domain name!

I just tryed with the https and IP (single not shared) from one of my customers and it did not work
 
Last edited:
Hi SlashChick,

Thanks for sharing such a great code. It works great for me.

However, I don't know if it's just me but after I put in the email, old password, and new password and hit submit, it takes me directly to the DA login page instead of the webmail login page.

It'd be nice if after we hit submit it either automatically logs us into the webmail or takes us to the webmail login page.

Thanks,
Ben
 
but mine just got subdomain instead of subdomain.com

How do i fix it?

Operating System=Freebsd 4.10
 
Back
Top