| 1 |
<?php |
<?php |
| 2 |
// $Id: userauth_iq.module,v 1.1 2008/09/25 06:45:41 t0talmeltd0wn Exp $ |
// $Id: userauth_iq.module,v 1.2 2008/09/25 08:23:38 t0talmeltd0wn Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_xmpp_server_xml(). |
* Implementation of hook_xmpp_server_xml(). |
| 20 |
), |
), |
| 21 |
'children' => array( |
'children' => array( |
| 22 |
'username' => array( |
'username' => array( |
| 23 |
'data' => '*', |
'data' => '+', |
| 24 |
), |
), |
| 25 |
), |
), |
| 26 |
), |
), |
| 40 |
), |
), |
| 41 |
'children' => array( |
'children' => array( |
| 42 |
'username' => array( |
'username' => array( |
| 43 |
'data' => '*', |
'data' => '+', |
| 44 |
), |
), |
| 45 |
'password' => array( |
'password' => array( |
| 46 |
'data' => '*', |
'data' => '+', |
| 47 |
), |
), |
| 48 |
'resource' => array( |
'resource' => array( |
| 49 |
'data' => '*', |
'data' => '+', |
| 50 |
), |
), |
| 51 |
), |
), |
| 52 |
), |
), |
| 97 |
$response->options['id'] = $node->options['id']; |
$response->options['id'] = $node->options['id']; |
| 98 |
$response->options['from'] = variable_get('xmpp_server_host', $_SERVER['HTTP_HOST']); |
$response->options['from'] = variable_get('xmpp_server_host', $_SERVER['HTTP_HOST']); |
| 99 |
|
|
| 100 |
if ($user) { |
$acct->uid = $user; |
| 101 |
|
|
| 102 |
|
//Reset the user access cache each time. See README.txt. |
| 103 |
|
if ($user && user_access('access xmpp server', $acct, TRUE)) { |
| 104 |
$response->options['type'] = 'result'; |
$response->options['type'] = 'result'; |
| 105 |
|
|
| 106 |
$session = xmpp_server_get_session($client); |
$session = xmpp_server_get_session($client); |
| 117 |
|
|
| 118 |
xmpp_server_id_map(xmpp_serialize_jid($session['jid']), 'jid', $client->id); |
xmpp_server_id_map(xmpp_serialize_jid($session['jid']), 'jid', $client->id); |
| 119 |
xmpp_server_id_map($session['uid'], 'uid', $client->id); |
xmpp_server_id_map($session['uid'], 'uid', $client->id); |
| 120 |
|
|
| 121 |
|
//Now that we've set up the session and the ID map, call the hook. |
| 122 |
|
module_invoke_all('xmpp_server_client_login', $client); |
| 123 |
} |
} |
| 124 |
else { |
else { |
| 125 |
$response->options['type'] = 'error'; |
$response->options['type'] = 'error'; |