[Fusionforge-commits] r7180 - in trunk: . gforge gforge/common/include gforge/db gforge/debian gforge/plugins/mantis/www gforge/plugins/mediawiki gforge/plugins/mediawiki/mediawiki-skin gforge/plugins/mediawiki/mediawiki-skin/gforge gforge/plugins/mediawiki/usr/share gforge/plugins/mediawiki/usr/share/gforge/etc/httpd.d gforge/plugins/mediawiki/usr/share/mediawiki gforge/plugins/projects_hierarchy/www gforge/plugins/webcalendar/www gforge/plugins/webcalendar/www/tools gforge/plugins/wiki/www/themes gforge/plugins/wiki/www/themes/MacOSX/images gforge/translations gforge/utils gforge/www/account gforge/www/forum/include gforge/www/my gforge/www/survey/admin gforge/www/themes/gforge-simple-theme

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Mar 18 16:24:22 CET 2009


Author: lolando
Date: 2009-03-18 16:24:21 +0100 (Wed, 18 Mar 2009)
New Revision: 7180

Added:
   trunk/gforge/plugins/mediawiki/usr/share/mediawiki/
Removed:
   trunk/gforge/plugins/mediawiki/usr/share/mediawiki1.7/
Modified:
   trunk/
   trunk/Makefile.debian
   trunk/gforge/common/include/User.class.php
   trunk/gforge/common/include/group_section_texts.php
   trunk/gforge/common/include/rbac_texts.php
   trunk/gforge/db/gforge.sql
   trunk/gforge/db/upgrade-db.php
   trunk/gforge/debian/changelog
   trunk/gforge/gforge-install-1-deps.php
   trunk/gforge/gforge-install-2.php
   trunk/gforge/install.sh
   trunk/gforge/plugins/mantis/www/index.php
   trunk/gforge/plugins/mediawiki/README
   trunk/gforge/plugins/mediawiki/mediawiki-skin/GForge.php
   trunk/gforge/plugins/mediawiki/mediawiki-skin/gforge/loader.php
   trunk/gforge/plugins/mediawiki/usr/share/gforge/etc/httpd.d/03mediawiki
   trunk/gforge/plugins/mediawiki/usr/share/mediawiki/LocalSettings.php
   trunk/gforge/plugins/projects_hierarchy/www/softwaremap.php
   trunk/gforge/plugins/webcalendar/www/index2.php
   trunk/gforge/plugins/webcalendar/www/tools/convert_passwords.php
   trunk/gforge/plugins/wiki/www/themes/MacOSX/images/index.php
   trunk/gforge/plugins/wiki/www/themes/alphatest.php
   trunk/gforge/translations/de.po
   trunk/gforge/utils/install-nsspgsql.sh
   trunk/gforge/www/account/lostpw.php
   trunk/gforge/www/forum/include/ForumHTML.class.php
   trunk/gforge/www/my/index.php
   trunk/gforge/www/survey/admin/index.php
   trunk/gforge/www/themes/gforge-simple-theme/Theme.class.php
Log:
Merged from 4.7: Fixed mediawiki plugin for Mediawiki 1.12.


Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/Branch_4_7:6879,6881,6884,6897,6899,6902,6904,6906,6909,6911,6922,6932,6936,6939,6942,6944,6946-6948,6954,6956,6959,7000-7001,7012

   + /branches/Branch_4_7:6879,6881,6884,6897,6899,6902,6904,6906,6909,6911,6922,6932,6936,6939,6942,6944,6946-6948,6954,6956,6959,7000-7001,7012,7111,7130-7131,7133-7134,7138,7140-7142,7147-7148,7159-7160,7163,7168,7177,7179


Modified: trunk/gforge/debian/changelog
===================================================================
--- trunk/gforge/debian/changelog	2009-03-18 14:44:47 UTC (rev 7179)
+++ trunk/gforge/debian/changelog	2009-03-18 15:24:21 UTC (rev 7180)
@@ -4,6 +4,12 @@
 
  -- Roland Mas <lolando at debian.org>  Thu, 05 Feb 2009 22:14:45 +0100
 
