--- docman.php 2000/08/04 10:13:10 1.7
+++ docman.php 2001/01/26 12:39:57 1.30
@@ -35,22 +35,14 @@
/* existent address after file modifications. */
/*
- 2000-07-25 Dobrica Pavlinusic
- nuked exec calls (unsecure)
- nuked writeable function (replaced by php is_writeable)
- added support for https (tested with apache+mod_ssl)
- added users file
- date format user-selectable
- cycle backup files in bak directory
- support links as directoryes (for now)
- support of file history logging
- undelete capabilities (delete moves to .del directory)
+ This project is now called Directory Manager.
- 2000-07-26 DbP
+ For more info, please see web pages at
+ http://www.rot13.org/~dpavlin/docman.html
- added more checking on entered filename (when creating file/dir)
- added rename option
+ It's relased under GPL by
+ Dobrica Pavlinusic
IMPORTANT INSTALLATION NOTE:
@@ -59,15 +51,14 @@
deleted files!
.htusers is in form:
- login:Real Name:md5(loginpassword)
+ login:Real Name:[md5(loginpassword)|auth_*]:email@host.dom
TODO:
mixed file/directory output (add type to each entry,
real support for links)
- add more content-management (like cms.sourceforge.net):
- check-out/check-in/reserve
- comments to files
+ access controll
+
*/
//////////////////////////////////////////////////////////////////
@@ -80,58 +71,67 @@
// GLOBAL PARAMETERS
// =================
-// Make modifications here to suit siteman to your needs
+// Make modifications here to suit docman to your needs
// error_reporting(4) ; // how verbose ?
+ // from where to include auth_*.php modules?
+ $gblIncDir = "/home/httpd/docman";
+
// username/password should not be system
// usernames/passwords !!
-// $gblPw = "hash_of_your_username_and_password" ;
-
-// $gblAuth = false ; // use builtin authentication
- $gblAuth = true ; // use builtin authentication
- $gblHash = "md5" ; // hash function to use
-
$gblPw = "";
- if ($gblAuth) {
- $htusers_file=dirname($SCRIPT_FILENAME)."/.htusers";
- if (! file_exists($htusers_file)) {
- $htusers=fopen($htusers_file,"a+");
- fputs($htusers,"# Change owner of $htusers_file to root !!\n");
- fputs($htusers,"demo:full name:md5_hash\n");
- fclose($htusers);
- }
- $htusers=fopen($htusers_file,"r");
- while($user = fgetcsv($htusers,255,":")) {
- if ($user[0] == $GLOBALS["PHP_AUTH_USER"]) {
- $gblUserName=$user[1];
- $gblPw=$user[2];
- continue ;
+ $htusers_file=dirname($SCRIPT_FILENAME)."/.htusers";
+ if (! file_exists($htusers_file)) {
+ $htusers=fopen($htusers_file,"a+");
+ fputs($htusers,"# Change owner of $htusers_file to root !!\n");
+ fputs($htusers,"demo:full name:[md5_hash|auth_*]:e-mail\n");
+ fclose($htusers);
+ }
+ $htusers=fopen($htusers_file,"r");
+ while($user = fgetcsv($htusers,255,":")) {
+ if ($user[0] == $GLOBALS["PHP_AUTH_USER"]) {
+ $gblUserName=$user[1];
+ $gblPw=$user[2];
+ if (substr($gblPw,0,5) == "auth_" && file_exists("$gblIncDir/$gblPw.php")) {
+ require("$gblIncDir/$gblPw.php");
+ if ($gblPw($user)) {
+ $gblPw=md5($PHP_AUTH_USER.$PHP_AUTH_PW);
+ } else {
+ $gblPw="error".md5($PHP_AUTH_USER.$PHP_AUTH_PW);
+ }
}
+ $gblEmail=$user[3];
+ continue ;
}
- fclose($htusers);
}
+ fclose($htusers);
+ // date format
// $gblDateFmt="D, F d, Y";
-// $gblTimeFmt="g:i:sA";
-
$gblDateFmt="Y-m-d";
+
+ // time format
+// $gblTimeFmt="g:i:sA";
$gblTimeFmt="H:i:s";
-// Number of backup files to keep
- $gblNumBackups=5;
+ // Number of backup files to keep
+ $gblNumBackups=3;
+
+ // show red star if newer than ... days
+ $gblModDays=1;
// choose GifIcon below unless you have the M$
// WingDings font installed on your system
- $gblIcon = "GifIcon" ; // MockIcon or GifIcon
+ $gblIcon="GifIcon"; // MockIcon or GifIcon
// the directory below should be /icons/ or /icons/small/
// on Apache; a set of icons is included in the distribution
- $gblIconLocation = "/icons/" ;
+ $gblIconLocation="/icons/";
// files you want to be able to edit in text mode
// and view with (primitive) syntax highlighting
@@ -150,7 +150,7 @@
function StartHTML($title,$text="") {
- $title = "Site Manager " . $title ;
+ $title = "Document Manager " . $title ;
$host = $GLOBALS["HTTP_HOST"] ;
$self = $GLOBALS["PHP_SELF"] ;
?>
@@ -194,7 +194,7 @@
- include(".debug.inc") ?>
+ //include(".debug.inc") ?>