<?php
	$acl=$_SESSION["acl"];
	if (strlen($acl)<1 || !strpos($acl,"<0013>")) {	//没有权限
		ob_clean();
		header("Location: ../accesserror.html");
		exit;
	}
?>


<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>操作员密码修改响应</title>
</head>

<body background="../bkg.bmp">

<p align="center"><font size="5"><b>操作员密码修改响应</b></font></p>
<hr color="#999966">


<p align="center">
<b>
<?php
	$operator = $_SESSION["operator"];
	$password1 = trim($_REQUEST["password1"]);
	$password2 = trim($_REQUEST["password2"]);
	$password3 = trim($_REQUEST["password3"]);
	if ($operator!="") {
		if ($password2==$password3) {
			$db=mysql_pconnect(get_cfg_var("SIPSERVER"),get_cfg_var("SIPUSER"),get_cfg_var("SIPPWD")); 
			mysql_select_db(get_cfg_var("SIPDB"),$db);
			$rs = mysql_query("select password from operators where operator='".$operator."'",$db);
			if ($row = mysql_fetch_array($rs)) {	//有该操作员ID
				if ($password1==$row["password"]) {
					mysql_free_result($rs);
					mysql_query( "update operators set password='".$password2."' where operator='".$operator."'",$db );
					echo("密码修改成功！<br><br>");
					echo("请记住您的新密码！");
				}
				else {
					mysql_free_result($rs);
					echo("原密码错误，不能进行修改!");
				}
			}
			else {
				mysql_free_result($rs);
				echo("找不到操作员ID!");
			}
			mysql_close($db);
		}
		else {
			echo("新密码和确认新密码不符!");
		}
	}
	else {
		echo("您还没有登录！请登录后再修改密码！");
	}
?>
</b></p>


<hr>
<p align="center">SIP酒店上网计费管理系统</p>
<p align="center">作者：<b>深圳市飞沃软件有限公司</b></p>

</body>

</html>