+gforge (4.7.1-2+1) experimental; urgency=low
+
+  * Fixed mediawiki plugin for Mediawiki 1.12.
+
+ -- Roland Mas <lolando at debian.org>  Wed, 18 Mar 2009 15:43:49 +0100
+
 gforge (4.7.1-2) experimental; urgency=low
 
   * New upstream snapshot (SVN r7012 in the 4.7 branch).

Modified: trunk/gforge/plugins/mediawiki/README
===================================================================
--- trunk/gforge/plugins/mediawiki/README	2009-03-18 14:44:47 UTC (rev 7179)
+++ trunk/gforge/plugins/mediawiki/README	2009-03-18 15:24:21 UTC (rev 7180)
@@ -4,8 +4,8 @@
 # Thanks to their authors
 #
 # You will find LDAP authentication plugin 
-# usr/share/mediawiki1.7/LocalLdapSettings.php
-# usr/share/mediawiki1.7/includes/LdapAuthentication.php
+# usr/share/mediawiki/LocalLdapSettings.php
+# usr/share/mediawiki/includes/LdapAuthentication.php
 # which were usefull examples but are of no used
 #
 # The plugin is based on the idea to add a Gforge skin to Mediawiki
@@ -13,23 +13,23 @@
 # That's why it is inspired by LDAP and Autologin examples
 #
 # The skin is in :
-# usr/share/mediawiki1.7/skins/GForge.php file 
+# usr/share/mediawiki/skins/GForge.php file 
 # and 
-# usr/share/mediawiki1.7/skins/gforge/ dir
+# usr/share/mediawiki/skins/gforge/ dir
 # It is based on monobook skin and all css changes are only in main.css
 #
 # usr/share/gforge/etc/httpd.d/03mediawiki contains the apache part you need to add to have this work
 # This is automagically used in debian package or if you use 'setup' script
 #
 # The three following files are partial reproduction of pre.php User.class.php and Group.class.php
-# usr/share/mediawiki1.7/includes/GForgePre.php
-# usr/share/mediawiki1.7/includes/GFUser.class.php.php
-# usr/share/mediawiki1.7/includes/GFProject.class.php.php
+# usr/share/mediawiki/includes/GForgePre.php
+# usr/share/mediawiki/includes/GFUser.class.php.php
+# usr/share/mediawiki/includes/GFProject.class.php.php
 # These are light version which only use necessary functions
 # It was necessary to do this because of class name collision
 # It should be possible to remove them in future evolution of gforge code
 #
-# In usr/share/mediawiki1.7/includes/GForgeAuthentication.php
+# In usr/share/mediawiki/includes/GForgeAuthentication.php
 # $wgCacheEpoch = 'date +%Y%m%d%H%M%S';
 # is disabling cache. I didn't find yet a better way to tell mediawiki not to cache files
 # after Connect/Disconnect of a user
@@ -43,7 +43,7 @@
 # the same or different database users. LocalSettings.php contains an example
 # to reuse the gforge passwd when passed thru apache env 
 #
-# usr/share/mediawiki1.7/LocalSettings.php
+# usr/share/mediawiki/LocalSettings.php
 # ---------------------------------------
 #$wgShowIPinHeader=false;
 #require_once( 'includes/GForgeAuthentication.php' );

Modified: trunk/gforge/plugins/mediawiki/mediawiki-skin/GForge.php
===================================================================
--- trunk/gforge/plugins/mediawiki/mediawiki-skin/GForge.php	2009-03-18 14:44:47 UTC (rev 7179)
+++ trunk/gforge/plugins/mediawiki/mediawiki-skin/GForge.php	2009-03-18 15:24:21 UTC (rev 7180)
@@ -13,41 +13,61 @@
 if( !defined( 'MEDIAWIKI' ) )
 	die( -1 );
 
