Exemple #1
0
 /**
  * Requests authorisation, so that our jabber account is allowed to send messages to the users.
  * @param string $email
  * @access public static
  * @return bool
  */
 function JabberRequestAuth($email)
 {
     global $fs;
     include_once BASEDIR . '/includes/class.jabber2.php';
     if (empty($fs->prefs['jabber_server']) || empty($fs->prefs['jabber_port']) || empty($fs->prefs['jabber_username']) || empty($fs->prefs['jabber_password'])) {
         return false;
     }
     if (!isset($fs->prefs['jabber_ssl'])) {
         $fs->prefs['jabber_ssl'] = true;
     }
     $JABBER = new Jabber($fs->prefs['jabber_username'], $fs->prefs['jabber_password'], $fs->prefs['jabber_ssl'], $fs->prefs['jabber_port']);
     $JABBER->login();
     $JABBER->send("<presence to='" . Jabber::jspecialchars($email) . "' type='subscribe'/>");
     $JABBER->disconnect();
 }