Skip to content

Commit

Permalink
git-remote-mediawiki: allow a domain to be set for authentication
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthieu Moy authored and Junio C Hamano committed Sep 28, 2011
1 parent fd47d7b commit 1d6abac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/mw-to-git/git-remote-mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ my $wiki_login = run_git("config --get remote.". $remotename .".mwLogin");
# inside a remote helper, so our stdin is connect to git, not to a
# terminal.
my $wiki_passwd = run_git("config --get remote.". $remotename .".mwPassword");
my $wiki_domain = run_git("config --get remote.". $remotename .".mwDomain");
chomp($wiki_login);
chomp($wiki_passwd);
chomp($wiki_domain);

# Import only last revisions (both for clone and fetch)
my $shallow_import = run_git("config --get --bool remote.". $remotename .".shallow");
Expand Down Expand Up @@ -158,6 +160,7 @@ sub mw_connect_maybe {
if (!$mediawiki->login({
lgname => $wiki_login,
lgpassword => $wiki_passwd,
lgdomain => $wiki_domain,
})) {
print STDERR "Failed to log in mediawiki user \"$wiki_login\" on $url\n";
print STDERR "(error " .
Expand Down

0 comments on commit 1d6abac

Please sign in to comment.