ere PARA_NAME=''IP_UNLIMITED_USER''";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$IP_UNLIMITED_USER = $ROW[''PARA_VALUE''];
}
if ( find_id( $IP_UNLIMITED_USER, $USER_ID ) )
{
return TRUE;
}
$query = "select * from IP_RULE where TYPE=''".$TYPE."''";
$cursor = exequery( $connection, $query );
$RULE_COUNT = 0;
$FLAG = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$RULE_COUNT;
$BEGIN_IP = $ROW[''BEGIN_IP''];
$END_IP = $ROW[''END_IP''];
if ( !( ip2long( $BEGIN_IP ) <= ip2long( $USER_IP ) ) && !( ip2long( $USER_IP ) <= ip2long( $END_IP ) ) )
{
continue;
}
$FLAG = 1;
break;
}
if ( $RULE_COUNT == 0 || $FLAG == 1 )
{
return TRUE;
}
return FALSE;
}
function maskstr( $STR, $FIRST, $LAST )
{
if ( is_numeric( $FIRST ) )
{
}
if ( !is_numeric( $LAST ) )
{
return;
}
if ( strlen( $STR ) <= $FIRST + $LAST )
{
return $STR;
}
$RETURN_STR = substr( $STR, 0, $FIRST );
$I = 0;
for ( ; $I < strlen( substr( $STR, $FIRST, 0 - $LAST ) ); ++$I )
{
$RETURN_STR .= "*";
}
$RETURN_STR .= substr( $STR, 0 - $LAST );
return $RETURN_STR;
}
function add_log( $TYPE, $REMARK, $OPERATOR )
{
global $connection;
$CUR_TIME = date( "Y-m-d H:i:s", time( ) );
$USER_IP = get_client_ip( );
if ( $TYPE == 1 )
{
$query = "update USER set LAST_VISIT_IP=''".$USER_IP."'' where USER_ID=''{$OPERATOR}''";
exequery( $connection, $query );
}
else
{
if ( $TYPE == 3 || $TYPE == 4 || $TYPE == 5 )
{
include_once( "inc/itask/itask.php" );
global $DEPT_PARENT;
if ( $TYPE == 3 || $TYPE == 4 )
{
$result = itask( array(
"LOG_".$TYPE." ".$REMARK.",".$DEPT_PARENT
) );
}
$query = "SELECT DEPT_ID,DEPT_NAME from DEPARTMENT where DEPT_ID=''".$REMARK."''";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$DEPT_ID = $ROW[''DEPT_ID''];
$DEPT_NAME = $ROW[''DEPT_NAME''];
}
$REMARK = "{$DEPT_NAME},DEPT_ID={$DEPT_ID},DEPT_PARENT={$DEPT_PARENT}";
if ( $result === FALSE )
{
message( "错误", itask_last_error( ) );
button_back( );
exit( );
}
}
else if ( $TYPE == 6 || $TYPE == 7 || $TYPE == 8 || $TYPE == 11 )
{
include_once( "inc/itask/itask.php" );
global $DEPT_ID;
global $NOT_LOGIN;
if ( $TYPE == 6 || $TYPE == 7 )
{
$result = itask( array(
"LOG_".$TYPE." ".$REMARK.",".$DEPT_ID.",".$NOT_LOGIN
) );
}
$query = "SELECT USER_ID,USER_NAME,DEPT_ID from USER where find_in_set(USER_ID,''".$REMARK."'')";
$cursor = exequery( $connection, $query );
$REMARK = "";
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$USER_ID = $ROW[''USER_ID''];
$USER_NAME = $ROW[''USER_NAME''];
$DEPT_ID = $ROW[''DEPT_ID''];
$query = "SELECT DEPT_NAME from DEPARTMENT where DEPT_ID=''".$DEPT_ID."''";
$cursor1 = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$DEPT_NAME = $ROW[''DEPT_NAME''];
}
$REMARK .= "[".$DEPT_NAME."]{$USER_NAME},USER_ID={$USER_ID}<br>";
}
if ( $result === FALSE )
{
message( "错误", itask_last_error( ) );
button_back( );
exit( );
}
}
}
$REMARK = str_replace( "''", "\\''", $REMARK );
$REMARK = str_replace( "