You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.4 KiB
43 lines
1.4 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
|
|
$UID = intval( $CUser->Data['id'] );
|
|
$ACCESS = intval( $CUser->Data['access'] );
|
|
if( isset( $_POST['SAID'] ) ){
|
|
$SITE = intval( $_POST['SAID'] );
|
|
} else $SITE = 0;
|
|
|
|
if( $UID > 1 ){
|
|
if( $SITE == $CUser->Data['selected_site'] ){
|
|
if( $ACCESS > 5 ){
|
|
$QS = "SELECT `id` FROM `nodes` WHERE `site_id`={$SITE}";
|
|
$Nodes = $DATABASE->Query( $QS );
|
|
foreach( $Nodes as $Node ) deleteNode( $Node['id'] );
|
|
$QS = "INSERT INTO `access_log` SET `ts`=NOW(), `user_id`={$UID}, `cmd`=255";
|
|
$DATABASE->Query( $QS );
|
|
// Restart Setver(s)
|
|
$QS = "SELECT * FROM `nodes` WHERE `site_id`={$SITE} AND `type`=0";
|
|
$SR = $DATABASE->Query( $QS );
|
|
foreach( $SR as $S ){
|
|
$QS = "INSERT INTO `nodes_qcq` SET `node_id`={$S['id']}, `cmd`=245";//251";
|
|
$DATABASE->Query( $QS );
|
|
};
|
|
$Data['notifications'] = array();
|
|
$Data['status']='OK';
|
|
} else {
|
|
// Log Security Treat!
|
|
$QS = "INSERT INTO `access_log` SET `ts`=NOW(), `user_id`={$UID}, `cmd`=13, `dataset`='{\"action\":255}'";
|
|
$DATABASE->Query( $QS );
|
|
$Data['notifications'] = array();
|
|
$Data['status']='ACCESS';
|
|
};
|
|
} else {
|
|
$Data['notifications'] = array();
|
|
$Data['status']='LOGOUT';
|
|
};
|
|
} else {
|
|
$Data['notifications'] = array();
|
|
$Data['status']='LOGOUT';
|
|
};
|
|
echo json_encode( $Data );
|
|
?>
|