< turn > PHP page for SVN users to be able to modify their own passwords

Source: Internet
Author: User

1. Modifying the Apache configuration file
Because I was optimizing the Apache configuration file when I was installing and configuring SVN, I wrote all the configuration about SVN in/opt/apache2/conf/extra/httpd-svn.conf, and then the master configuration file/opt/ Apache2/conf/httpd.conf is called by the include conf/extra/httpd-svn.conf method.
Therefore, I need to change here is the/opt/apache2/conf/extra/httpd-svn.conf file, add the following (where the 1,2,6 line, please modify according to the actual situation):

Alias/svntools "/opt/apache2/htdocs/svntools" <directory "/opt/apache2/htdocs/svntools" >Require Valid-userauthtype basicauthname "Gridteam's Subversion Tools" AuthUserFile "/opt/subversion/conf/svn_passwdfile" </Directory>

  

2. Create a PHP page that modifies its own password
Mkdir/opt/apache2/htdocs/svntools
Cd/opt/apache2/htdocs/svntools

Vim svnpass.php
Enter the following (where line 135,136 is modified according to the actual situation):

< $username = $_server["Php_auth_user"]; AuthType Basic Certified user name $authed_pass = $_server["PHP_AUTH_PW"]; AuthType Basic Certified Password $input_oldpass = (isset ($_request["Oldpass"])? $_request["Oldpass"]: ""); The original password entered from the interface $newpass = (isset ($_request["Newpass"])? $_request["Newpass"]: ""); The new password entered on the interface $repeatpass = (isset ($_request["Repeatpass"])? $_request["Repeatpass"]: ""); Duplicate password entered on the interface $action = (Isset ($_request["action"])? $_request["Action"]: ""); The actionif ($action! = "Modify") that was submitted to the server in hide mode {$action = "view";} else if ($authed _pass!= $input _oldpass) {$action = "Oldpasswrong";} else if (empty ($newpass)) {$action = "passempty";} else if ($newpass! = $repeatpass) {$action = "passnotsame";} else{$action = "Modify";}? >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.