PDA

View Full Version : Add "Change Password" link to SquirrelMail login page (CODE INCLUDED)



SlashChick
07-09-2004, 11:15 AM
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

echo "</body>\n".
"</html>\n";
?>

(three lines before the bottom), add:


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:


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!

nobaloney
07-09-2004, 11:45 AM
Originally posted by SlashChick
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: ?
[quote]Since it will probably get wiped out if you upgrade DA, I'd like to see this included by default.[quote]
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

ProWebUK
07-09-2004, 11:54 AM
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

nobaloney
07-09-2004, 12:36 PM
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

ProWebUK
07-09-2004, 01:32 PM
Ive copied it there (and left this one here).

Chris

rldev
08-07-2004, 07:13 PM
May I ask how this script retrieves the correct hostname? I would like to use this for a different webmail program.

SlashChick
08-10-2004, 01:56 AM
Hi rldev,

Try



<?php
echo gethostbyaddr (gethostbyname ($SERVER_NAME));
?>

rldev
08-10-2004, 06:30 AM
Thanks, I will give it a try.

dec
08-20-2004, 06:59 AM
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 ?
[quote]Since it will probably get wiped out if you upgrade DA, I'd like to see this included by default.[quote]
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

anewbie2
10-10-2004, 01:27 PM
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

brew
11-22-2004, 10:35 PM
but mine just got subdomain instead of subdomain.com

How do i fix it?

Operating System=Freebsd 4.10