<?php
	$acl=$_SESSION["acl"];
	if (strlen($acl)<1 || !strpos($acl,"<0010>")) {	//没有权限
		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
	$timestr=strftime("%Y-%m-%d %H:%M:%S");
	$loginname = trim($_REQUEST["loginname"]);
	if ($loginname!="") {
		$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 users where loginname='".$loginname."' and checked='n'",$db);	//取该用户开号数据
		if ($row = mysql_fetch_array($rs)) {
			echo("该用户密码为：<b>".$row["password"]."</b>");
			mysql_free_result($rs);
			mysql_query( "insert into operation values('".$_SESSION["operator"]."','".$timestr."','查询用户密码，用户ID：".$loginname."')",$db );
		} else {
			mysql_free_result($rs);
			echo("找不到用户ID!");
		}
		mysql_close($db);
	} else {
		echo("必须输入用户ID！");
	}
?>
</b></p>


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

</body>

</html>
