-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.php
39 lines (34 loc) · 1.07 KB
/
api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
date_default_timezone_set('Europe/Vilnius');
// workaround
function zinute($gavejas, $zinute) {
echo $zinute."\n";
}
// php boto fjos
require('addons.php');
//pritaikom
if (isset($_SERVER['PATH_INFO'])) {
$duomenys = explode(' ', substr($_SERVER['PATH_INFO'],1),2);
if (preg_match('/^[a-z]+$/', $duomenys[0])) {
if (isset($priedai[$duomenys[0]])) {
$priedas = $priedai[$duomenys[0]];
$duomenys[1] = trim($duomenys[1]);
if (!empty($duomenys[1])) {
$pkiekis = count(explode(' ', $duomenys[1]));
}
else {
$pkiekis = 0;
}
if ((($priedas['param'] == 'min' && $priedas['kiek'] <= $pkiekis) ||
($priedas['param'] == 'equ' && $priedas['kiek'] == $pkiekis)) &&
($priedas['teise'] <= 5)) //hardcode, 10 = admin, 5 = eilinis
{
call_user_func($priedas['fja'], $duomenys[1], null);
}
else {
echo "Blogas parametrų skaičius\n";
}
}
}
}
?>