<?php
header("Content-Type: text/html; charset=gb2312");
/***************************************************************/
$passwdfile="D:\Repositories\htpasswd";
$htpasswdPath = "C:\Program Files\VisualSVN Server\bin\htpasswd.exe";
/***************************************************************/
$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方式提交到服务器的action
if ($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";
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>Subversion 在线自助密码修改</title>
</head>
<body>
<?php
//action=view 显示普通的输入信息
if ($action == "view") {
?>
<script language = "javaScript">
<!--
function loginIn(myform) {
var newpass=myform.newpass.value;
var repeatpass=myform.repeatpass.value;
if (newpass=="") {
alert("请输入密码!");
return false;
}
if (repeatpass=="") {
alert("请重复输入密码!");
return false;
}
if (newpass!=repeatpass) {
alert("两次输入密码不一致,请重新输入!");
return false;
}
return true;
}
//-->
</script>
<style type="text/css">
<!--
table {
border: 1px solid #CCCCCC;
background-color: #f9f9f9;
text-align: center;
vertical-align: middle;
font-size: 9pt;
line-height: 15px;
}
th {
font-weight: bold;
line-height: 20px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-bottom-style: solid;
color: #333333;
background-color: f6f6f6;
}
input{
height: 18px;
}
.button {
height: 20px;
}
-->
</style>
<br><br><br>
<form method="post">
<input type="hidden" name="action" value="modify"/>
<table width="220" cellpadding="3" cellspacing="8" align="center">
<tr>
<th colspan=2>Subversion 密码修改</th>
</tr>
<tr>
<td>用 户 名:</td>
<td align="left"> <?php echo $username?></td>
</tr>
<tr>
<td>原 密 码:</td>
<td><input type=password size=12 name=oldpass></td>
</tr>
<tr>
<td>用户密码:</td>
<td><input type=password size=12 name=newpass></td>
</tr>
<tr>
<td>确认密码:</td>
<td><input type=password size=12 name=repeatpass></td>
</tr>
<tr>
<td colspan=2>
<input onclick="return loginIn(this.form)" class="button" type=submit value="修 改">
<input name="reset" type=reset class="button" value="取 消">
<a href="/"><input name="return" type=button class="button" value="返 回"></a>
</td>
</tr>
</table>
</form>
<?php
} else if ($action == "oldpasswrong") {
$msg="原密码错误!";
} else if ($action == "passempty") {
$msg="请输入新密码!";
} else if ($action == "passnotsame") {
$msg="两次输入密码不一致,请重新输入!";
} else {
// $passwdfile="D:\SVN_Repositories\htpasswd";
// $command='"d:\VisualSVN Server\bin\htpasswd.exe" -b '.$passwdfile." ".$username." ".$newpass;
$command='"'. $htpasswdPath. '" -b '.$passwdfile." ".$username." ".$newpass;
system($command, $result);
if ($result==0) {
$msg_succ="用户[".$username."]密码修改成功,请用新密码登陆.";
} else {
$msg="用户[".$username."]密码修改失败,返回值为".$result.",请和管理员联系!";
}
}
if (isset($msg_succ)) {
?>
<script language="javaScript">
<!--
alert("<?php echo $msg_succ?>");
window.location.href="/"
//-->
</script>
<?php
} else if (isset($msg)) {
?>
<script language="javaScript">
<!--
alert("<?php echo $msg?>");
window.location.href="<?php echo $_SERVER["PHP_SELF"]?>"
//-->
</script>
<?php
}
?>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
VisualSVN3.9自主修改密码
共6个文件
dll:2个
html:1个
exe:1个
4星 · 超过85%的资源 需积分: 32 78 下载量 138 浏览量
2018-09-09
22:40:56
上传
评论 2
收藏 2.75MB RAR 举报
温馨提示
本补丁利用PHP方式实现密码修改,它适用于VisualSVN v3.9.x 64bit版本(实测3.9.1),在Win7 64bit和Windows server 2012/2008/2016系统中测试通过。使用方法,先点stop,再退出,然后文件内全部文件复制到安装目录覆盖即可。你唯一需要修改的是,webui文件里的pwd.php文件第3行和第4行,根据你安装路径和库文件路径修改
资源推荐
资源详情
资源评论
收起资源包目录
VisualSVN改密码3.9.x.rar (6个子文件)
VisualSVN改密码
conf
httpd-custom.conf 211B
php
php5apache2_4.dll 32KB
php5ts.dll 7.97MB
htdocs
WebUI
index.html 3KB
pwd.php 4KB
bin
htpasswd.exe 115KB
共 6 条
- 1
MarkDDi
- 粉丝: 18
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页