X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FCore_ip_access.php;h=f803de0b52453c6b853ca7f828d455d48598be72;hp=d9639b0b5b8aa8c2b7d944ecd9f1d46ea9cf278e;hb=HEAD;hpb=82506d04927db78a31525dec755cd95c494850df diff --git a/DataObjects/Core_ip_access.php b/DataObjects/Core_ip_access.php index d9639b0b..f803de0b 100644 --- a/DataObjects/Core_ip_access.php +++ b/DataObjects/Core_ip_access.php @@ -35,7 +35,8 @@ class Pman_Core_DataObjects_Core_ip_access extends DB_DataObject empty($ff->Pman['XMPP']) || empty($ff->Pman['XMPP']['username']) || empty($ff->Pman['XMPP']['password']) || - empty($ff->Pman['XMPP']['to']) + empty($ff->Pman['XMPP']['to']) || + empty($ff->Pman['XMPP']['url']) ) { return; } @@ -44,20 +45,21 @@ class Pman_Core_DataObjects_Core_ip_access extends DB_DataObject $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->Pman['XMPP']['url']}/Core/VerifyAccess/{$this->id}/{$this->authorized_key}"; + try { $conn->connect(); $conn->processUntil('session_start'); $conn->presence(); - $conn->message($ff->Pman['XMPP']['to'], 'This is a test message!'); + $conn->message($ff->Pman['XMPP']['to'], "New IP Login Required\n{$url}"); $conn->disconnect(); - print_R('don???');exit; + } catch(XMPPHP_Exception $e) { - die($e->getMessage()); + $ff->page->jerr($e->getMessage()); } - exit; + return; } - }