git-remote-mediawiki: allow a domain to be set for authentication
When the wiki uses e.g. LDAP for authentication, the web interface shows a popup to allow the user to chose an authentication domain, and we need to use lgdomain in the API at login time. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Matthieu Moy committed
Sep 28, 2011 at 15:48 UTC
1d6abac9d573d7a40d3e631253b67a7cb07e0d05
1 file changed
+3
contrib/mw-to-git/git-remote-mediawiki
+3
@@ -76,8 +76,10 @@ my $wiki_login = run_git("config --get remote.". $remotename .".mwLogin");
76
# inside a remote helper, so our stdin is connect to git, not to a
77
# terminal.
78
my $wiki_passwd = run_git("config --get remote.". $remotename .".mwPassword");
79
+my $wiki_domain = run_git("config --get remote.". $remotename .".mwDomain");
80
chomp($wiki_login);
81
chomp($wiki_passwd);
82
+chomp($wiki_domain);
83
84
# Import only last revisions (both for clone and fetch)
85
my $shallow_import = run_git("config --get --bool remote.". $remotename .".shallow");
@@ -158,6 +160,7 @@ sub mw_connect_maybe {
160
if (!$mediawiki->login({
161
lgname => $wiki_login,
162
lgpassword => $wiki_passwd,
163
+ lgdomain => $wiki_domain,
164
})) {
165
print STDERR "Failed to log in mediawiki user \"$wiki_login\" on $url\n";
166
print STDERR "(error " .