summaryrefslogtreecommitdiff
path: root/plugins/phpbb30/BridgePhpBB30.php
blob: fd48e31d262ef6c7ae2622c729872676d9ee5400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

class BridgePhpBB30 extends EjabberdAuthBridge {
  var $auth;
  var $db;
  
  function __construct($auth, $db) {
    $this->auth = $auth;
    $this->db = $db;
  }

  function isuser($username, $server) {
    $username_clean = utf8_clean_string($username);
    $row = $this->db->sql_fetchrow($this->db->sql_query('SELECT username FROM ' . USERS_TABLE . ' WHERE username_clean = ' . "'" . $this->db->sql_escape($username_clean) . "'" . ';'));
    return !empty($row);
  }

  function auth($username, $server, $password) {
    $result = $this->auth->login($username, $password);
    return $result['status'] == LOGIN_SUCCESS;
  }
  
  // The following functions are disabled. This script will not change the phpBB user database.
  
  function setpass($username, $server, $password) {
    return FALSE;
  }

  function tryregister($username, $server, $password) {
    return FALSE;
  }

  function removeuser($username, $server) {
    return FALSE;
  }
}