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
}
- var $template = 'ip_access_xmpp.html';
-
function sendXMPP()
{
$ff = HTML_FlexyFramework::get();
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']['host'])
) {
return;
}
- $template_engine = new HTML_Template_Flexy();
- $template_engine->compile($this->masterTemplate);
+ 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 = "https://{$ff->Pman['XMPP']['host']}{$ff->baseURL}/Core/VerifyAccess/{$this->id}/{$this->authorized_key}";
- $fn = $this->tempName('html');
+ try {
+ $conn->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;
- file_put_contents($fn, $template_engine->bufferedOutputObject($this, $this->elements));
}
-
}