📄 add.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/reg_check.php" );
include_once( "inc/utility_all.php" );
if ( $OA_REG_ON != 2 )
{
exit( );
}
echo "\r\n<html>\r\n<head>\r\n<title>增加用户</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n\r\n";
$connection = openconnection( );
$OA_USER_LIMIT = 5;
is_registered( );
if ( !$IS_REGISTERED_MYOA )
{
$query = "select count(*) from USER";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$USER_COUNT = $ROW[0];
if ( $OA_USER_LIMIT <= $USER_COUNT )
{
message( "提示", "已经达到系统的最大授权用户数(".$OA_USER_LIMIT."),不能再增加用户" );
button_back( );
exit( );
}
}
}
if ( strstr( $USER_ID, "\\'" ) != false )
{
message( "错误", "用户名中含有非法字符" );
button_back( );
exit( );
}
if ( strstr( $PASSWORD, "\\'" ) != false )
{
message( "错误", "密码中含有非法字符" );
button_back( );
exit( );
}
$query = "select * from USER where USER_ID='{$USER_ID}'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
message( "错误", "用户 ".$USER_ID." 已存在" );
button_back( );
exit( );
}
$PASSWORD = crypt( $PASSWORD );
$query = "insert into USER (USER_ID,USER_NAME,SEX,PASSWORD,USER_PRIV,POST_PRIV,CANBROADCAST,DEPT_ID,AVATAR,CALL_SOUND,DUTY_TYPE,SMS_ON,MENU_HIDE) values ('{$USER_ID}','{$USER_NAME}','{$SEX}','{$PASSWORD}','{$USER_PRIV}','{$POST_PRIV}','{$CANBROADCAST}','{$DEPT_ID}','1','1','{$DUTY_TYPE}','1','2')";
exequery( $connection, $query );
if ( $POST_PRIV == "2" )
{
$query = "update USER set POST_DEPT='{$TO_ID}' where USER_ID='{$USER_ID}'";
exequery( $connection, $query );
}
add_log( 6, $USER_ID, $LOGIN_USER_ID );
echo "\r\n";
echo "<s";
echo "cript>\r\nparent.user_list.location.reload();\r\nlocation=\"user_new.php?DEPT_ID=";
echo $DEPT_ID;
echo "\";\r\n</script>\r\n\r\n</body>\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -