Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: HOWTO: Add a 'Change Password' button to SquirrelMail

  1. #1
    Join Date
    Mar 2005
    Location
    Melbourne, Australia
    Posts
    170

    HOWTO: Add a 'Change Password' button to SquirrelMail

    Many users want a quick and easy way to change their Email password.

    This patch allows you to change the login form of SquirrelMail so a 'Change Password' button appears.

    Example: http://img363.imageshack.us/img363/2343/webmail7ii.png

    [list=1][*]cd /var/www/html/squirrelmail/src[*]vi login.php[*]Look for the following
    Code:
    <center>'. addSubmit(_("Login"))
    [*]Replace the line with:
    Code:
    '<center>'. addSubmit(_("Login")) .'<INPUT TYPE=button VALUE="Change Password" onClick="window.location.href=\'http://' .  $_SERVER['HTTP_HOST'] . ':2222/CMD_CHANGE_EMAIL_PASSWORD\'"></center>',
    [*]Save the file and exit.[/list=1]

    Reload the Webmail system and you should be set.

  2. #2
    Join Date
    Aug 2005
    Posts
    5
    Can't seem to get this to work?

  3. #3
    Join Date
    May 2004
    Location
    Nebraska
    Posts
    116
    Code won't display right, see attachment in next post

    Louie
    Last edited by louie55; 11-21-2005 at 10:06 AM.

  4. #4
    Join Date
    May 2004
    Location
    Nebraska
    Posts
    116
    There are some problems with the quote marks. (Actually, you probably had the same problems as me. The forum won't display the escape character slashes!).

    Attached is the text that you need to change. It works, I've tested it.

    Louie
    Attached Files Attached Files

  5. #5
    Join Date
    Aug 2005
    Posts
    5
    I have this exactly now:

    Code:
                        html_tag( 'td',
                            '<center>'. addSubmit(_("Login")) .'<INPUT TYPE=button VALUE="Change Password" onClick="window.location.href='http://' . $_SERVER['HTTP_HOST'] . ':2222/CMD_CHANGE_EMAIL_PASSWORD'"></center>',
                        'left' )
    I still get this error:

    Parse error: parse error, unexpected T_STRING in /var/www/html/squirrelmail-1.4.4/src/login.php on line 147

    Any help?

    Thanks!

  6. #6
    Join Date
    Aug 2005
    Posts
    5
    Ahh.. now it works!

    Thank you very much!

    Cheers!
    - Szern

  7. #7
    Join Date
    Mar 2005
    Location
    Melbourne, Australia
    Posts
    170
    Sorry guys...

    I've been away a few days.

    It appears you've all got it worked out.

    If you are still having difficulties... I've included by modified login.php file for you to use.

    I recommend you do a 'diff' against your current one to see the variations.

    Good luck!
    Attached Files Attached Files

  8. #8
    Join Date
    Jul 2004
    Posts
    13
    I do have a real quick question... Is there a way to make it come back to webmail login screen after it changes password instead of the directadmin login screen?

    Other then that... works great! DA should add this.

  9. #9
    Join Date
    May 2004
    Posts
    1,074
    This button would allow anyone to change a password for an email account. What am I missing?

  10. #10
    Join Date
    Jun 2003
    Location
    California
    Posts
    26,123
    In order to change the password they have to know the old password. That's the traditional information needed to change a password in most systems. What would you prefer they be asked to identify themselves? Their mother's maiden name ?

    Jeff
    +1 951 643-5345
    Third-Party DirectAdmin administration and support
    Dedicated Servers, Dedicated Reseller Accounts
    NoBaloney Internet Services div. Qnito Incorporated
    848 North Rainbow Blvd., Suite #3789
    Las Vegas, NV 89107-1103

  11. #11
    Join Date
    May 2004
    Posts
    1,074
    From the example above, I did not see where it asked for your current password. Perhaps the code did not work in my login page because all that happens when I hit change password, is it routes me to the DA login screen.

    J you're in the wrong field. There's a few spots at the comic strip waiting for you

  12. #12
    Join Date
    Jun 2003
    Location
    California
    Posts
    26,123
    It should have rerouted you to the da change email password screen, which asks for the old password.

    Yes, I used to write comedy, for a friend who was a commediane.

    Jeff
    +1 951 643-5345
    Third-Party DirectAdmin administration and support
    Dedicated Servers, Dedicated Reseller Accounts
    NoBaloney Internet Services div. Qnito Incorporated
    848 North Rainbow Blvd., Suite #3789
    Las Vegas, NV 89107-1103

  13. #13
    Join Date
    May 2004
    Posts
    1,074
    I will try it again, it simply redirected me to the DA login, not the change password screen.

  14. #14
    Join Date
    Jun 2003
    Location
    California
    Posts
    26,123
    rldev,

    I didn't realize you were referring to a php file attached to the thread .

    I have no idea of how that thread works.

    My own squirrelmail page at da1.namelessnet.net/squirrelmail will show you how I did it.

    Jeff
    +1 951 643-5345
    Third-Party DirectAdmin administration and support
    Dedicated Servers, Dedicated Reseller Accounts
    NoBaloney Internet Services div. Qnito Incorporated
    848 North Rainbow Blvd., Suite #3789
    Las Vegas, NV 89107-1103

  15. #15
    Join Date
    Apr 2006
    Location
    Thailand
    Posts
    200
    String is closed with ' to use it as string value use \' , try this (worked fine to me)

    Code:
    '<center>'. addSubmit(_("Login")) .'<INPUT TYPE=button VALUE="Change Password" onClick="window.location.href=\'http://' . $_SERVER['HTTP_HOST'] . ':2222/CMD_CHANGE_EMAIL_PASSWORD\';">'.'</center>',
    PS. if you use secure connection (https) on DA you must use https instread http in the code above.

    Last edited by kke; 07-06-2006 at 02:00 AM.

  16. #16
    Join Date
    Dec 2007
    Posts
    7
    Hi folks,


    Ubuntu 7.04 server amd64


    Just found this thread on googling.

    Replaced louie55's squirrel-mail-pass-button.txt on /usr/local/squirrelmail/www/src/login.php


    Started SquirrelMail on Firefox;

    https://localhost/squirrelmail

    Typed in Name and Password.

    on clicking [Change Password] popup
    Code:
    Unable to connect         
    
    Firefox can't establish a connection to the server at localhost:2222.
    Would it be port 2222 blocked up ISP ???

    $ telnet localhost 2222
    Code:
    Trying 127.0.0.1...
    telnet: Unable to connect to remote host: Connection refused
    Can I use another port?

    TIA


    B.R.
    satimis

  17. #17
    Join Date
    Jun 2003
    Location
    California
    Posts
    26,123
    localhost refers to the local machine. When you use localhost from firefox it doesn't try the DirectAdmin server; it tries your desktop system.

    Jeff
    +1 951 643-5345
    Third-Party DirectAdmin administration and support
    Dedicated Servers, Dedicated Reseller Accounts
    NoBaloney Internet Services div. Qnito Incorporated
    848 North Rainbow Blvd., Suite #3789
    Las Vegas, NV 89107-1103

  18. #18
    Join Date
    Dec 2007
    Posts
    7
    Quote Originally Posted by jlasman View Post
    localhost refers to the local machine. When you use localhost from firefox it doesn't try the DirectAdmin server; it tries your desktop system.
    Hi Jeff,


    Thanks for your advice.


    https://domain.com/squirrelmail
    and
    https://localhost/squirrelmail

    same situation starts squirrel webmail. Clicking "Change Password" with following notice popup finally,
    Code:
    Unable to connect
    
    Firefox can't establish a connection to the server at domain.com:2222.(or localhost:2222)

    Each day switch on the PC the 1st time and run;

    https://domain.com/squirrelmail
    OR
    https://localhost/squirrelmail

    following warning popup
    Code:
    Following warning popup;
    Security
    security Error: Domain Name Mismatch
    You have attempted to establish a connection with
    "www.domain.com".  However, the security certificate
    presented belongs to "localhost".  It is possible though
    unlikely, that someone may be trying to intercept your
    communication with this website.
    
    
    If you suspect the certicate shown does not belong to
    "www.domain.com". please cancel the connection and notify
    the site administrator.
    
    [Vies Certificate]     [Cancel]  [OK]
    Clicking [OK] starts squirrel webmin. The webmail works fine w/o problem.

    Whether I have to buy a security certificate?


    Any suggestion to try? TIA


    B.R.
    satimis

  19. #19
    Join Date
    Jun 2003
    Location
    California
    Posts
    26,123
    None of your links point to your server so there's no way to look at your configuration.

    Jeff
    +1 951 643-5345
    Third-Party DirectAdmin administration and support
    Dedicated Servers, Dedicated Reseller Accounts
    NoBaloney Internet Services div. Qnito Incorporated
    848 North Rainbow Blvd., Suite #3789
    Las Vegas, NV 89107-1103

  20. #20
    Join Date
    Dec 2007
    Posts
    7
    Quote Originally Posted by jlasman View Post
    None of your links point to your server so there's no way to look at your configuration.
    Hi Jeff,


    This box is for testing only. I must run "iptables -F" to flush the rules otherwise squirrelmail can't work on Internet.

    Please advise which configuration you need to check. I'll post it on the forum. Thanks.


    satimis
    Last edited by satimis; 12-06-2007 at 07:17 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 08-25-2009, 08:41 PM
  2. Replies: 1
    Last Post: 04-18-2009, 04:31 AM
  3. squirrelmail change password
    By prashantbhushan in forum E-Mail
    Replies: 0
    Last Post: 08-18-2006, 10:07 PM
  4. squirrelmail change password plugin
    By namu in forum E-Mail
    Replies: 3
    Last Post: 06-27-2006, 01:43 AM
  5. Squirrelmail - user change password ?
    By rszkutak in forum E-Mail
    Replies: 10
    Last Post: 09-26-2005, 12:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •