Koozali.org: home of the SME Server

Mediawiki Authentication

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Mediawiki Authentication
« on: May 07, 2008, 05:53:03 AM »
Hello.  Has anyone been able to authenticate mediawiki against SME's POP3 or IMAP servers in the way it's possible to auth moodle or groupoffice?

Thanks

Steve
Saving the world ... one server at a time.

guest22

Re: Mediawiki Authentication
« Reply #1 on: May 07, 2008, 06:34:39 AM »
Maybe not a big help, but I'm using http://www.mediawiki.org/wiki/Extension:PwAuthPlugin , and works well.

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Re: Mediawiki Authentication
« Reply #2 on: May 07, 2008, 07:20:45 AM »
How do you manage to auth against SME using this?  I'd love to know ...
Saving the world ... one server at a time.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Mediawiki Authentication
« Reply #3 on: May 07, 2008, 09:49:32 AM »
How do you manage to auth against SME using this?  I'd love to know ...
It is not that much different I guess as stated in that page, you will have to put the files in the proper place as well as setting up your configuration properly in the LocalSettings.php page.

The instructions seem pretty straight forward to me. Did you already have a go at it? If so tell us where you had problems, otherwise I suggest you just start and see how it turns out.

Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Re: Mediawiki Authentication
« Reply #4 on: May 07, 2008, 03:48:55 PM »
OK guys:  this is how far I got ...

  • Installed mediawiki as per instructions in the SME wiki.
  • Made changes to /opt/mediawiki/LocalSettings.php as per instructions on the extension's page.
  • Copied the code on the extension's page and placed it in a new file called PwAuthPlugin.php located in the extensions folder in /opt/mediawiki as per instructions.
  • Got a blank page when looking at http://servername/mediawiki

HF, what did I do wrong?
Steve
Saving the world ... one server at a time.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Mediawiki Authentication
« Reply #5 on: May 07, 2008, 04:08:20 PM »
OK guys:  this is how far I got ...

  • Installed mediawiki as per instructions in the SME wiki.
  • Made changes to /opt/mediawiki/LocalSettings.php as per instructions on the extension's page.
  • Copied the code on the extension's page and placed it in a new file called PwAuthPlugin.php located in the extensions folder in /opt/mediawiki as per instructions.
  • Got a blank page when looking at http://servername/mediawiki

HF, what did I do wrong?
Steve
Judging from the instructions... not much. Perhaps it is time to look at your logfiles to see why you get a blank page, see if you find a clue in /var/log/httpd/error_log or /var/log/messages. Perhaps you caould also enable display errors while debugging the application as described in the wiki on the PHP page.
« Last Edit: May 07, 2008, 04:10:16 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Re: Mediawiki Authentication
« Reply #6 on: May 07, 2008, 04:18:18 PM »
I see some trouble in the messages log ...
Quote
May  7 21:58:08 server001 httpd: PHP Fatal error:  main(): Failed opening required './LocalSettings.php' (include_path='.:/usr/share/pear-addons:/usr/share/pear') in /opt/mediawiki/index.php on line 78
May  7 21:58:08 server001 httpd: PHP Warning:  main(./LocalSettings.php): failed to open stream: Permission denied in /opt/mediawiki/index.php on line 78

What do you think is the problem?
Saving the world ... one server at a time.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Mediawiki Authentication
« Reply #7 on: May 07, 2008, 04:22:51 PM »
I see some trouble in the messages log ...
What do you think is the problem?
It has problems finding the LocalSettings.php file. Are you sure you placed it in the proper place and have the correct filename?

What does line 78 of index.php state?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Re: Mediawiki Authentication
« Reply #8 on: May 07, 2008, 04:28:50 PM »
Line 78 of index.php says "require_once( './LocalSettings.php' );"
LocalSettings.php was an existing file in the same folder as index.php.
All I did was add the code to the file.
Saving the world ... one server at a time.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Mediawiki Authentication
« Reply #9 on: May 07, 2008, 04:36:12 PM »
Line 78 of index.php says "require_once( './LocalSettings.php' );"
LocalSettings.php was an existing file in the same folder as index.php.
All I did was add the code to the file.
I quickly installed on my test server as well and did not have the error you are receiving, where did you paste the code in LocalSettings.php, beginning or at the end? Between the <?php ... ?> tags?

I pasted mine at the end, just before the php close tag (?>). My bottom section of the LocalSettings.php file now reads:

Code: [Select]
# When you make changes to this configuration file, this will make
# sure that cached pages are cleared.
$configdate = gmdate( 'YmdHis', @filemtime( __FILE__ ) );
$wgCacheEpoch = max( $wgCacheEpoch, $configdate );

require_once("./extensions/PwAuthPlugin.php");
$wgAuth = new PwAuthPlugin();

$wgGroupPermissions['*']['createaccount']   = false;
$wgGroupPermissions['*']['read']            = true;
$wgGroupPermissions['*']['edit']            = false;
$wgGroupPermissions['*']['createpage']      = false;
$wgGroupPermissions['*']['createtalk']      = false;

$wgShowIPinHeader = false; # For non-logged in users

?>

One other thing you will have to change after you pasted the code at the proper place is change the location of the pwauth file in the ./extensions/PwAuthPlugin.php file as SME Server stores it in a different location, you should change

Code: [Select]
$pwauth_bin_path = "/usr/local/libexec/pwauth";
to

Code: [Select]
$pwauth_bin_path = "/usr/lib/httpd/modules/pwauth";
After placing the code at the proper place and modifying the pwauth location I was able to succesfully login using a already configured username.
« Last Edit: May 07, 2008, 04:37:48 PM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Re: Mediawiki Authentication
« Reply #10 on: May 07, 2008, 04:42:07 PM »
Thanks Cactus:

It was the
Quote
$pwauth_bin_path = "/usr/lib/httpd/modules/pwauth";
part that I didn't have.  Did I miss that in the instructions somewhere?
Saving the world ... one server at a time.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Mediawiki Authentication
« Reply #11 on: May 07, 2008, 04:46:14 PM »
Thanks Cactus:

It was the  part that I didn't have.  Did I miss that in the instructions somewhere?
That line is in the code you copied to ./extensions/PwAuthPlugin.php file, but the installation is not SME Server specific and SME Server handles some things a bit different, which is not unusual for Linux distributions in general.

I specifically pasted the line it is in the original version and the version you should change it to. If it was not there you must have made an error on copy-pasting and I guess you are missing more lines if that is the case.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Re: Mediawiki Authentication
« Reply #12 on: May 07, 2008, 04:49:46 PM »
The original version was there, but how did you know to change it?  Did I miss that instruction somewhere?

Steve

PS.  I'll add the above info to the wiki so everyone can enjoy.

Thanks
Saving the world ... one server at a time.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Mediawiki Authentication
« Reply #13 on: May 07, 2008, 04:53:00 PM »
The original version was there, but how did you know to change it?  Did I miss that instruction somewhere?
No it was not there, I just know a lot of SME Server by now and quickly tested it for you.


PS.  I'll add the above info to the wiki so everyone can enjoy.
You could do so, but remember that the page in the wiki is about the contrib, I suggest you mak a new page in the Category:Howto and post a link to it on the page dedicated to the contrib.

I will see if I can incorporate the pwauth authentication in the contrib as well. Makes installation and configuration a lot easier.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline steever

  • *
  • 185
  • +0/-0
    • Open-Sesame
Re: Mediawiki Authentication
« Reply #14 on: May 07, 2008, 04:54:48 PM »
Thanks.

I will hold off from editing the wiki until you make modifications.

Steve
Saving the world ... one server at a time.