/[drupal]/contributions/modules/xmpp_server/contrib/userauth_iq/userauth_iq.module
ViewVC logotype

Diff of /contributions/modules/xmpp_server/contrib/userauth_iq/userauth_iq.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2, Thu Sep 25 08:23:38 2008 UTC revision 1.3, Thu Sep 25 21:55:22 2008 UTC
# Line 1  Line 1 
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().
# Line 20  function userauth_iq_xmpp_server_xml() { Line 20  function userauth_iq_xmpp_server_xml() {
20          ),          ),
21          'children' => array(          'children' => array(
22            'username' => array(            'username' => array(
23              'data' => '*',              'data' => '+',
24            ),            ),
25          ),          ),
26        ),        ),
# Line 40  function userauth_iq_xmpp_server_xml() { Line 40  function userauth_iq_xmpp_server_xml() {
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        ),        ),
# Line 97  function userauth_iq_client_login($clien Line 97  function userauth_iq_client_login($clien
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);
# Line 114  function userauth_iq_client_login($clien Line 117  function userauth_iq_client_login($clien
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';

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.2