/[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.34 by dpavlin, Fri Feb 23 11:51:39 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_writable(dirname($to))) {                  if (file_exists($from) && is_writeable(dirname($to))) {
1065                          rename($from,$to);                          rename($from,$to);
1066                  }                  }
1067          }          }
# 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 1166  function DisplayChangeLog($day) { Line 1169  function DisplayChangeLog($day) {
1169    
1170          $htusers_file=dirname($SCRIPT_FILENAME)."/.htusers";          $htusers_file=dirname($SCRIPT_FILENAME)."/.htusers";
1171          if (! file_exists($htusers_file)) {          if (! file_exists($htusers_file)) {
1172                  if (is_writable(dirname($SCRIPT_FILENAME))) {                  if (is_writeable(dirname($SCRIPT_FILENAME))) {
1173                          $htusers=fopen($htusers_file,"a+");                          $htusers=fopen($htusers_file,"a+");
1174                          fputs($htusers,"# Change owner of $htusers_file to root !!\n");                          fputs($htusers,"# Change owner of $htusers_file to root !!\n");
1175                          fputs($htusers,"demo:full name:[md5_hash|auth_*]:e-mail\n");                          fputs($htusers,"demo:full name:[md5_hash|auth_*]:e-mail\n");
# 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) ;
# Line 1321  function DisplayChangeLog($day) { Line 1330  function DisplayChangeLog($day) {
1330  // this functionality is doubled in DetailView().  // this functionality is doubled in DetailView().
1331  // better keep it here altogether  // better keep it here altogether
1332  // chmod perms to $gblFilePerms  // chmod perms to $gblFilePerms
1333                          if ( file_exists($path) && !is_writable($path) )                          if ( file_exists($path) && !is_writeable($path) )
1334                                  Error("File not writable", $relPath) ;                                  Error("File not writable", $relPath) ;
1335                          $fh = fopen($path, "w+") ;                          $fh = fopen($path, "w+") ;
1336                          if ($fh) {                          if ($fh) {

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

  ViewVC Help
Powered by ViewVC 1.1.26