[dev] Hide restricted files in Chora

John Morrissey jwm@horde.net
Wed Nov 27 17:26:43 2002


The attached patch adds a configuration option to hide restricted files in
Chora in addition to denying access to them.

BTW, is dev@ the appropriate place for things like this, instead of the
application-specific lists? I checked the Chora list archives and didn't
find any patches posted there for the past couple of months.

john
-- 
John Morrissey          _o            /\         ----  __o
jwm@horde.net        _-< \_          /  \       ----  <  \,
www.horde.net/    __(_)/_(_)________/    \_______(_) /_(_)__
-------------- next part --------------
Index: cvs.php
===================================================================
RCS file: /repository/chora/cvs.php,v
retrieving revision 1.141
diff -u -u -r1.141 cvs.php
--- cvs.php	18 Nov 2002 04:43:53 -0000	1.141
+++ cvs.php	27 Nov 2002 17:16:48 -0000
@@ -69,6 +69,9 @@
     /* Display all the directories first. */
     $dirrow = 0;
     foreach ($dirList as $currentDir) {
+        if ($conf['hide_restricted'] && Chora::isRestricted($currentDir)) {
+            continue;
+        }
         $dirrow = ++$dirrow % 2;
         $url = Chora::url('cvs', "$where/$currentDir");
         $currDir = Text::htmlallspaces($currentDir);
@@ -77,6 +80,9 @@
 
     /* Display all of the files in this directory */
     foreach ($fileList as $currFile) {
+        if ($conf['hide_restricted'] && Chora::isRestricted($currFile)) {
+            continue;
+        }
         $dirrow = ++$dirrow % 2;
         $lg = $currFile->queryLastLog();
         if (PEAR::isError($lg)) {
Index: config/conf.php.dist
===================================================================
RCS file: /repository/chora/config/conf.php.dist,v
retrieving revision 1.38
diff -u -u -r1.38 conf.php.dist
--- config/conf.php.dist	24 Sep 2002 22:41:47 -0000	1.38
+++ config/conf.php.dist	27 Nov 2002 17:16:48 -0000
@@ -57,6 +57,10 @@
 // $conf['restrictions'] = array('^/?CVSROOT');
 $conf['restrictions'] = array();
 
+// If you wish to hide restricted files, set the below option to
+// 'true', and restricted files will not be displayed.
+$conf['hide_restricted'] = true;
+
 
 /**
  ** Reports Settings


More information about the dev mailing list