Jacek Kowalski
2016-02-13 1bf7d8ef0edac533ce65d68669d26aec2f282f95
commit | author | age
8bd4d9 1 <?php
JK 2 class BotMessageIMI extends BotMessage {
3     function __construct() {
4         if(!ctype_print($_POST['userkey'])) {
5             $_POST['userkey'] = 'invalid';
6         }
7         
8         if(!ctype_print($_POST['user'])) {
9             $_POST['user'] = 'invalid';
10         }
11         
12         if(!ctype_alnum($_POST['network'])) {
13             $_POST['network'] = 'invalid';
14         }
15         
16         if(!ctype_print($_POST['botkey'])) {
17             $_POST['botkey'] = 'invalid';
18         }
19         
20         if($_POST['channel'] != 'public') {
21             $_POST['channel'] = 'private';
22         }
23         
24         $uid = 'IMified://'.$_POST['userkey'].'@userkey.imified.com';
25         
26         $this->userAlt = new BotUser($uid);
27         $this->user = new BotUser('IMified://'.strtr($_POST['user'], array('@' => '\\@')).'@'.strtolower($_POST['network']).'.imified.com/'.$_POST['botkey'].'?'.$_POST['channel']);
28         $this->session = new BotSession($uid);
29         $this->setText($_POST['msg']);
30     }
31 }
32 ?>