/[docman2]/docman.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /docman.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.30 by dpavlin, Mon Jul 29 12:53:50 2002 UTC revision 1.31 by dpavlin, Mon Jul 29 13:53:56 2002 UTC
# Line 157  function DetailPage($fsRoot,$relDir,$fn) Line 157  function DetailPage($fsRoot,$relDir,$fn)
157                    
158          global $gblEditable, $gblImages,          global $gblEditable, $gblImages,
159                  $gblDateFmt, $gblTimeFmt,                  $gblDateFmt, $gblTimeFmt,
160                    $gblPermNote,
161                  $webRoot, $html,                  $webRoot, $html,
162                  $HTTP_SERVER_VARS ;                  $HTTP_SERVER_VARS ;
163          $self = $HTTP_SERVER_VARS["PHP_SELF"] ;          $self = $HTTP_SERVER_VARS["PHP_SELF"] ;
# Line 208  function DetailPage($fsRoot,$relDir,$fn) Line 209  function DetailPage($fsRoot,$relDir,$fn)
209                  $fstr = fread($fh,filesize($fsPath)) ;                  $fstr = fread($fh,filesize($fsPath)) ;
210                  fclose($fh) ;                  fclose($fh) ;
211                  $fstr = htmlentities( $fstr ) ;                  $fstr = htmlentities( $fstr ) ;
 ?>  
   
 <FORM ACTION="<?= $self ?>" METHOD="POST">  
 <SPAN TITLE="Click [SAVE] to store updated contents.">  
         <B>DOCUMENT CONTENTS</B>  
 </SPAN><BR>  
 <TEXTAREA NAME="FILEDATA" ROWS=18 COLS=70 WRAP="OFF"><?php  
 echo($fstr) ; ?></TEXTAREA>  
 <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ; ?>">  
 <INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?= $fn ; ?>">  
 <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="SAVE">  
 <INPUT TYPE="HIDDEN" SIZE=48 MAXLENGTH=255 NAME="RELPATH"  
         VALUE="<?= $relPath ; ?>">  
 <br>  
 <INPUT TYPE="RESET" VALUE="UNDO ALL CHANGES">  
 <INPUT TYPE="SUBMIT" VALUE="SAVE">  
 </FORM>  
212    
213  <?php                  include("$html/DetailPage-edit.html");
214          }          }
215          if ( !$file_lock && $ext!="" && strstr(join(' ',$gblImages),$ext) ) {            if ( !$file_lock && $ext!="" && strstr(join(' ',$gblImages),$ext) ) {  
216                  $info  = getimagesize($fsPath) ;                  $info  = getimagesize($fsPath) ;
# Line 237  echo($fstr) ; ?></TEXTAREA> Line 221  echo($fstr) ; ?></TEXTAREA>
221                  echo $tstr ;                  echo $tstr ;
222          }          }
223    
 ?>  
