views:

27

answers:

2

$wgAuth = new HttpAuthPlugin(); - After this line, control is not reachin the next line, not printin the next log.

error_log("JITEN TEST :WGAUTH object created, Value of wgAuth is :" . $wgAuth . "\n", 3, $logfile);

$wgHooks['UserLoadFromSession'][] = array($wgAuth,'autoAuthenticate'); error_log("JITEN TEST :Value of wgAuth is :" . $wgAuth . "\n", 3, $logfile);

In the above case the code after $wgAuth = new HttpAuthPlugin(); is not getting executed.

+1  A: 

According to the article on writing your own AuthPlugin, the class is called AuthPlugin not HttpAuthPlugin.

So it seems you should be using the code:

$wgAuth = new AuthPlugin();

Is this class coming from a third-party?

Anthony
yes it is a third party plugin mediawiki.org/wiki/Extension:HttpAuth HttpAuthPlugin.php is the extension, for Mediawiki.The mentioned code changes have been implemented inside LocalSettings.php and HttpAuthPlugin.php
JJ
What happens if you put the HttpAuthPlugin init into a conditional? Like: `if(!($wgAuth = new HttpAuthPlugin())) {echo "Error: Object Not created";}`
Anthony
I have used a condition as follows : if(!($wgAuth = new HttpAuthPlugin())) { error_log("Error: Object Not created" . "\n", 3, $logfile); } else { error_log("Object created" . "\n", 3, $logfile); } But, it is not giving any output, seems like it is stuck inside the class HttpAuthPlugin, while creating an object
JJ
A: 

I have used a condition as follows : if(!($wgAuth = new HttpAuthPlugin())) { error_log("Error: Object Not created" . "\n", 3, $logfile); } else { error_log("Object created" . "\n", 3, $logfile); } But, it is not giving any output, seems like it is stuck inside the class HttpAuthPlugin, while creating an object.

Jiten
please post answers
JJ