summaryrefslogtreecommitdiff
path: root/plugins/smf2
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/smf2')
-rw-r--r--plugins/smf2/BridgeSMF2.php7
-rw-r--r--plugins/smf2/smf2.module9
2 files changed, 12 insertions, 4 deletions
diff --git a/plugins/smf2/BridgeSMF2.php b/plugins/smf2/BridgeSMF2.php
index cddcf36..30aa436 100644
--- a/plugins/smf2/BridgeSMF2.php
+++ b/plugins/smf2/BridgeSMF2.php
@@ -6,16 +6,15 @@
class BridgeSMF2 extends EjabberdAuthBridge {
function isuser($username, $server) {
$query_where = 'member_name = {string:name}';
-
$query_where_params = array(
- 'name' => $name,
+ 'name' => $username,
);
- return 1 == count(ssi_queryMembers($query_where, $query_where_params, 1, 'id_member DESC', NULL));
+ return 1 == count(smf_ssi('queryMembers', $query_where, $query_where_params, 1, 'id_member DESC', NULL));
}
function auth($username, $server, $password) {
- return ssi_checkPassword($username, $password, TRUE);
+ return smf_ssi('checkPassword', $username, $password, TRUE);
}
function setpass($username, $server, $password) {
diff --git a/plugins/smf2/smf2.module b/plugins/smf2/smf2.module
index b2060f1..441b7ba 100644
--- a/plugins/smf2/smf2.module
+++ b/plugins/smf2/smf2.module
@@ -12,3 +12,12 @@ function smf2_init($config) {
require_once __DIR__ . '/BridgeSMF2.php';
return new BridgeSMF2();
}
+
+function smf_ssi($function) {
+ $args = func_get_args();
+ array_shift($args);
+
+ ob_start();
+ call_user_func_array("ssi_$function", $args);
+ file_put_contents('php://stderr', ob_get_clean());
+}