首页 >后端开发 >php教程 >svn自助修改密码(PHP脚本实现)

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

WBOY
WBOY原创
2016-06-23 13:30:421848浏览

#创建脚本目录
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>

#重启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>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn