Index: trunk/extensions/ee/ee.pl |
— | — | @@ -150,15 +150,25 @@ |
151 | 151 | if(index($fileurl,$search)>=0) { |
152 | 152 | $username=$cfg->val($section,"Username"); |
153 | 153 | $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"); |
154 | 158 | } |
155 | 159 | } |
156 | | - |
157 | 160 | } |
158 | 161 | |
159 | 162 | # Log into server |
160 | 163 | # Note that we also log in for diffs, as the raw text might only be available |
161 | 164 | # to logged in users (depending on the wiki security settings), and we may want |
162 | 165 | # 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 | +} |
163 | 173 | $response=$browser->post($login_url,@ns_headers, |
164 | 174 | Content=>[wpName=>$username,wpPassword=>$password,wpRemember=>"1",wpLoginAttempt=>"Log in"]); |
165 | 175 | |
— | — | @@ -609,4 +619,4 @@ |
610 | 620 | |
611 | 621 | ); |
612 | 622 | |
613 | | -} |
\ No newline at end of file |
| 623 | +} |
Index: trunk/extensions/ee/ee.ini |
— | — | @@ -49,4 +49,10 @@ |
50 | 50 | [Testwiki] |
51 | 51 | URL match=localhost/wiki |
52 | 52 | 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 |