FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Simplesamlphp plugin for fudforum
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Simplesamlphp plugin for fudforum [message #186464] Mon, 11 August 2014 20:30 Go to next message
demaglio is currently offline  demaglio   Italy
Messages: 7
Registered: August 2014
Karma: 0
Junior Member
Hi,
I write a plugin for login in fudforum by simplesamlphp.

In my code I have:

....
$user_id=external_get_user_by_auth($emailsimple,$password);
$ses_id = external_fud_login($user_id);

as I read in a link. (Sorry if I don't write the link, but I cannot post the link)

and can't work.
In apache log I have the error:
[Mon Aug 11 02:14:36 2014] [error] [client IP] PHP Fatal error: Cannot redeclare db_close() (previously declared in /var/www/html/fudforum/index.php:29) in /var/www/FUDforum/include/theme/default/db.inc on line 18, referer: (address of my fudforum install)

How can I fix this problem? I install as fudforum:

FUDforum_3.0.5

Regards

Antonio

[Updated on: Tue, 19 August 2014 18:26]

Report message to a moderator

Re: Simplesamlphp plugin for fudforum [message #186492 is a reply to message #186464] Tue, 26 August 2014 16:43 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Sounds like a function name conflict. Both FUDforum and simplesamlphp have a DB_CLOSE().
You'll have to rename one of them or implement namespaces.
Re: Simplesamlphp plugin for fudforum [message #186494 is a reply to message #186492] Tue, 26 August 2014 22:32 Go to previous messageGo to next message
demaglio is currently offline  demaglio   
Messages: 7
Registered: August 2014
Karma: 0
Junior Member
Hi naudefj thanks for your reply. Yes the problem is name conflict.
But db_close is not defined in simplesamlphp. Is defined in fudforum/index.php and in FUDforum/include/theme/default/db.inc
db.inc is required by forum_login.php
This file are fudforum file that I have not modify.
$GLOBALS['DBHOST_DBTYPE'] = 'pdo_mysql';

I'll try to modify db.inc and forum_login.php using a namespace.

[Updated on: Wed, 27 August 2014 06:11]

Report message to a moderator

Re: Simplesamlphp plugin for fudforum [message #186497 is a reply to message #186494] Thu, 28 August 2014 17:43 Go to previous message
demaglio is currently offline  demaglio   
Messages: 7
Registered: August 2014
Karma: 0
Junior Member
Hi,

If use:
..
$user_id = external_get_user_by_auth($emailsimple, 'pass');
$ses_id = external_fud_login($user_id);
external_fud_status('Busy doing laundry...');


I have the error.
If I use to login use:

$forum_id = get_id_by_email($emailsimple)
return usr_reg_get_full($forum_id);


(as openid plugin) it works. So for me it's OK.

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Bug & fix - undefined variable DBHOST in Undefined variable
Next Topic: Paypal Donate Plugin
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 09:59:42 GMT 2024

Total time taken to generate the page: 0.02500 seconds