You may login to %site using a Jabber ID. The format of a Jabber ID is the same as an email address: name@server An example of valid Jabber ID is someone@gmail.com. Note that you must be able to access port 111 on the Jabber server from your web server. For example, sourceforge.net blocks port 111 so Jabber authentication does not work.
', array('%site' => theme('placeholder', variable_get('site_name', 'drupal')))); } return $output; } /** * Implementation of hook_info(). */ function jabber_info($field = 0) { $info['name'] = 'Jabber'; $info['protocol'] = 'Jabber'; if ($field) { return $info[$field]; } else { return $info; } } function _jabber_start($parser, $name, $attributes) { if (isset($attributes['ID']) && $attributes['ID']) { jabber_set('jid', $attributes['ID']); } if (stristr($name, "error") || (isset($attributes['ERROR']) && $attributes['ERROR'])) { _jabber_set('error', TRUE); } } function _jabber_end($parser, $name) { } function _jabber_data($parser, $data) { _jabber_set('data', $data); } function _jabber_send($request, $message) { fwrite($request, $message, strlen($message)); } function _jabber_recv($request, $timout = 50) { while ($count < $timout) { $data = fread($request, 1); if ($data) { $message .= $data; } else { usleep(100); $count = $count + 1; } } if ($message) { return $message; } } function jabber_auth($username, $password, $server) { if ($server == 'gmail.com') { $request = fsockopen('talk.google.com', 5223, $errno, $errstr, 5); } else { $request = fsockopen($server, 5222, $errno, $errstr, 5); } if ($request) { $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, "_jabber_start", "_jabber_end"); xml_set_character_data_handler($xml_parser, "_jabber_data"); // Switch the given socket descriptor '$request' to non-blocking mode: set_socket_blocking($request, false); /* A jabber session consists of two parallel XML streams, one from the client to the server and one from the server to the client. On connecting to a Jabber server, a Jabber client initiates the client-to-server XML stream and the server responds by initiating the server-to-client XML stream: */ _jabber_send($request, ""); _jabber_send($request, "