-/** */
-require_once('includes/SkinTemplate.php');
-$GLOBALS['sys_dbhost'] = $headers['GForgeDbhost'] || getenv('sys_gfdbhost');
-$GLOBALS['sys_dbport'] = $headers['GForgeDbport'] || getenv('sys_gfdbport');
-$GLOBALS['sys_dbname'] = $headers['GForgeDbname'] || getenv('sys_gfdbname');
-$GLOBALS['sys_dbuser'] = $headers['GForgeDbuser'] || getenv('sys_gfdbuser');
-$GLOBALS['sys_dbpasswd'] = $headers['GForgeDbpasswd'] || getenv('sys_gfdbpasswd');
 $no_gz_buffer = 1 ;
 require_once ('/etc/gforge/local.inc') ;
+require_once '/usr/share/gforge/www/env.inc.php';
+$GLOBALS['sys_dbhost'] = $sys_dbhost ;
+$GLOBALS['sys_dbport'] = $sys_dbport ;
+$GLOBALS['sys_dbname'] = $sys_dbname ;
+$GLOBALS['sys_dbuser'] = $sys_dbuser ;
+$GLOBALS['sys_dbpasswd'] = $sys_dbpasswd ;
+$GLOBALS['sys_plugins_path'] = $sys_plugins_path ;
+$GLOBALS['sys_urlprefix'] = $sys_urlprefix ;
+$GLOBALS['sys_use_ssl'] = $sys_use_ssl ;
+$GLOBALS['sys_default_domain'] = $sys_default_domain ;
+$GLOBALS['sys_custom_path'] = $sys_custom_path ;
+$GLOBALS['gfwww'] = $gfwww ;
+$GLOBALS['gfplugins'] = $gfplugins ;
+$GLOBALS['sys_lang'] = $sys_lang ;
+require_once $gfwww.'include/pre.php';
 $GLOBALS['sys_urlroot'] = $sys_urlroot;
 $GLOBALS['sys_session_key'] = $sys_session_key;
 $GLOBALS['sys_session_expire'] = $sys_session_expire;
-require_once $gfwww.'include/pre.php';
 $GLOBALS['REMOTE_ADDR'] = getStringFromServer('REMOTE_ADDR') ;
 $GLOBALS['HTTP_USER_AGENT'] = getStringFromServer('HTTP_USER_AGENT') ;
 
+require_once('includes/SkinTemplate.php');
 function GforgeRegisterMWHook() {
 	$GLOBALS['wgHooks']['AutoAuthenticate'][]='GforgeMWAuth';
 }
