3 class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php';
5 class Pman_Core_DataObjects_Core_ip_access extends DB_DataObject
8 /* the code below is auto generated do not remove the above tag */
10 public $__table = 'core_ip_access';
15 public $authorized_by;
16 public $authorized_key;
21 /* the code above is auto generated do not remove the tag below */
24 function applyFilters($q, $au)
31 $ff = HTML_FlexyFramework::get();
34 empty($ff->Pman['ip_management']) ||
35 empty($ff->Pman['XMPP']) ||
36 empty($ff->Pman['XMPP']['username']) ||
37 empty($ff->Pman['XMPP']['password']) ||
38 empty($ff->Pman['XMPP']['to']) ||
39 empty($ff->Pman['XMPP']['url'])
44 require_once 'Net/XMPP.php';
46 $conn = new Net_XMPP('talk.google.com', 5222, $ff->Pman['XMPP']['username'], $ff->Pman['XMPP']['password'], 'xmpphp', 'gmail.com', $printlog=false, $loglevel=Net_XMPP_Log::LEVEL_VERBOSE);
48 $url = "{$ff->Pman['XMPP']['url']}/Core/VerifyAccess/{$this->id}/{$this->authorized_key}";
52 $conn->processUntil('session_start');
54 $conn->message($ff->Pman['XMPP']['to'], "New IP Login Required\n{$url}");
57 } catch(XMPPHP_Exception $e) {
58 $ff->page->jerr($e->getMessage());