/[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.49 by dpavlin, Fri Dec 14 17:28:06 2001 UTC revision 1.50 by dpavlin, Sat Dec 15 20:33:37 2001 UTC
# Line 174  global $gblDateFmt, $gblTimeFmt, $gblUse Line 174  global $gblDateFmt, $gblTimeFmt, $gblUse
174  <B><?= date($gblDateFmt) ?> -  <B><?= date($gblDateFmt) ?> -
175  <?= date($gblTimeFmt) ?> -  <?= date($gblTimeFmt) ?> -
176  <?= $gblUserName ?>  <?= $gblUserName ?>
177  <small> [<a href="<?= $PHP_SELF ?>?relogin=<?= $gblPw ?>">logout</a>]</small>  <?php
178            global $PHP_AUTH_USER,$PHP_AUTH_PW;
179            $url = $PHP_SELF."?relogin=";
180            if (isset($gblPw) && $gblPw != "") {
181                    $url .= $gblPw;
182            } else {
183                    $url .= md5($PHP_AUTH_USER.$PHP_AUTH_PW);
184            }
185            if (isset($PHP_AUTH_USER) && $PHP_AUTH_USER != "" && ($PHP_AUTH_PW == "" || !isset($PHP_AUTH_PW))) {
186                    $url_title="login";
187            } else {
188                    $url_title="relogin";
189            }
190            $url.="&AU=${PHP_AUTH_USER}|AP=${PHP_AUTH_PW}|";
191    ?>
192    <small> [<a href="<?= $url ?>"><?= $url_title ?></a>]</small>
193  </B>  </B>
194  <BR><small>  <BR><small>
195  Document Manager <?= $gblVersion ?>, based on ANYPORTAL(php) Site Manager  Document Manager <?= $gblVersion ?>, based on ANYPORTAL(php) Site Manager
# Line 950  function NoEntry() { Line 965  function NoEntry() {
965    
966          $title = "(401 Unauthorized)" ;          $title = "(401 Unauthorized)" ;
967          $text  = "No trespassing !" ;          $text  = "No trespassing !" ;
968    
969            global $PHP_AUTH_USER,$PHP_AUTH_PW,$gblPw,$relogin;
970          StartHTML($title,$text) ;          StartHTML($title,$text) ;
971    
972          EndHTML() ;          EndHTML() ;
# Line 1243  function chopsl($path) { Line 1260  function chopsl($path) {
1260                  Error("Configuration error","Can't find user handling module at <tt>$gblIncDir/$gblUsers.php</tt> ! Please fix <tt>$fsScriptDir/.docman.conf</tt>");                  Error("Configuration error","Can't find user handling module at <tt>$gblIncDir/$gblUsers.php</tt> ! Please fix <tt>$fsScriptDir/.docman.conf</tt>");
1261          }          }
1262    
1263            // if no password, or empty password logout
1264            if (
1265                    isset($PHP_AUTH_USER) && (
1266                            !isset($relogin) || (
1267                                    isset($relogin) && $relogin != md5($PHP_AUTH_USER.$PHP_AUTH_PW)
1268                            )
1269                    ) && (
1270                            $PHP_AUTH_PW == "" || !isset($PHP_AUTH_PW)
1271                    )
1272               ) {
1273                    StartHTML("Logout completed","Your login credentials has been erased") ;
1274                    EndHTML() ;
1275                    exit ;
1276            }
1277    
1278          // authentication failure          // authentication failure
1279          if ( md5($PHP_AUTH_USER.$PHP_AUTH_PW) != $gblPw ||          if ( md5($PHP_AUTH_USER.$PHP_AUTH_PW) != $gblPw ||
1280                  isset($relogin) && $gblPw == $relogin ) {                  isset($relogin) && $gblPw == $relogin) {
1281                  header("WWW-authenticate: basic realm=\"$HTTP_HOST\"") ;                  header("WWW-authenticate: basic realm=\"$HTTP_HOST\"") ;
1282                  header("HTTP/1.0 401 Unauthorized") ;                  header("HTTP/1.0 401 Unauthorized") ;
1283                  NoEntry() ;                  NoEntry() ;

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.50

  ViewVC Help
Powered by ViewVC 1.1.26