function stop($aspid = false) { $unix = new unix(); if (!$aspid) { $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid"; $pid = $unix->get_pid_from_file($pidfile); if ($unix->process_exists($pid, basename(__FILE__))) { $time = $unix->PROCCESS_TIME_MIN($pid); if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, Service Already Artica task running PID {$pid} since {$time}mn\n"; } return; } @file_put_contents($pidfile, getmypid()); } DisableClient(); if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, Unlinked from the proxy...\n"; } }
case 'save_client': $client_id = $_REQUEST['id']; $arr = array("rs_id" => $_REQUEST['ri'], "name" => htmlspecialchars($_REQUEST['n'], ENT_QUOTES), "address" => htmlspecialchars($_REQUEST['a'], ENT_QUOTES), "legal_status" => $_REQUEST['ls'], "pay_method" => $_REQUEST['pm'], "vat_payer" => $_REQUEST['vp'], "contact_person" => htmlspecialchars($_REQUEST['cp'], ENT_QUOTES), "phone_number" => htmlspecialchars($_REQUEST['pn'], ENT_QUOTES), "mail" => htmlspecialchars($_REQUEST['m'], ENT_QUOTES), "comment" => htmlspecialchars($_REQUEST['c'], ENT_QUOTES), 'image' => $_REQUEST['img']); if ($client_id == '') { if (!CheckClientExist($arr['rs_id'])) { AddClient($user_id, $arr); } else { $error = '"' . $arr['name'] . '" უკვე არის სიაში!'; } } else { SaveClient($client_id, $user_id, $arr); } break; case 'disable': $client_id = $_REQUEST['id']; DisableClient($client_id); break; case 'delete_image': $client_id = $_REQUEST['id']; DeleteImage($client_id); break; case 'get_local_id': $local_id = GetLocalID(); $data = array('local_id' => $local_id); break; case 'clear_db': ClearDB(); break; case 'clear': $file_list = $_REQUEST['file']; if (!empty($file_list)) {