/[docman2]/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.39 by dpavlin, Wed Jun 11 02:32:50 2003 UTC revision 1.40 by dpavlin, Thu Jun 12 18:09:01 2003 UTC
# Line 22  Line 22 
22    
23          error_reporting(E_ALL) ;                // how verbose ?          error_reporting(E_ALL) ;                // how verbose ?
24    
25          // from where to include auth_*.php modules?          // try to do some guessing about configuration
26          // this is defined in global configuration file /etc/docman.conf          $script = $HTTP_SERVER_VARS["SCRIPT_FILENAME"];
27          //$gblIncDir = "/data/docman2";          if (is_link($script)) $script=readlink($script);
28            $gblIncDir = dirname($script);
29            $html = $gblIncDir."/html";
30    
31            // location of master docman configuration file
32            $docman_conf = "/etc/docman.conf";
33            if (! file_exists($docman_conf)) {
34                    $error = "Can't find master configuration file <tt>$docman_conf</tt>. See <tt>docman2/doc/upgrade.html#docman_conf</tt> for more informations";
35    
36                    error_log("docman: $error");
37                    Error("docman not installed completly",$error);
38            }
39            include($docman_conf);
40    
41            if (! isset($gblIncDir)) {
42                    $error = "Can't findi <tt>\$gblIncDir</tt> in master configuration file <tt>$docman_conf</tt>. This variable should point to docman installation directory";
43    
44                    error_log("docman: $error");
45                    Error("docman not installed completly",$error);
46            }
47    
48            // location of html files
49            $html = $gblIncDir."/html";
50    
51          // force download on view (so it won't open in associated application)          // force download on view (so it won't open in associated application)
52          $gblForceDownload = 0;          $gblForceDownload = 0;
# Line 92  Line 114 
114          // for security and configuration          // for security and configuration
115          $realm=$HTTP_SERVER_VARS["HTTP_HOST"];          $realm=$HTTP_SERVER_VARS["HTTP_HOST"];
116    
         $fsDocumentRoot = dirname($HTTP_SERVER_VARS["SCRIPT_FILENAME"]);  
         if ($fsDocumentRoot == "") Error("Configuration error","Can't get SCRIPT_FILENAME from your web server. Please set <tt>\$fsDocumentRoot</tt> in <tt>\$</tt>",1);  
   
117          // globals for later          // globals for later
118          $gblLogin = HTTP_SERVER_VAR("PHP_AUTH_USER");          $gblLogin = HTTP_SERVER_VAR("PHP_AUTH_USER");
119          $gblPasswd = HTTP_SERVER_VAR("PHP_AUTH_PW");          $gblPasswd = HTTP_SERVER_VAR("PHP_AUTH_PW");
# Line 115  function LoadLanguage($lang) { Line 134  function LoadLanguage($lang) {
134    
135  function StartHTML($title,$text="") {  function StartHTML($title,$text="") {
136    
137          global $html,$fsDocumentRoot,$gblTitle,$HTTP_SERVER_VARS;          global $html,$gblIncDir,$gblTitle,$HTTP_SERVER_VARS;
138    
139          $host  = $HTTP_SERVER_VARS["HTTP_HOST"] ;          $host  = $HTTP_SERVER_VARS["HTTP_HOST"] ;
140          $self  = $HTTP_SERVER_VARS["PHP_SELF"] ;          $self  = $HTTP_SERVER_VARS["PHP_SELF"] ;
141    
142          if (file_exists("$fsDocumentRoot/docman.css")) {          if (file_exists("$gblIncDir/docman.css")) {
143                  $css = "";                  $css = "";
144                  $d = dirname($self);                  $d = dirname($self);
145                  if ($d != "/") $css = $d;                  if ($d != "/") $css = $d;
# Line 1584  function isBlank($file,$what = "filename Line 1603  function isBlank($file,$what = "filename
1603                  exit;                  exit;
1604          }          }
1605    
         // location of master docman configuration file  
         $docman_conf = "/etc/docman.conf";  
         if (! file_exists($docman_conf)) {  
                 $error = "Can't find master configuration file <tt>$docman_conf</tt>. See <tt>docman2/doc/upgrade.html#docman_conf</tt> for more informations";  
   
                 error_log("docman: $error");  
                 Error("docman not installed completly",$error);  
         }  
         include($docman_conf);  
   
         // location of html files  
         $html = $gblIncDir."/html";  
   
1606          // set fsRealmDir          // set fsRealmDir
1607          if (! isset($fsRealmDir)) {          if (! isset($fsRealmDir)) {
1608                  $fsRealmDir = "$gblIncDir/realm";                  $fsRealmDir = "$gblIncDir/realm";

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

  ViewVC Help
Powered by ViewVC 1.1.26