224    
225  <FORM ACTION="<?= $self ; ?>" METHOD="POST">          print '<FORM ACTION="'.$self.'" METHOD="POST">
226  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ; ?>">                  <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="'.$relDir.'">
227  <INPUT TYPE="HIDDEN" NAME="FN" VALUE="<?= $fn ; ?>">                  <INPUT TYPE="HIDDEN" NAME="FN" VALUE="'.$fn.'">
228  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL"><BR>                  <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="CANCEL"><BR>
229                    ';
230    
231  <?php          if ($file_lock && check_perm($relDir.$fn,trperm_w)) {
232                    include("$html/DetailPage-unlock.html");
         if ($file_lock) {  
 ?>  
 <hr>  
 <SPAN TITLE="Check OK and click UNLOCK to remove lock on file.">  
 <B>OK TO FORCE LOCK REMOVAL ON "<?= $fn ; ?>" HELD BY <?= $file_lock ?>? </B></SPAN>  
 <INPUT TYPE="CHECKBOX" NAME="CONFIRM">  
 <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="UNLOCK">  
 <?  
233          } // file_lock          } // file_lock
234    
235          if (substr($fn,0,4) == ".del") {          if (substr($fn,0,4) == ".del") {
# Line 265  echo($fstr) ; ?></TEXTAREA> Line 241  echo($fstr) ; ?></TEXTAREA>
241          }          }
242    
243          if ($exists && $writable) {          if ($exists && $writable) {
244  ?>                  include("$html/DetailPage-undelete.html");
245                    include("$html/DetailPage-rename.html");
 <HR>  
 <a name="undelete">  
 <SPAN TITLE="Check OK and click [<?= $action ?>] to <?= $desc ?>.">  
 <B>OK TO <?= $action ?> "<?= $fn ; ?>"? </B></SPAN>  
 <INPUT TYPE="CHECKBOX" NAME="CONFIRM">  
 <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="<?= $action ?>">  
   
 <HR>  
 <a name="rename">  
 <SPAN TITLE="Check OK and click [RENAME] to rename.">  
 <B>OK TO RENAME "<?= $fn ; ?>" TO  
 <INPUT TYPE="TEXT" SIZE=24 MAXLENGTH=255 NAME="NEWNAME" VALUE="<?= $fn ?>">  
 ? </B></SPAN>  
 <INPUT TYPE="CHECKBOX" NAME="CONFIRM">  
 <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="RENAME">  
246    
247  <?php          } elseif (check_perm($relDir.$fn,$gblPermNote)) {
248          }       // exists && writable                          include("$html/DetailPage-note.html");
249  ?>          }
 <HR>  
 <a name="note">  
 <B>NOTE FOR "<?= $fn ; ?>":  
 <INPUT TYPE="TEXT" SIZE=50 MAXLENGTH=255 NAME="NOTE" VALUE="<?= ReadNote($fsPath) ?>">  
 </B></SPAN>  
 <INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="NOTE">  
   
 </FORM>  
250    
251  <?php          print "</FORM>";
252    
253          $name=basename("$fsDir/$fn");          $name=basename("$fsDir/$fn");
254          $logname=dirname("$fsDir/$fn")."/.log/$name";          $logname=dirname("$fsDir/$fn")."/.log/$name";
# Line 844  function Navigate($fsRoot,$relDir) { Line 797  function Navigate($fsRoot,$relDir) {
797                                  $file_url_html = "$file $a";                                  $file_url_html = "$file $a";
798                          }                          }
799                  } else {                  } else {
800                          $b.="<A HREF=\"$self?A=Co&D=".urlencode($relDir)."&F=".urlencode($file);                          if (check_perm($relDir.$file,trperm_w)) {
801                          $b.="\" TITLE=\"Checkout file for edit\">" ;                                  $b.="<A HREF=\"$self?A=Co&D=".urlencode($relDir)."&F=".urlencode($file);
802                          $b.=$gblIcon("checkout")."</A>";                                  $b.="\" TITLE=\"Checkout file for edit\">" ;
803                                    $b.=$gblIcon("checkout")."</A>";
804                            }
805    
806                          if ( $ext=="" || strstr(join(" ",$gblEditable),$ext) ) {                            if ( $ext=="" || strstr(join(" ",$gblEditable),$ext) ) {  
807                                  $b.="<A HREF=\"$self?A=C&D=".urlencode($relDir)."&F=".urlencode($file);                                  $b.="<A HREF=\"$self?A=C&D=".urlencode($relDir)."&F=".urlencode($file);
# Line 1701  function Warn($text) { Line 1656  function Warn($text) {
1656          // read mime.types          // read mime.types
1657          readMime();          readMime();
1658    
1659  HTTP_POST_VAR("FN");          if (! isset($gblPermNote)) {
1660                    $gblPermNote = trperm_r;
1661            }
1662    
1663            HTTP_POST_VAR("FN");
1664    
1665          if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST") {          if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST") {
1666                  // take variables from server                  // take variables from server
# Line 1939  HTTP_POST_VAR("FN"); Line 1898  HTTP_POST_VAR("FN");
1898    
1899          case "UNLOCK" :            case "UNLOCK" :  
1900                  if ( $CONFIRM != "on" ) break ;                  if ( $CONFIRM != "on" ) break ;
1901                    if (! check_perm("$relDir/$FN", trperm_w))
1902                            Error("Access denied","User <tt>$gblLogin</tt> tried to unlock <tt>$relDir/$FN</tt> without valid trustee.",1);
1903                  Unlock("$fsDir/$FN");                  Unlock("$fsDir/$FN");
1904                  break ;                  break ;
1905    

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.26