Skip to content

Commit ee204e8

Browse files
committed
Minor updates
1 parent 0bcaf3f commit ee204e8

File tree

4 files changed

+25
-40
lines changed

4 files changed

+25
-40
lines changed

lib/general.class.php

-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
&& HOME_NETWORK != ''
1414
&& !isset($argv[0])
1515
&& isset($_SERVER['REQUEST_URI'])
16-
&& (!(
17-
preg_match('/^\/gps\.php/is', $_SERVER['REQUEST_URI']) ||
18-
preg_match('/^\/trackme\.php/is', $_SERVER['REQUEST_URI']) ||
19-
preg_match('/^\/rss\.php/is', $_SERVER['REQUEST_URI'])
20-
))
2116
) {
2217
$p = preg_quote(HOME_NETWORK);
2318
$p = str_replace('\*', '\d+?', $p);

lib/objects.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ function addToOperationsQueue($topic, $dataname, $datavalue = '', $uniq = false,
14511451
$rec = array();
14521452
$rec['TOPIC'] = $topic;
14531453
$rec['DATANAME'] = $dataname;
1454-
if (strlen($datavalue) < 255) {
1454+
if (strlen($datavalue) < 1024) {
14551455
$rec['DATAVALUE'] = $datavalue;
14561456
}
14571457
$rec['EXPIRE'] = date('Y-m-d H:i:s', time() + $ttl);

modules/application.class.php

+15-26
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class application extends module
1717
function __construct()
1818
{
1919
$this->name = "application";
20-
$this->doc_name = '';
21-
$this->doc = '';
2220
$this->app_action = '';
2321
$this->popup = false;
2422
}
@@ -31,9 +29,6 @@ function saveParams($data = 1)
3129
if (isset($this->action) && $this->action) {
3230
$p["action"] = $this->action;
3331
}
34-
if (isset($this->doc_name) && $this->doc_name) {
35-
$p['doc_name'] = $this->doc_name;
36-
}
3732
if (isset($this->ajax) && $this->ajax) {
3833
$p['ajax'] = $this->ajax;
3934
}
@@ -49,7 +44,7 @@ function saveParams($data = 1)
4944
// --------------------------------------------------------------------
5045
function getParams()
5146
{
52-
global $action;
47+
$action = gr('action');
5348
if ($action != '') $this->action = $action;
5449
}
5550

@@ -75,17 +70,19 @@ function run()
7570
if ($this->action == 'ajaxgetglobal') {
7671
header("HTTP/1.0: 200 OK\n");
7772
header('Content-Type: text/html; charset=utf-8');
78-
$_GET['var'] = str_replace('%', '', $_GET['var']);
79-
$res['DATA'] = getGlobal($_GET['var']);
73+
$var = gr('var');
74+
$var = str_replace('%', '', $var);
75+
$res['DATA'] = getGlobal($var);
8076
echo json_encode($res);
8177
exit;
8278
}
8379

8480
if ($this->action == 'ajaxsetglobal') {
8581
header("HTTP/1.0: 200 OK\n");
8682
header('Content-Type: text/html; charset=utf-8');
87-
$_GET['var'] = str_replace('%', '', $_GET['var']);
88-
setGlobal($_GET['var'], $_GET['value']);
83+
$var = gr('var');
84+
$var = str_replace('%', '', $var);
85+
setGlobal($var, gr('value'));
8986
$res['DATA'] = 'OK';
9087
echo json_encode($res);
9188
exit;
@@ -162,10 +159,8 @@ function sortFiles($a, $b)
162159

163160
$out["ACTION"] = $this->action;
164161
$out["TODAY"] = date('l, F d, Y');
165-
$out["DOC_NAME"] = $this->doc_name;
166-
167-
global $username;
168162

163+
$username = gr('username');
169164
if ($username) {
170165
$user = SQLSelectOne("SELECT * FROM users WHERE USERNAME LIKE '" . DBSafe($username) . "'");
171166
if (hash('sha512', '') == $user['PASSWORD']) {
@@ -190,7 +185,8 @@ function sortFiles($a, $b)
190185
}
191186
}
192187
}
193-
global $terminal;
188+
189+
$terminal = gr('terminal');
194190
if ($terminal) {
195191
$session->data['TERMINAL'] = $terminal;
196192
}
@@ -219,7 +215,7 @@ function sortFiles($a, $b)
219215
if ($terminals[$i]['HOST'] != '' && $_SERVER['REMOTE_ADDR'] == $terminals[$i]['HOST'] && !$session->data['TERMINAL']) {
220216
$session->data['TERMINAL'] = $terminals[$i]['NAME'];
221217
}
222-
if (mb_strtoupper($terminals[$i]['NAME'], 'UTF-8') == mb_strtoupper(isset($session->data['TERMINAL'])?$session->data['TERMINAL']:'', 'UTF-8')) {
218+
if (mb_strtoupper($terminals[$i]['NAME'], 'UTF-8') == mb_strtoupper(isset($session->data['TERMINAL']) ? $session->data['TERMINAL'] : '', 'UTF-8')) {
223219
$terminals[$i]['LATEST_ACTIVITY'] = date('Y-m-d H:i:s');
224220
$terminals[$i]['IS_ONLINE'] = 1;
225221
SQLUpdate('terminals', $terminals[$i]);
@@ -259,7 +255,7 @@ function sortFiles($a, $b)
259255
$users = SQLSelect("SELECT * FROM users ORDER BY NAME");
260256
$total = count($users);
261257
for ($i = 0; $i < $total; $i++) {
262-
if ($users[$i]['USERNAME'] == (isset($session->data['SITE_USERNAME'])?$session->data['SITE_USERNAME']:'')) {
258+
if ($users[$i]['USERNAME'] == (isset($session->data['SITE_USERNAME']) ? $session->data['SITE_USERNAME'] : '')) {
263259
$users[$i]['SELECTED'] = 1;
264260
$out['USER_TITLE'] = $users[$i]['NAME'];
265261
$out['USER_AVATAR'] = $users[$i]['AVATAR'];
@@ -284,7 +280,7 @@ function sortFiles($a, $b)
284280
$session->data['SITE_USERNAME'] = $out['DEFAULT_USERNAME'];
285281
$session->data['SITE_USER_ID'] = $out['DEFAULT_USER_ID'];
286282
for ($i = 0; $i < $total; $i++) {
287-
if ($users[$i]['USERNAME'] == (isset($session->data['USERNAME'])?$session->data['USERNAME']:'')) {
283+
if ($users[$i]['USERNAME'] == (isset($session->data['USERNAME']) ? $session->data['USERNAME'] : '')) {
288284
$users[$i]['SELECTED'] = 1;
289285
$out['USER_TITLE'] = $users[$i]['NAME'];
290286
$out['USER_AVATAR'] = $users[$i]['AVATAR'];
@@ -328,13 +324,6 @@ function sortFiles($a, $b)
328324
$out['TOTAL_LAYOUTS'] = 0;
329325
}
330326

331-
if ($this->doc) {
332-
$this->doc_id = $this->doc;
333-
} else {
334-
$this->doc_id = false;
335-
}
336-
$out["DOC_ID"] = $this->doc_id;
337-
338327
if (isset($session->data['MY_MEMBER']) && $session->data['MY_MEMBER']) {
339328
$out['MY_MEMBER'] = $session->data['MY_MEMBER'];
340329
$tmp = SQLSelectOne("SELECT ID FROM users WHERE ID='" . (int)$out['MY_MEMBER'] . "' AND ACTIVE_CONTEXT_ID!=0 AND TIMESTAMPDIFF(SECOND, ACTIVE_CONTEXT_UPDATED, NOW())>600");
@@ -352,13 +341,13 @@ function sortFiles($a, $b)
352341
Define('TODAY', $out['TODAY']);
353342
$out['REQUEST_URI'] = $_SERVER['REQUEST_URI'];
354343

355-
global $from_scene;
344+
$from_scene = gr('from_scene');
356345
if ($from_scene) {
357346
$out['FROM_SCENE'] = 1;
358347
}
359348

360349

361-
global $ajt;
350+
$ajt = gr('ajt');
362351
if ($ajt == '') {
363352
$template_file = DIR_TEMPLATES . $this->name . ".html";
364353
} else {

scripts/cycle_main.php

+9-8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@
5959
$checked_time = time();
6060
setGlobal((str_replace('.php', '', basename(__FILE__))) . 'Run', time(), 1);
6161

62+
}
63+
64+
$m = date('i');
65+
$h = date('h');
66+
$dt = date('Y-m-d');
67+
68+
#NewMinute
69+
if ($m != $old_minute) {
70+
6271
$timestamp = time() - getGlobal('ThisComputer.started_time');
6372
setGlobal('ThisComputer.uptime', $timestamp);
6473

@@ -81,14 +90,6 @@
8190
}
8291
setGlobal('ThisComputer.uptimeText', trim($timestring));
8392

84-
}
85-
86-
$m = date('i');
87-
$h = date('h');
88-
$dt = date('Y-m-d');
89-
90-
#NewMinute
91-
if ($m != $old_minute) {
9293
processSubscriptionsSafe('MINUTELY');
9394
$sqlQuery = "SELECT ID, TITLE
9495
FROM objects

0 commit comments

Comments
 (0)