X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_ip_access.php;h=9343d61b29acaae0e83608a4787bd4f4b44072f5;hb=8c66a23775bc32a16d354df226703b3d5e71010a;hp=193d7b7e7039ee963d4b7691eb69c7d560cc7dd0;hpb=cb6f8b8c74805d5b7c31c96f38636f16de345083;p=Pman.Core diff --git a/DataObjects/Core_ip_access.php b/DataObjects/Core_ip_access.php index 193d7b7e..9343d61b 100644 --- a/DataObjects/Core_ip_access.php +++ b/DataObjects/Core_ip_access.php @@ -14,7 +14,10 @@ class Pman_Core_DataObjects_Core_ip_access extends DB_DataObject public $status; public $authorized_by; public $authorized_key; - + public $email; + public $expire_dt; + public $user_agent; + /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE @@ -22,4 +25,48 @@ class Pman_Core_DataObjects_Core_ip_access extends DB_DataObject { } + + function sendXMPP() + { + $ff = HTML_FlexyFramework::get(); + + if( + empty($ff->Pman['ip_management']) || + empty($ff->Pman['XMPP']) || + empty($ff->Pman['XMPP']['username']) || + empty($ff->Pman['XMPP']['password']) || + empty($ff->Pman['XMPP']['to']) + ) { + return; + } + + require_once 'Net/XMPP.php'; + + $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); + + $url = "{$ff->baseURL}/Core/VerifyAccess/{$this->id}/{$this->authorized_key}"; + + $message = <<connect(); + $conn->processUntil('session_start'); + $conn->presence(); + $conn->message($ff->Pman['XMPP']['to'], " + New IP Login Required\n + {$url} + "); + $conn->disconnect(); + + } catch(XMPPHP_Exception $e) { + $ff->page->jerr($e->getMessage()); + } + + return; + + } + + }