74 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
75 |
|
|
76 |
$gblTitle = "Document Manager"; |
$gblTitle = "Document Manager"; |
77 |
$gblVersion = "2.0-pre1"; |
$gblVersion = "2.0-pre2"; |
78 |
|
|
79 |
$secHash = ""; |
$secHash = ""; |
80 |
|
|
81 |
// location of html files |
// location of html files |
82 |
$html = $gblIncDir."/html"; |
$html = $gblIncDir."/html"; |
83 |
|
|
84 |
LoadLanguage($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"]); |
if (isset($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"])) { |
85 |
|
LoadLanguage($HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"]); |
86 |
|
} |
87 |
|
|
88 |
// for security and configuration |
// for security and configuration |
89 |
$realm=$HTTP_SERVER_VARS["HTTP_HOST"]; |
$realm=$HTTP_SERVER_VARS["HTTP_HOST"]; |
149 |
} |
} |
150 |
include("$html/footer.html"); |
include("$html/footer.html"); |
151 |
|
|
152 |
global $debug; |
# global $debug; |
153 |
if ($debug) print $debug; |
# if ($debug) print $debug; |
154 |
} // end function EndHTML |
} // end function EndHTML |
155 |
|
|
156 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
246 |
include("$html/DetailPage-undelete.html"); |
include("$html/DetailPage-undelete.html"); |
247 |
include("$html/DetailPage-rename.html"); |
include("$html/DetailPage-rename.html"); |
248 |
|
|
249 |
} elseif (check_perm($relDir.$fn,$gblPermNote)) { |
} |
250 |
include("$html/DetailPage-note.html"); |
|
251 |
|
if (check_perm($relDir.$fn,$gblPermNote)) { |
252 |
|
include("$html/DetailPage-note.html"); |
253 |
} |
} |
254 |
|
|
255 |
print "</FORM>"; |
print "</FORM>"; |
537 |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
global $gblEditable, $gblIcon, $gblModDays, $webRoot, $gblHide, |
538 |
$gblIgnoreUnknownFileType, $gblRepositoryDir, |
$gblIgnoreUnknownFileType, $gblRepositoryDir, |
539 |
$gblLogin, $gblUserName, $gblDateFmt, $gblTimeFmt, |
$gblLogin, $gblUserName, $gblDateFmt, $gblTimeFmt, |
540 |
|
$gblPermNote, |
541 |
$fsRealmDir, $realm, $realm_sep, |
$fsRealmDir, $realm, $realm_sep, |
542 |
$html, $realm_config, |
$html, $realm_config, |
543 |
$HTTP_GET_VARS, $HTTP_SERVER_VARS; |
$HTTP_GET_VARS, $HTTP_SERVER_VARS; |
612 |
$text .= "<br>Examine list of files <a href=\"$self?A=Ch1\">changed in last day</a> or <a href=\"$self?A=Ch\">all changes</a>."; |
$text .= "<br>Examine list of files <a href=\"$self?A=Ch1\">changed in last day</a> or <a href=\"$self?A=Ch\">all changes</a>."; |
613 |
StartHTML("(Navigate)",$text) ; |
StartHTML("(Navigate)",$text) ; |
614 |
|
|
615 |
echo "<TABLE BORDER=0 CELLPADDING=2 |
print "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=3 WIDTH=\"100%\">" ; |
|
CELLSPACING=3 WIDTH=\"100%\">" ; |
|
616 |
|
|
617 |
// updir (parent) bar |
// updir (parent) bar |
618 |
if (chopsl($fsDir) != chopsl($fsRoot)) { |
if (chopsl($fsDir) != chopsl($fsRoot)) { |
630 |
return $out; |
return $out; |
631 |
} |
} |
632 |
|
|
633 |
if (! HTTP_GET_VAR("dsort")) $dsort = "name"; // default directory sort |
$dsort = HTTP_GET_VAR("dsort"); |
634 |
|
if (! isset($dsort)) $dsort = "name"; // default directory sort |
635 |
|
|
636 |
$dsort_arr = array( |
$dsort_arr = array( |
637 |
"name" => array ("rname", "note"), |
"name" => array ("rname", "note"), |
640 |
"rnote" => array ("name", "note") |
"rnote" => array ("name", "note") |
641 |
); |
); |
642 |
|
|
643 |
if (! HTTP_GET_VAR("fsort")) $fsort = "name"; // default directory sort |
$fsort = HTTP_GET_VAR("fsort"); |
644 |
|
if (! isset($fsort)) $fsort = "name"; // default directory sort |
645 |
|
|
646 |
$fsort_arr = array( |
$fsort_arr = array( |
647 |
"name" => array ("rname", "note", "date", "size"), |
"name" => array ("rname", "note", "date", "size"), |
703 |
} |
} |
704 |
|
|
705 |
$dir_url=$self."?D=".urlencode(chopsl($relDir)."/".$dir); |
$dir_url=$self."?D=".urlencode(chopsl($relDir)."/".$dir); |
706 |
|
if (check_perm($relDir.$dir,$gblPermNote)) { |
707 |
|
$note_html="<a href=\"$info_url#note\">".$gblIcon("note")."</a>".$dirNote[$key]; |
708 |
|
} else { |
709 |
|
$note_html=$dirNote[$key]; |
710 |
|
} |
711 |
|
|
712 |
|
$dir_html = isBlank($dir,"directory"); |
713 |
|
|
714 |
include("$html/Navigate-dirEntry.html"); |
include("$html/Navigate-dirEntry.html"); |
715 |
|
|
716 |
} // iterate over dirs |
} // iterate over dirs |
786 |
$file_url_html.="\" TITLE=\"View file\">" ; |
$file_url_html.="\" TITLE=\"View file\">" ; |
787 |
|
|
788 |
if (substr($file,0,5) != ".del/") { |
if (substr($file,0,5) != ".del/") { |
789 |
$file_url_html .= $file . "</A>" . $a ; |
$file_url_html .= isBlank($file) . "</A>" . $a ; |
790 |
} else { |
} else { |
791 |
$file_url_html .= substr($file,5,strlen($file)-5) . "</a> <a href=\"$info_url#undelete\"><SPAN CLASS=deleted TITLE=\"deleted\">deleted</span></a>"; |
$file_url_html .= isBlank(substr($file,5,strlen($file)-5)) . "</a> <a href=\"$info_url#undelete\"><SPAN CLASS=deleted TITLE=\"deleted\">deleted</span></a>"; |
792 |
} |
} |
793 |
|
|
794 |
$note_html="<a href=\"$info_url#note\">".$gblIcon("note")."</a>".ReadNote($path); |
if (check_perm($relDir.$file,$gblPermNote)) { |
795 |
|
$note_html="<a href=\"$info_url#note\">".$gblIcon("note")."</a>".$fileNote[$key]; |
796 |
|
} else { |
797 |
|
$note_html=$fileNote[$key]; |
798 |
|
} |
799 |
|
|
800 |
$ext = strtolower(strrchr($file,".")) ; |
$ext = strtolower(strrchr($file,".")) ; |
801 |
|
|
836 |
|
|
837 |
} // iterate over files |
} // iterate over files |
838 |
} else { // end if no files |
} else { // end if no files |
839 |
?> |
include("$html/Navigate-noFiles.html"); |
|
<TR><TD></TD><TD COLSPAN=5 CLASS=LST> |
|
|
No files in this directory |
|
|
</TD></TR> |
|
|
<? |
|
840 |
} |
} |
841 |
|
|
842 |
if ($emptyDir && $relDir != "") { |
if ($emptyDir && $relDir != "") { |
843 |
?> |
include("$html/Navigate-emptyDir.html"); |
|
|
|
|
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
|
|
<TR><TD></TD><TD COLSPAN=5 CLASS=BAR> |
|
|
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>"> |
|
|
OK TO DELETE THIS EMPTY FOLDER? |
|
|
<INPUT TYPE="CHECKBOX" NAME="CONFIRM"> |
|
|
<INPUT TYPE="SUBMIT" NAME="POSTACTION" VALUE="DELETE"> |
|
|
</TD></TR> |
|
|
</FORM> |
|
|
|
|
|
<?php |
|
844 |
} // end if emptyDir |
} // end if emptyDir |
|
?> |
|
845 |
|
|
846 |
<TR><TD></TD><TD COLSPAN=5><HR></TD></TR> |
include("$html/Navigate-hr.html"); |
847 |
|
|
848 |
<? |
if (file_exists("$fsRealmDir/$realm".$realm_sep."info.inc")) { |
849 |
|
print "<TR><TD></TD><TD COLSPAN=5>"; |
850 |
if (file_exists("$fsRealmDir/$realm".$realm_sep."info.inc")) { |
include("$fsRealmDir/$realm".$realm_sep."info.inc"); |
851 |
print "<TR><TD></TD><TD COLSPAN=5>"; |
print "</TD></TR>"; |
852 |
include("$fsRealmDir/$realm".$realm_sep."info.inc"); |
include("$html/Navigate-hr.html"); |
853 |
print "</TD></TR><TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
} elseif (file_exists("$gblRepositoryDir/.info.inc")) { |
854 |
} elseif (file_exists("$gblRepositoryDir/.info.inc")) { |
print "<TR><TD></TD><TD COLSPAN=5>"; |
855 |
print "<TR><TD></TD><TD COLSPAN=5>"; |
include("$gblRepositoryDir/.info.inc"); |
856 |
include("$gblRepositoryDir/.info.inc"); |
print "</TD></TR>"; |
857 |
print "</TD></TR><TR><TD></TD><TD COLSPAN=5><HR></TD></TR>"; |
include("$html/Navigate-hr.html"); |
858 |
} |
} |
859 |
|
|
860 |
|
include("$html/Navigate-createNew.html"); |
861 |
|
|
862 |
?> |
print "</TABLE>"; |
|
|
|
|
<FORM METHOD="POST" ACTION="<?= $self ?>"> |
|
|
<TR><TD></TD><TD COLSPAN=5 CLASS=BAR>CREATE NEW |
|
|
<INPUT TYPE="RADIO" NAME="T" VALUE="D" CHECKED>DIRECTORY -OR- |
|
|
<INPUT TYPE="RADIO" NAME="T" VALUE="F">FILE : |
|
|
<NOBR>NAME <INPUT TYPE="TEXT" NAME="FN" SIZE=14> |
|
|
<INPUT TYPE="HIDDEN" NAME="POSTACTION" VALUE="CREATE"> |
|
|
<INPUT TYPE="HIDDEN" NAME="DIR" VALUE="<?= $relDir ?>"> |
|
|
<INPUT TYPE="SUBMIT" VALUE="CREATE" NAME="CREATE"> |
|
|
</NOBR> |
|
|
<NOBR>OR <A HREF="<?= $self ?>?A=U&D=<?= urlencode($relDir) ?>">UPLOAD</A> A FILE</NOBR> |
|
|
</TD></TR> |
|
|
</FORM> |
|
|
</TABLE> |
|
863 |
|
|
|
<?php |
|
864 |
EndHTML() ; |
EndHTML() ; |
865 |
} // end function Navigate |
} // end function Navigate |
866 |
|
|
1281 |
$l = trim(fgets($fp_conf,4096)); |
$l = trim(fgets($fp_conf,4096)); |
1282 |
if (substr($l,0,1) == "+") { // no comment |
if (substr($l,0,1) == "+") { // no comment |
1283 |
$arr=explode(":",$l); |
$arr=explode(":",$l); |
1284 |
$groups_arr[$arr[0]] = $arr[1] ; |
$groups_arr[$arr[0]] = str_replace(" ","",$arr[1]) ; |
1285 |
} elseif (substr($l,0,1) != "#") { |
} elseif (substr($l,0,1) != "#") { |
1286 |
$arr=explode(":",$l); |
$arr=explode(":",$l); |
1287 |
$path=array_shift($arr); |
$path=array_shift($arr); |
1543 |
} |
} |
1544 |
|
|
1545 |
////////////////////////////////////////////////////////////////// |
////////////////////////////////////////////////////////////////// |
1546 |
|
|
1547 |
|
function isBlank($file,$what = "filename") { |
1548 |
|
if (trim($file) == "") return "<i>whitespace $what</i>"; |
1549 |
|
if ($file == "") return "<i>no $what</i>"; |
1550 |
|
return $file; |
1551 |
|
} |
1552 |
|
|
1553 |
|
////////////////////////////////////////////////////////////////// |
1554 |
// MAIN PROGRAM |
// MAIN PROGRAM |
1555 |
|
|
1556 |
$gblFilePerms = 0640 ; // default for new files |
$gblFilePerms = 0640 ; // default for new files |
1713 |
|
|
1714 |
$source = $FN_name ; |
$source = $FN_name ; |
1715 |
if (! file_exists($source)) { |
if (! file_exists($source)) { |
1716 |
Error("You must select file with browse to upload it!"); |
Error("You must select file with browse to upload it!","If file is too big, you might need to modify php configuration options <tt>post_max_size</tt> and <tt>upload_max_filesize</tt>",1); |
1717 |
} |
} |
1718 |
|
|
1719 |
if (HTTP_POST_VAR("FILENAME")) check_filename($FILENAME); |
if (HTTP_POST_VAR("FILENAME")) check_filename($FILENAME); |