-function GforgeMWAuth( &$param='default' ) {
-	$s = session_check_session_cookie(getStringFromCookie ('session_ser'));
-	if ($s) {
-		$u = user_get_object($s);
-		// print "Logged in as ".$u->getUnixName()." (according to gforge) ";
-		$mwu = User::newFromId(User::idFromName(ucfirst($u->getUnixName())));
-		$mwu->loadFromDatabase();
-		$mwu->SetupSession();
-		$mwu->SetCookies();
-	} else {
-		// print "Not logged in (according to gforge) ";
-		$mwu = User::loadFromSession() ;
-		if ($mwu->isLoggedIn()) {
-			$mwu->logout() ;
-		}
-	}
+function GforgeMWAuth( &$user ) {
+        $s = session_check_session_cookie (getStringFromCookie ('session_ser'));
+        if ($s) {
+                $u = user_get_object ($s);
+                // print "Logged in as ".$u->getUnixName()." (according to gforge) ";
+                $mwname = ucfirst($u->getUnixName ()) ;
+                $mwu = User::newFromName ($mwname);
+                if($mwu->getID() == 0) {
+                        $mwu->addToDatabase ();
+                        $mwu->setPassword (User::randomPassword());
+                        $mwu->setRealName ($u->getRealName ()) ;
+                        $mwu->setToken ();
+                } else {
+                        $mwu->loadFromDatabase ();
+                }
+                $mwu->setCookies ();
+                $mwu->saveSettings ();
+
+                $user = $mwu ;
+                return true ;	// Ignored by MW, but required anyway
+        } else {
+                // print "Not logged in (according to gforge) ";
+                $mwu = User::loadFromSession () ;
+                if ($mwu->isLoggedIn ()) {
+                        $mwu->logout () ;
+                }
+                return false ;	// Ignored by MW, but required anyway
+        }
 }
 /**
  * Inherit main code from SkinTemplate, set the CSS and template filter.
@@ -324,4 +344,10 @@
 	wfRestoreWarnings();
 	} // end of execute() method
 } // end of class
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
 ?>

Modified: trunk/gforge/plugins/mediawiki/mediawiki-skin/gforge/loader.php
===================================================================
--- trunk/gforge/plugins/mediawiki/mediawiki-skin/gforge/loader.php	2009-03-18 14:44:47 UTC (rev 7179)
+++ trunk/gforge/plugins/mediawiki/mediawiki-skin/gforge/loader.php	2009-03-18 15:24:21 UTC (rev 7180)
@@ -1,6 +1,6 @@
 <?php
 function LoadGforgeSkin() {
-        require_once('/usr/share/mediawiki1.10/skins/GForge.php');
+        require_once('/usr/share/mediawiki/skins/GForge.php');
         GforgeRegisterMWHook();
 }
 

Modified: trunk/gforge/plugins/mediawiki/usr/share/gforge/etc/httpd.d/03mediawiki
===================================================================
--- trunk/gforge/plugins/mediawiki/usr/share/gforge/etc/httpd.d/03mediawiki	2009-03-18 14:44:47 UTC (rev 7179)
+++ trunk/gforge/plugins/mediawiki/usr/share/gforge/etc/httpd.d/03mediawiki	2009-03-18 15:24:21 UTC (rev 7180)
@@ -1,7 +1,7 @@
 # The alias is already declared by mediawiki
-#Alias /mediawiki /var/lib/mediawiki1.7
+#Alias /mediawiki /var/lib/mediawiki
 
-<Directory /var/lib/mediawiki1.7/>
+<Directory /var/lib/mediawiki/>
 	Options +FollowSymLinks
 	AllowOverride All
 	order allow,deny
@@ -11,11 +11,11 @@
 </Directory>
 
 # some directories must be protected
-<Directory /var/lib/mediawiki1.7/config>
+<Directory /var/lib/mediawiki/config>
 	Options -FollowSymLinks
 	AllowOverride None
 </Directory>
-<Directory /var/lib/mediawiki1.7/upload>
+<Directory /var/lib/mediawiki/upload>
 	Options -FollowSymLinks
 	AllowOverride None
 </Directory>

Modified: trunk/gforge/plugins/mediawiki/usr/share/mediawiki/LocalSettings.php
===================================================================
--- trunk/gforge/plugins/mediawiki/usr/share/mediawiki1.7/LocalSettings.php	2009-03-18 09:36:51 UTC (rev 7178)
+++ trunk/gforge/plugins/mediawiki/usr/share/mediawiki/LocalSettings.php	2009-03-18 15:24:21 UTC (rev 7180)
@@ -137,7 +137,7 @@
 }
 
 $wgShowIPinHeader=false;
-require_once $gfplugins.'mediawiki/usr/share/mediawiki1.7/includes/GForgeAuthentication.php';
+require_once $gfplugins.'mediawiki/usr/share/mediawiki/includes/GForgeAuthentication.php';
 $wgAuth = new GForgeAuthenticationPlugin();
 # 'AutoAuthenticate': called to authenticate users on external/environmental means
 # $user: writes user object to this parameter




More information about the Fusionforge-commits mailing list