-
Notifications
You must be signed in to change notification settings - Fork 0
/
done.php
25 lines (25 loc) · 1.01 KB
/
done.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
<?php
if($_SERVER['REMOTE_ADDR'] != "69.162.95.26" && $_SERVER['REMOTE_ADDR'] != "71.196.170.51"){exit;}
include('Util.php');
include('peregrine/Peregrine.php');
$peregrine = new Peregrine();
$peregrine->init();
// debug
//$peregrine->post = $peregrine->get;
//var_dump($peregrine->post->getRawSource());
if(
$peregrine->post->keyExists('message')
&& $peregrine->post->isUsername('name')
&& ($peregrine->post->isUsername('modname') || $peregrine->post->isUsername('triggerer'))
&& $peregrine->post->keyExists('id'))
{
if($peregrine->post->equals('modname', 'null')){
irc_send(sprintf("Request completed: #%s, completed by %s", $peregrine->post->getInt('id'), $peregrine->post->getUsername('triggerer')));
}
save_request(
$peregrine->post->getInt('id'),
$peregrine->post->getUsername('name'),
($peregrine->post->equals('modname', 'null') ? $peregrine->post->getUsername('triggerer') : $peregrine->post->getUsername('modname')),
$peregrine->post->getRaw('message')
);
}