}
$PageTitle = $Lang['Title'];
$SubMenu[0]['Name'] = $Lang['ShowGrpList'];
$SubMenu[0]['Link'] = getURL("my_tracker", "Mode=visitor_grps");
$MenuSection = "my_tracker";
$ProgPath[0]['Name'] = $Lang['MyTracker'];
$ProgPath[0]['Url'] = getUrl("my_tracker", "", "admin");
if (ValidVar($NewIp) && !ValidIpTempl($NewIp)) {
    $Logs->Err($Lang['InvalidIp']);
    $NewIp = false;
}
/////////////////////////////////////////////
///////// call any process functions
if (!$nsUser->DEMO) {
    if (ValidId($EditId) && $NewIp) {
        AddIp($NewIp, $EditId);
    }
    if (ValidId($EditId) && ValidId($DeleteIp)) {
        RemoveIp($DeleteIp, $EditId);
    }
    if (ValidArr($EditArr) && $EditId == "new") {
        CreateNewGrp($EditArr);
    }
    if (ValidArr($EditArr) && ValidId($EditId)) {
        UpdateGrp($EditId, $EditArr);
    }
}
/////////////////////////////////////////////
///////// display section here
if ($EditId == "new") {
    if (!$EditArr) {
         exit(1);
     } elseif ($pid) {
         // parent, close new socket and keep listening
         socket_close($new_socket);
         // clear any previously exited children that are still zombie
         while (pcntl_waitpid(-1, $status, WNOHANG) > 0) {
         }
     } else {
         // child, let's handle the socket command
         $cmd = socket_read($new_socket, 4096, PHP_NORMAL_READ);
         $cmd = trim($cmd);
         print "Command Received: {$cmd} \n";
         $cmd = explode(':', $cmd);
         switch ($cmd[0]) {
             case 'ADDIP':
                 AddIp($cmd[1], $cmd[2]);
                 break;
             case 'CLEARIP':
                 ClearIp($cmd[1], $cmd[2]);
                 break;
             default:
                 print "ERROR: Command not recognized \n";
         }
         // close socket we're done processing
         socket_close($new_socket);
         // and exit so child terminates
         exit(0);
     }
 }
 // close master
 print "Done";
Example #3
0
$CpId = $Visitor->COMPANY_ID;
if (ValidVar($Visitor->NAME)) {
    $ProgPath[1]['Name'] = $Visitor->NAME;
    $ProgPath[1]['Url'] = getUrl("visitor", "CpId={$CpId}&ViewId=" . $Visitor->ID, "admin");
} else {
    $ProgPath[1]['Name'] = $Lang['Visitor'] . " " . $Visitor->ID;
    $ProgPath[1]['Url'] = getUrl("visitor", "CpId={$CpId}&ViewId=" . $Visitor->ID, "admin");
}
/////////////////////////////////////////////
///////// call any process functions
if (!$nsUser->DEMO) {
    if (ValidArr($EditArr)) {
        UpdateVisitor($VisId, $EditArr);
    }
    if (ValidId($Visitor->CLIENT_VIS_ID) && $NewIp) {
        AddIp($NewIp, $Visitor->CLIENT_VIS_ID);
    }
    if (ValidId($Visitor->CLIENT_VIS_ID) && ValidId($DeleteIp)) {
        RemoveIp($DeleteIp, $Visitor->CLIENT_VIS_ID);
    }
}
/////////////////////////////////////////////
///////// display section here
$GrpIpArr = array();
$IpTemplArr = array();
if (ValidId($Visitor->CLIENT_VIS_ID)) {
    $Query = "SELECT ID, IP FROM " . PFX . "_tracker_client_visitor_ip WHERE CLIENT_VISITOR_ID=" . $Visitor->CLIENT_VIS_ID;
    $Sql = new Query($Query);
    $Sql->ReadSkinConfig();
    while ($Row = $Sql->Row()) {
        $Row->_STYLE = $Sql->_STYLE;