/[docman]/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.35 by dpavlin, Sun Mar 11 15:36:51 2001 UTC revision 1.40 by dpavlin, Fri Apr 6 08:46:42 2001 UTC
# Line 236  function DetailPage($fsRoot,$relDir,$fn) Line 236  function DetailPage($fsRoot,$relDir,$fn)
236                  $fsize = filesize($fsPath) ;                  $fsize = filesize($fsPath) ;
237                  $fmodified = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", filemtime($fsPath)) ;                  $fmodified = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", filemtime($fsPath)) ;
238                  $faccessed = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", fileatime($fsPath)) ;                  $faccessed = date("$GLOBALS[gblDateFmt] $GLOBALS[gblTimeFmt]", fileatime($fsPath)) ;
239                  $userinfo = posix_getpwuid(fileowner($fsPath));                  $fuid=fileowner($fsPath);
240                  $grpinfo = posix_getgrgid(filegroup($fsPath));                  $fgid=filegroup($fsPath);
241                    $userinfo = posix_getpwuid($fuid);
242                    $grpinfo = posix_getgrgid($fgid);
243                  echo "<PRE>";                  echo "<PRE>";
244                  if (!is_dir($fsPath)) echo "file size: " . $fsize . " Bytes<BR>" ;                  if (!is_dir($fsPath)) echo "    file size: " . $fsize . " Bytes<BR>" ;
245                  echo "last modified: <B>" . $fmodified . "</B><BR>" ;                  echo "last modified: <B>" . $fmodified . "</B><BR>" ;
246                  echo "last accessed: <B>" . $faccessed . "</B><BR>" ;                  echo "last accessed: <B>" . $faccessed . "</B><BR>" ;
247                  echo "        owner: <B>" . $userinfo["name"] . "</B><BR>" ;                  echo "        owner: <B>" . $userinfo["name"] . " [$fuid]</B><BR>" ;
248                  echo "        group: <B>" . $grpinfo["name"] . "</B><BR>" ;                  echo "        group: <B>" . $grpinfo["name"] . " [$fgid]</B><BR>" ;
249                  echo "  permissions: <B>" ;                  echo "  permissions: <B>" ;
250                  echo printf( "%o", fileperms($fsPath) ) . "</B>" ;                  echo printf( "%o", fileperms($fsPath) ) . "</B>" ;
251                  echo "</PRE>" ;                  echo "</PRE>" ;
# Line 854  if (file_exists(".info.inc")) { Line 856  if (file_exists(".info.inc")) {
856   <NOBR>NAME <INPUT TYPE="TEXT" NAME="FN" SIZE=14>   <NOBR>NAME <INPUT TYPE="TEXT" NAME="FN" SIZE=14>
857   <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="CREATE">   <INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="CREATE">
858   <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>">   <INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>">
859   <INPUT TYPE="SUBMIT" VALUE="CREATE"></NOBR>   <INPUT TYPE="SUBMIT" VALUE="CREATE" NAME="CREATE">
860     </NOBR>
861   <NOBR>OR <A HREF="<?= $self ?>?A=U&D=<?= urlencode($relDir) ?>">UPLOAD</A> A FILE   <NOBR>OR <A HREF="<?= $self ?>?A=U&D=<?= urlencode($relDir) ?>">UPLOAD</A> A FILE
862   </NOBR>   </NOBR>
863  </TD></TR>  </TD></TR>
# Line 1057  function urlpath($url) { Line 1060  function urlpath($url) {
1060    
1061  function safe_rename($fromdir,$fromfile,$tofile) {  function safe_rename($fromdir,$fromfile,$tofile) {
1062          function try_rename($from,$to) {          function try_rename($from,$to) {
1063                  print "$from -> $to\n";  #               print "$from -> $to\n";
1064                  if (file_exists($from) && is_writeable(dirname($to))) {                  if (file_exists($from) && is_writeable(dirname($to))) {
1065                          rename($from,$to);                          rename($from,$to);
1066                  }                  }
# Line 1073  function safe_rename($fromdir,$fromfile, Line 1076  function safe_rename($fromdir,$fromfile,
1076          $todir=dirname($to);          $todir=dirname($to);
1077          $tofile=basename($to);          $tofile=basename($to);
1078    
1079          print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n";  #       print "<pre>$fromdir / $fromfile -> $todir / $tofile\n\n";
1080    
1081          try_rename("$fromdir/$fromfile","$todir/$tofile");          try_rename("$fromdir/$fromfile","$todir/$tofile");
1082          try_dir("$todir/.log");          try_dir("$todir/.log");
# Line 1212  function DisplayChangeLog($day) { Line 1215  function DisplayChangeLog($day) {
1215                  $relDir = urldecode($D) ;  // then use GET                  $relDir = urldecode($D) ;  // then use GET
1216          }                }      
1217    
1218            $relDir=stripSlashes($relDir);
1219    
1220          if ($relDir == "/") $relDir = "" ;                if ($relDir == "/") $relDir = "" ;      
1221          // default : website root = ""          // default : website root = ""
1222    
# Line 1246  function DisplayChangeLog($day) { Line 1251  function DisplayChangeLog($day) {
1251    
1252          $FN=stripSlashes($FN);          $FN=stripSlashes($FN);
1253    
1254            if (file_exists("$fsScriptDir/.docman.conf")) {
1255                    include("$fsScriptDir/.docman.conf");
1256            }
1257    
1258          switch ($POSTACTION) {          switch ($POSTACTION) {
1259          case "UPLOAD" :          case "UPLOAD" :
1260                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.26