[evolvis-commits] r18391: scmsvn-tweaks pending merges:↵ Thorsten Glaser 2012-05-11 switch SCM Browser for git to a redirect (but keep the iframe)↵ Thorsten Glaser 2012-05-11 switch git favicon to use src/www/favicon.png (FusionForge logo)↵ Thorsten Glaser 2012-05-11 add /favicon.png↵ Thorsten Glaser 2012-05-11 link back from gitweb to group homepage↵ Thorsten Glaser 2012-05-11 /plugins/scmgit/?func=grouppage/grpname/foo.git ⇒ /projects/grpname/

mirabilos at evolvis.org mirabilos at evolvis.org
Fri May 11 17:15:04 CEST 2012


Author: mirabilos
Date: 2012-05-11 17:15:03 +0200 (Fri, 11 May 2012)
New Revision: 18391

Added:
   trunk/gforge_base/evolvisforge-5.1/src/www/favicon.png
Modified:
   trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
   trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/common/GitPlugin.class.php
   trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/packaging/links/plugin-scmgit
   trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/www/index.php
Log:
scmsvn-tweaks pending merges:
  Thorsten Glaser 2012-05-11 switch SCM Browser for git to a redirect (but keep the iframe)
    Thorsten Glaser 2012-05-11 switch git favicon to use src/www/favicon.png (FusionForge logo)
    Thorsten Glaser 2012-05-11 add /favicon.png
    Thorsten Glaser 2012-05-11 link back from gitweb to group homepage
    Thorsten Glaser 2012-05-11 /plugins/scmgit/?func=grouppage/grpname/foo.git ⇒ /projects/grpname/

Modified: trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2012-05-11 15:14:58 UTC (rev 18390)
+++ trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2012-05-11 15:15:03 UTC (rev 18391)
@@ -4,8 +4,12 @@
     tooltips in the submenu, which is kinda pointless, but for
     the sake of compatibility, oh my…
   * HTTPS: use TLSv1 only and work around CVE-2011-3389 using RC4 only
+  * scmgit: add backlink to group summary page (“project home”) to gitweb
+    via its configuration, let gitweb use the forge’s favicon instead of
+    git’s, and do not display it in an IFRAME any more since we’ve got
+    the backlink now
 
- -- Thorsten Glaser <t.glaser at tarent.de>  Tue, 08 May 2012 10:04:19 +0200
+ -- Thorsten Glaser <t.glaser at tarent.de>  Fri, 11 May 2012 15:31:28 +0200
 
 fusionforge (1:5.1.1+evolvis57) unstable; urgency=low
 

Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/common/GitPlugin.class.php	2012-05-11 15:14:58 UTC (rev 18390)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/common/GitPlugin.class.php	2012-05-11 15:15:03 UTC (rev 18391)
@@ -220,7 +220,18 @@
 		
 		if ($project->usesPlugin ($this->name)) {
 			if ($this->browserDisplayable ($project)) {
-				print '<iframe src="'.util_make_url("/plugins/scmgit/cgi-bin/gitweb.cgi?p=".$project->getUnixName().'/'.$project->getUnixName().'.git').'" frameborder="0" width="100%" height="700"></iframe>';
+				$dsturl = "/plugins/scmgit/cgi-bin/gitweb.cgi?p=" .
+				    $project->getUnixName() . "/" .
+				    $project->getUnixName() . ".git";
+				/* why the redirect here still works beats me */
+				session_redirect($dsturl);
+				/* in case it doesn’t revert to the older way */
+				echo html_e('iframe', array(
+					'src' => util_make_url($dsturl),
+					'frameborder' => 0,
+					'width' => '100%',
+					'height' => 700,
+				    ), "", false);
 			}
 		}
 	}
@@ -413,6 +424,9 @@
 		fwrite($config_f, "\$favicon = '". util_make_url ('/plugins/scmgit/git-favicon.png')."';\n");
 		fwrite($config_f, "\$stylesheet = '". util_make_url ('/plugins/scmgit/gitweb.css')."';\n");
 		fwrite($config_f, "\$prevent_xss = 'true';\n");
+		fwrite($config_f, "\$feature{'actions'}{'default'} = [('project home', '" .
+		    util_make_url('/plugins/scmgit/?func=grouppage/%n') .
+		    "', 'summary')];\n");
 		fclose($config_f);
 		chmod ($fname.'.new', 0644) ;
 		rename ($fname.'.new', $fname) ;

Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/packaging/links/plugin-scmgit
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/packaging/links/plugin-scmgit	2012-05-11 15:14:58 UTC (rev 18390)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/packaging/links/plugin-scmgit	2012-05-11 15:15:03 UTC (rev 18391)
@@ -1,6 +1,6 @@
 /usr/lib/cgi-bin/gitweb.cgi /usr/share/@OLDPACKAGE@/plugins/scmgit/cgi-bin/gitweb.cgi
 /usr/share/@OLDPACKAGE@/plugins/scmgit/www/index.php /usr/share/@OLDPACKAGE@/www/plugins/scmgit/index.php
-/usr/share/gitweb/git-favicon.png /usr/share/@OLDPACKAGE@/www/plugins/scmgit/git-favicon.png
+/usr/share/@OLDPACKAGE@/www/favicon.png /usr/share/@OLDPACKAGE@/www/plugins/scmgit/git-favicon.png
 /usr/share/@OLDPACKAGE@/plugins/scmgit/www/git-logo.png /usr/share/@OLDPACKAGE@/www/plugins/scmgit/git-logo.png
 /usr/share/gitweb/gitweb.css /usr/share/@OLDPACKAGE@/www/plugins/scmgit/gitweb.css
 /usr/share/gitweb/gitweb.js /usr/share/@OLDPACKAGE@/www/plugins/scmgit/gitweb.js

