Jacek Kowalski
2012-06-23 8bd4d9f5065a5b94dc83f0ed6859ed0d93c75d84
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
<?php
class BotMessageIMI extends BotMessage {
    function __construct() {
        if(!ctype_print($_POST['userkey'])) {
            $_POST['userkey'] = 'invalid';
        }
        
        if(!ctype_print($_POST['user'])) {
            $_POST['user'] = 'invalid';
        }
        
        if(!ctype_alnum($_POST['network'])) {
            $_POST['network'] = 'invalid';
        }
        
        if(!ctype_print($_POST['botkey'])) {
            $_POST['botkey'] = 'invalid';
        }
        
        if($_POST['channel'] != 'public') {
            $_POST['channel'] = 'private';
        }
        
        $uid = 'IMified://'.$_POST['userkey'].'@userkey.imified.com';
        
        $this->userAlt = new BotUser($uid);
        $this->user = new BotUser('IMified://'.strtr($_POST['user'], array('@' => '\\@')).'@'.strtolower($_POST['network']).'.imified.com/'.$_POST['botkey'].'?'.$_POST['channel']);
        $this->session = new BotSession($uid);
        $this->setText($_POST['msg']);
    }
}
?>