Home > Backend Development > PHP Tutorial > svn自助修改密码(PHP脚本实现)

svn自助修改密码(PHP脚本实现)

WBOY
Release: 2016-06-23 13:30:42
Original
1846 people have browsed it

#创建脚本目录
mkdir -p /var/www/svn/svntools
#创建apache配置文件
touch /etc/httpd/conf.d/alias.conf

#输入以下内容:

Alias /svntools "/var/www/svn/svntools"<directory>        Require valid-user        AuthType Basic        AuthName "svn tools"        AuthUserFile "/var/www/svn/project/conf/passwd"</directory>
Copy after login

#重启apache服务
service httpd restart

#创建修改密码的php脚本$username = $_SERVER["PHP_AUTH_USER"]; //经过 AuthType Basic 认证的用户名$authed_pass = $_SERVER["PHP_AUTH_PW"]; //经过 AuthType Basic 认证的密码$input_oldpass = (isset($_REQUEST["oldpass"]) ? $_REQUEST["oldpass"] : ""); //从界面上输入的原密码$newpass = (isset($_REQUEST["newpass"]) ? $_REQUEST["newpass"] : ""); //界面上输入的新密码$repeatpass = (isset($_REQUEST["repeatpass"]) ? $_REQUEST["repeatpass"] : ""); //界面上输入的重复密码$action = (isset($_REQUEST["action"]) ? $_REQUEST["action"] : ""); //以hide方式提交到服务器的actionif($action!="modify"){$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";}?><meta http-equiv="Content-Type" content="text/html; charset=GBK"><title>Subversion 鍦ㄧ嚎鑷</title>
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template