git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-remote-mediawiki: allow a domain to be set for authentication

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Sep 28, 2011, 13:48 UTC
Message-ID
<1317217681-18763-1-git-send-email-Matthieu.Moy@imag.fr>
In-Reply-To
<1317146100-22938-3-git-send-email-Matthieu.Moy@imag.fr>

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>
---
 contrib/mw-to-git/git-remote-mediawiki |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/contrib/mw-to-git/git-remote-mediawiki b/contrib/mw-to-git/git-remote-mediawiki
index b809792..0b32d18 100755
--- a/contrib/mw-to-git/git-remote-mediawiki
+++ b/contrib/mw-to-git/git-remote-mediawiki
@@ -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");
@@ -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 " .
-- 
1.7.7.rc0.75.g56f27
Previous: Matthieu Moy
Message 4 of 4 in “git-remote-mediawiki: trivial fixes”
  1. 1/3 git-remote-mediawiki: trivial fixesMatthieu Moy, Sep 27, 2011
  2. 2/3 git-remote-mediawiki: set 'basetimestamp' to let the wiki handle conflictsMatthieu Moy, Sep 27, 2011
  3. 3/3 git-remote-mediawiki: obey advice.pushNonFastForwardMatthieu Moy, Sep 27, 2011
  4. git-remote-mediawiki: allow a domain to be set for authenticationMatthieu Moy, Sep 28, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.