From 86a4fd69d53b61a624dfc332c7a0e70b9a79218a Mon Sep 17 00:00:00 2001 From: Christoph Burschka Date: Thu, 16 Jan 2014 04:25:51 +0100 Subject: Implement smf2_session and finish RPC code. (#1) This patch should be ready for testing with SMF. (cburschka/cadence/#31) --- plugins/smf2/smf2.module | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'plugins/smf2/smf2.module') diff --git a/plugins/smf2/smf2.module b/plugins/smf2/smf2.module index 8274318..066780e 100644 --- a/plugins/smf2/smf2.module +++ b/plugins/smf2/smf2.module @@ -1,6 +1,6 @@ .\n"); exit; } +} + +function smf2_init($config) { + smf2_bootstap($config); require_once __DIR__ . '/BridgeSMF2.php'; return new BridgeSMF2(); } +function smf2_session($config) { + smf2_bootstap($config); + $user = smf_ssi('welcome', NULL); + return (empty($user['is_guest']) && !empty($user['name'])) ? $user['name'] : FALSE; +} + function smf_ssi($function) { $args = func_get_args(); array_shift($args); -- cgit v1.1