/[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.38 by dpavlin, Tue Mar 27 10:54:02 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 1058  function urlpath($url) { Line 1060  function urlpath($url) {
1060  function safe_rename($fromdir,$fromfile,$tofile) {  function safe_rename($fromdir,$fromfile,$tofile) {
1061          function try_rename($from,$to) {          function try_rename($from,$to) {
1062                  print "$from -> $to\n";                  print "$from -> $to\n";
1063                  if (file_exists($from) && is_writable(dirname($to))) {                  if (file_exists($from) && is_writeable(dirname($to))) {
1064                          rename($from,$to);                          rename($from,$to);
1065                  }                  }
1066          }          }
# Line 1166  function DisplayChangeLog($day) { Line 1168  function DisplayChangeLog($day) {
1168    
1169          $htusers_file=dirname($SCRIPT_FILENAME)."/.htusers";          $htusers_file=dirname($SCRIPT_FILENAME)."/.htusers";
1170          if (! file_exists($htusers_file)) {          if (! file_exists($htusers_file)) {
1171                  if (is_writable(dirname($SCRIPT_FILENAME))) {                  if (is_writeable(dirname($SCRIPT_FILENAME))) {
1172                          $htusers=fopen($htusers_file,"a+");                          $htusers=fopen($htusers_file,"a+");
1173                          fputs($htusers,"# Change owner of $htusers_file to root !!\n");                          fputs($htusers,"# Change owner of $htusers_file to root !!\n");
1174                          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 1214  function DisplayChangeLog($day) {
1214                  $relDir = urldecode($D) ;  // then use GET                  $relDir = urldecode($D) ;  // then use GET
1215          }                }      
1216    
1217            $relDir=stripSlashes($relDir);
1218    
1219          if ($relDir == "/") $relDir = "" ;                if ($relDir == "/") $relDir = "" ;      
1220          // default : website root = ""          // default : website root = ""
1221    
# Line 1246  function DisplayChangeLog($day) { Line 1250  function DisplayChangeLog($day) {
1250    
1251          $FN=stripSlashes($FN);          $FN=stripSlashes($FN);
1252    
1253            if (file_exists("$fsScriptDir/.docman.conf")) {
1254                    include("$fsScriptDir/.docman.conf");
1255            }
1256    
1257          switch ($POSTACTION) {          switch ($POSTACTION) {
1258          case "UPLOAD" :          case "UPLOAD" :
1259                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;                  if (!is_writeable($fsDir)) Error("Write denied",$relDir) ;
# Line 1321  function DisplayChangeLog($day) { Line 1329  function DisplayChangeLog($day) {
1329  // this functionality is doubled in DetailView().  // this functionality is doubled in DetailView().
1330  // better keep it here altogether  // better keep it here altogether
1331  // chmod perms to $gblFilePerms  // chmod perms to $gblFilePerms
1332                          if ( file_exists($path) && !is_writable($path) )                          if ( file_exists($path) && !is_writeable($path) )
1333                                  Error("File not writable", $relPath) ;                                  Error("File not writable", $relPath) ;
1334                          $fh = fopen($path, "w+") ;                          $fh = fopen($path, "w+") ;
1335                          if ($fh) {                          if ($fh) {

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

  ViewVC Help
Powered by ViewVC 1.1.26