Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
ut-tex
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
redmine
2015-12-14 20:55:40 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
012b191c65680f5f66414b5445ad4aa72faaea1a
012b191c
1 parent
bcffc6b1
Fixed error 502
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
15 deletions
genpdf/cron.php
genpdf/cron.sh
genpdf/genpdf.php
genpdf/cron.php
0 → 100644
View file @
012b191
<?php
$filename
=
'/opt/tmp/stfcardid2login.json'
;
$s
=
stat
(
$filename
);
if
(
$s
===
FALSE
||
(
@
$s
[
9
]
+
3600
*
24
)
<
time
())
{
$apiKey
=
trim
(
file_get_contents
(
'/etc/apikey-voip'
));
$subscribers
=
json_decode
(
file_get_contents
(
'http://new.voip.mephi.ru/subscribers.json?limit=65535&renderFilter=subscribers&apiKey='
.
urlencode
(
$apiKey
)),
1
)[
'subscribers'
];
foreach
(
$subscribers
as
&
$subscriber
)
{
if
(
empty
(
$subscriber
[
'Login'
][
'String'
]))
continue
;
foreach
(
$subscriber
[
'Appointments'
]
as
&
$_a
)
$stfcardid2login
[
$_a
[
'StfCardId'
]]
=
$subscriber
[
'Login'
][
'String'
];
}
if
(
count
(
$stfcardid2login
)
>
1000
)
{
file_put_contents
(
$filename
,
json_encode
(
$stfcardid2login
));
}
}
?>
...
...
genpdf/cron.sh
0 → 100755
View file @
012b191
#!/bin/bash
cd
/var/www/ut.mephi.ru/ut-tex/genpdf
php ./cron.php &
...
...
genpdf/genpdf.php
View file @
012b191
...
...
@@ -92,23 +92,9 @@ function stfcardid2login($stfcardid) {
static
$stfcardid2login
=
array
();
$filename
=
'/opt/tmp/stfcardid2login.json'
;
$s
=
stat
(
$filename
);
if
(
$s
===
FALSE
||
(
@
$s
[
9
]
+
3600
*
24
)
<
time
())
{
$apiKey
=
trim
(
file_get_contents
(
'/etc/apikey-voip'
));
$subscribers
=
json_decode
(
file_get_contents
(
'http://new.voip.mephi.ru/subscribers.json?limit=65535&renderFilter=subscribers&apiKey='
.
urlencode
(
$apiKey
)),
1
)[
'subscribers'
];
foreach
(
$subscribers
as
&
$subscriber
)
{
if
(
empty
(
$subscriber
[
'Login'
][
'String'
]))
continue
;
foreach
(
$subscriber
[
'Appointments'
]
as
&
$_a
)
$stfcardid2login
[
$_a
[
'StfCardId'
]]
=
$subscriber
[
'Login'
][
'String'
];
}
if
(
count
(
$stfcardid2login
)
>
1000
)
{
file_put_contents
(
$filename
,
json_encode
(
$stfcardid2login
));
}
system
(
"bash /var/www/ut.mephi.ru/ut-tex/genpdf/cron.sh"
);
}
if
(
empty
(
$stfcardid2login
))
{
...
...
Please
register
or
login
to post a comment