Modified: trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/www/index.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/www/index.php	2012-05-11 15:14:58 UTC (rev 18390)
+++ trunk/gforge_base/evolvisforge-5.1/src/plugins/scmgit/www/index.php	2012-05-11 15:15:03 UTC (rev 18391)
@@ -4,13 +4,27 @@
  * scmgit plugin
  *
  * Copyright 2010, Roland Mas <lolando at debian.org>
+ * Copyright © 2012 Thorsten Glaser <t.glaser at tarent.de>
  */
 
 require_once ('../../../www/env.inc.php');
 require_once $gfcommon.'include/pre.php';
-require_once $gfwww.'scm/include/scm_utils.php';    
+require_once $gfwww.'scm/include/scm_utils.php';
 
 $func = getStringFromRequest ('func') ;
+
+$matches = array();
+if (preg_match('!^grouppage/([a-z][-a-z0-9_]+)(/.*)$!', $func, $matches)) {
+	$grp = util_ifsetor($matches[1]);
+	if ($grp) {
+		$grp = group_get_object_by_name($grp);
+	}
+	if ($grp && is_object($grp) && !$grp->isError()) {
+		session_redirect('/projects/' . $grp->getUnixName() . '/');
+	}
+	exit_error(sprintf(_('Cannot locate group for func=%s'), $func), 'scm');
+}
+
 switch ($func) {
 case 'request-personal-repo':
 	$group_id = getIntFromRequest ('group_id') ;
@@ -22,17 +36,17 @@
 	if ($result && db_numrows ($result) == 1) {
 		scm_header (array ('title' => _('SCM Repository'), 'group' => $group_id)) ;
 		echo _('You have already requested a personal Git repository for this project.  If it does not exist yet, it will be created shortly.') ;
-		scm_footer(); 
+		scm_footer();
 		exit;
 	}
-	
+
 	$glist = $user->getGroups() ;
 	foreach ($glist as $g) {
 		if ($g->getID() == $group_id) {
 			$result = db_query_params ('INSERT INTO plugin_scmgit_personal_repos (group_id, user_id) VALUES ($1,$2)',
 						   array ($group_id,
 							  $user->getID())) ;
-			
+
 			scm_header (array ('title' => _('SCM Repository'), 'group' => $group_id)) ;
 			echo _('You have now requested a personal Git repository for this project.  If will be created shortly.') ;
 			scm_footer() ;
@@ -50,5 +64,3 @@
 // mode: php
 // c-file-style: "bsd"
 // End:
-
-?>

Added: trunk/gforge_base/evolvisforge-5.1/src/www/favicon.png
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/favicon.png	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/favicon.png	2012-05-11 15:15:03 UTC (rev 18391)
@@ -0,0 +1,16 @@
+‰PNG
+
+   
+IHDR           D¤ŠÆ   sRGB ®Îé  ¿PLTEA @@@AA at AAABBABBBDDDEEEFFEGFCIIIJJHKJFKJHLJGKKJLLKQM:ONKNNNOOLPOKRQLQQQSRLRRRSSSVUPUUSUUUXVHVVVXVQaZ5YYY\ZRZZYZZZ\\\f^4^]V]]]^^^i`2lb1cb]dddjjiolTnl_oonvsdŠz( ‹¡‹ ‹" Œ ¡Œ$‹q¨‘¥‘+©’ ¨’#¦’*¦’+ª“«“«”¬”‘‘‘¨”0¦”9­•ª•-¨•5§•9©•4ª—9±™«˜8³™®™/³š³š´›´›«šH®›<¸­œG­F¸ž¹Ÿ¯žF°žF·Ÿ)°ŸF¾£ŸŸŸ¸£3¦¤¢–祤›Èª¹¨SʬʬˬȬ¹ª\ή«ª¥Î¯ϯÏ°®­¢Ô³º°{Ô´׶
+ݺ߼
+â¾	ȼ}íÆíÇîÈîÈÎÄŽÆöðÊñÊòÊâÈIÈŵòËôÌôÌÜËtøÏÔË›üÒüÓÜÏŒþÔ þÕ ÿÕ ×Ъ9ßË]   tRNS @æØf  SIDAT8Ëc`@ W%q)V6ya­$, at _M’
+ØeUõÐ卸‘³\Št
++#*PLKèEÈk
+0¢õÉnV0ùt~F,
+&WºÁ̐aĪ`ryD^—‡‚‰‰`—¦r0âP0¹Ë³	¨@!*h “³Ã€
+¸
+t&£C<
+&G72(0âSPÅ „WAµ;'^õ¾È~Ónƒ‰–X ¡ Ëœ¯‚Z/Q¼
+ª¼$ð*ȉd0fÁ£`Rp
+u>À¸Ð€ˆæ—ÂA\AJ,PA;/XAÏdLÐ`?” ”™p(èÍ„$)1
+2¡iÒ@«‚b‡	°d]"‚© ?æ‘1ĘÐÜ؍’·”³:áS—b—Œž9[cœ#Šªë;»j«rlãÛ°eðB?'3Sk— \$A h†ëx\p    IEND®B`‚
\ No newline at end of file



More information about the evolvis-commits mailing list