Home > Article > Backend Development > svn自助修改密码(PHP脚本实现)
#创建脚本目录
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>
#创建修改密码的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>