📄 auth_addauth.php
字号:
<?php
include( "../config.inc.php" );
include( "../includes/SysGlobal.php" );
include( "language/".$aLan."_".$charset.".php" );
include( "../includes/version.php" );
include( "../includes/pro.php" );
include( "func/adm.inc.php" );
include( "func/common.inc.php" );
include( "func/db.inc.php" );
include( "func/nocatch.php" );
needauth( 3 );
echo "<html>\r\n<head >\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=";
echo $charset;
echo "\">\r\n<link id=\"style_sheet\" href=\"css/commonstyle.css\" type=\"text/css\" rel=\"stylesheet\">\r\n<title>";
echo $strAdminTitle;
echo "</title>\r\n</head>\r\n\r\n<body class=\"NormalPage\">\r\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" background=\"images/mu8.gif\" height=\"30\" >\r\n <tr> \r\n <td width=\"150\" > <img src=\"images/bar.gif\"> ";
echo $strAuthNew;
echo "</td>\r\n <td > </td> <td width=\"100\" > </td>\r\n </tr>\r\n </table>\r\n";
$step = $_REQUEST['step'];
$user = $_REQUEST['user'];
$password = $_REQUEST['password'];
$name = $_REQUEST['name'];
if ( $step == "add" )
{
if ( $user != "" && $password != "" )
{
$msql->query( "select * from {$tbl_admin} where user='{$user}'" );
if ( $msql->next_record( ) )
{
err( $strAuthNTC1, "", "" );
}
$mdpass = md5( $password );
$msql->query( "insert into {$tbl_admin} values(\r\n\t\t0,\r\n\t\t'{$user}',\r\n\t\t'{$mdpass}',\r\n\t\t'{$name}',\r\n\t\t'1'\r\n\t\t)" );
$msql->query( "delete from {$tbl_admin_rights} where user='{$user}'" );
$msql->query( "select * from {$tbl_admin_auth}" );
while ( $msql->next_record( ) )
{
$auth_auth = $msql->f( "auth" );
$vStr = "a".$auth_auth;
if ( $_POST[$vStr] == "1" )
{
$fsql->query( "insert into {$tbl_admin_rights} values(0,'{$auth_auth}','{$user}')" );
}
}
sayok( $strAuthNTC2, "", "" );
}
else
{
err( $strAuthNTC3, "", "" );
}
}
else
{
echo " \r\n<form method=\"post\" action=\"auth_addauth.php\">\r\n <table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" height=\"22\">\r\n <tr> \r\n <td class=title align=\"left\" height=\"22\" valign=\"top\" width=\"3\"><img src=\"images/menubg16.gif\" width=\"3\" height=\"30\"></td>\r\n <td class=title align=\"center\" height=\"22\" colspan=\"2\">";
echo $strAuthNew;
echo "</td>\r\n <td class=title align=\"right\" height=\"22\" width=\"3\" valign=\"top\"><img src=\"images/menubg17.gif\" width=\"3\" height=\"30\"></td>\r\n </tr>\r\n </table>\r\n <table width=\"500\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" align=\"center\">\r\n <tr> \r\n <td width=\"150\" class=title> \r\n <div align=\"right\">";
echo $strAuthUser;
echo "</div>\r\n </td>\r\n <td class=con> \r\n <input type=\"text\" name=\"user\" class=input style=\"width:150px\">\r\n </td>\r\n </tr>\r\n <tr> \r\n <td width=\"150\" class=title> \r\n <div align=\"right\">";
echo $strAuthPass;
echo "</div>\r\n </td>\r\n <td class=con> \r\n <input type=\"password\" name=\"password\" class=input style=\"width:150px\">\r\n </td>\r\n </tr>\r\n <tr> \r\n <td width=\"150\" class=title> \r\n <div align=\"right\">";
echo $strAuthUserName;
echo "</div>\r\n </td>\r\n <td class=con> \r\n <input type=\"text\" name=\"name\" class=input style=\"width:150px\">\r\n </td>\r\n </tr>\r\n </table>\r\n <table width=\"498\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" height=\"10\" background=\"images/mu1.jpg\">\r\n <tr> \r\n <td align=\"center\" height=\"2\" colspan=\"2\"></td>\r\n </tr>\r\n </table>\r\n <table width=\"500\" border=\"0\" cellspacing=\"1\" c";
echo "ellpadding=\"4\" align=\"center\">\r\n <tr> \r\n <td colspan=\"5\" class=title height=\"26\"> \r\n <div align=\"center\">";
echo $strAuthSet;
echo "</div>\r\n </td>\r\n </tr><tr> \r\n \r\n <td width=\"50\" class=title align=\"center\">";
echo $strAuth;
echo "</td>\r\n \r\n <td class=title width=\"50\" align=\"center\">";
echo $strNumber;
echo "</td>\r\n \r\n <td class=title width=\"150\" align=\"center\">";
echo $strAuthGroup;
echo "</td>\r\n\r\n \r\n <td class=title align=\"center\">";
echo $strAuthName;
echo "</td>\r\n \r\n </tr>\r\n";
$msql->query( "select * from {$tbl_admin_auth} order by pid,xuhao" );
while ( $msql->next_record( ) )
{
$auth_auth = $msql->f( "auth" );
$auth_name = $msql->f( "name" );
$auth_intro = $msql->f( "intro" );
$auth_pname = $msql->f( "pname" );
echo " \r\n <tr> \r\n \r\n <td width=\"50\" class=title align=\"center\"> \r\n <input type=\"checkbox\" name=\"a";
echo $auth_auth;
echo "\" value=\"1\" >\r\n </td>\r\n <td class=con width=\"50\" align=\"center\">";
echo "{$auth_auth}";
echo "</td>\r\n <td class=con width=\"150\" align=\"center\">";
echo "{$auth_pname}";
echo "</td>\r\n \r\n <td class=con align=\"center\">";
echo "{$auth_name}";
echo "</td>\r\n \r\n </tr>\r\n ";
}
echo " \r\n <tr> \r\n <td colspan=\"5\" class=title> \r\n <div align=\"center\"> \r\n <input type=\"submit\" name=\"cc\" value=\"";
echo $strSubmit;
echo "\" class=button>\r\n <input type=\"hidden\" name=\"step\" value=\"add\">\r\n </div>\r\n </td>\r\n </tr>\r\n </table>\r\n <table width=\"498\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" height=\"10\" background=\"images/mu1.jpg\">\r\n <tr> \r\n <td align=\"center\" height=\"2\" colspan=\"2\"></td>\r\n </tr>\r\n </table>\r\n</form>\r\n";
}
echo " \r\n<p align=\"center\"></p>\r\n \r\n </body>\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -