r39157 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39156‎ | r39157 | r39158 >
Date:17:18, 11 August 2008
Author:siebrand
Status:old
Tags:
Comment:
(bug 11833) HTTP Authentication support for ee.pl/ee.ini.

Submitted by: Marcel Toele
Modified paths:
  • /trunk/extensions/ee/ee.ini (modified) (history)
  • /trunk/extensions/ee/ee.pl (modified) (history)

Diff [purge]

Index: trunk/extensions/ee/ee.pl
@@ -150,15 +150,25 @@
151151 if(index($fileurl,$search)>=0) {
152152 $username=$cfg->val($section,"Username");
153153 $password=$cfg->val($section,"Password");
 154+ $auth_server=$cfg->val("${section}:HTTPAuth","Server");
 155+ $auth_realm=$cfg->val("${section}:HTTPAuth","Realm");
 156+ $auth_username=$cfg->val("${section}:HTTPAuth","Username");
 157+ $auth_password=$cfg->val("${section}:HTTPAuth","Password");
154158 }
155159 }
156 -
157160 }
158161
159162 # Log into server
160163 # Note that we also log in for diffs, as the raw text might only be available
161164 # to logged in users (depending on the wiki security settings), and we may want
162165 # to offer GUI-based rollback functionality later
 166+if( $auth_username ne "" ) {
 167+ $browser->credentials(
 168+ $auth_server,
 169+ $auth_realm,
 170+ $auth_username => $auth_password
 171+ );
 172+}
163173 $response=$browser->post($login_url,@ns_headers,
164174 Content=>[wpName=>$username,wpPassword=>$password,wpRemember=>"1",wpLoginAttempt=>"Log in"]);
165175
@@ -609,4 +619,4 @@
610620
611621 );
612622
613 -}
\ No newline at end of file
 623+}
Index: trunk/extensions/ee/ee.ini
@@ -49,4 +49,10 @@
5050 [Testwiki]
5151 URL match=localhost/wiki
5252 Username=Admin
53 -Password=admin
\ No newline at end of file
 53+Password=admin
 54+
 55+[Testwiki:HTTPAuth]
 56+Server=localhost:80
 57+Realm=httprealm
 58+Username=httpuser
 59+Password=httppassword

Status & tagging log