Diff for /rat/lonpageflip.pm between versions 1.1 and 1.2

version 1.1, 2000/10/03 20:33:06 version 1.2, 2000/10/05 22:14:11
Line 10 Line 10
 # 08/30,08/31,09/06,09/14,09/15,09/16,09/19,09/20,09/21,09/23,  # 08/30,08/31,09/06,09/14,09/15,09/16,09/19,09/20,09/21,09/23,
 # 10/02 Gerd Kortemeyer)  # 10/02 Gerd Kortemeyer)
 #  #
 # 10/03 Gerd Kortemeyer  # 10/03,10/05 Gerd Kortemeyer
   
 package Apache::lonpageflip;  package Apache::lonpageflip;
   
Line 91  sub tracetable { Line 91  sub tracetable {
 # ================================================================ Main Handler  # ================================================================ Main Handler
   
 sub handler {  sub handler {
   my $r=shift;     my $r=shift;
   
 # ------------------------------------------- Set document type for header only  # ------------------------------------------- Set document type for header only
   
 #  if ($r->headers_only) {    if ($r->header_only) {
      $r->content_type('text/html');       $r->content_type('text/html');
      $r->send_http_header;       $r->send_http_header;
 #     return OK;       return OK;
 #  }    }
   
   
   # --------BEGIN DEBUG ONLY TRASH
       $r->content_type('text/html');
        $r->send_http_header;
   
     $r->print('<html><body>');
   # --------END DEBUG ONLY TRASH
   
   
     if (($ENV{'form.postdata'})&&($ENV{'request.course.fn'})) {
         $ENV{'form.postdata'}=~/(\w+)\:(.*)/;
         my $direction=$1;
         my $currenturl=$2;
         my $redirecturl=$currenturl;
         $currenturl=~s/^http\:\/\///;
         $currenturl=~s/^[^\/]+//;
         $currenturl=Apache::lonnet::declutter($currenturl);
   # ---------------------------------------------------------------- Tie database
         if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db',
                         &GDBM_READER,0640)) {
   # ---------------------------------------------- Get ID(s) for current resource
            my $syval=$hash{'ids_/res/'.$currenturl};
            if ($syval) {
   # ------------------------------------------------------------------- Has ID(s)
                my @possiblities=split(/\,/,$syval);
                $r->print($direction.' '.$currenturl.' '.$syval);
   
            } else {
   # --------------------------------------------------------- Does not have ID(s)
                $r->print('Weird');
            }
   # ------------------------------------- Program needs to get here to untie hash
            unless(untie(%hash)) {
               $r->log_reason('Could not untie database hash '.
    $ENV{'request.course.fn'}.' for '.$ENV{'user.name'}.
                            ' at '.$ENV{'user.domain'});
               return HTTP_SERVICE_UNAVAILABLE;
    }
   # ------------------------------------------------------------ Now do something
         } else {
   # ----------------------------------------- Serious problem, could not tie hash
             $r->log_reason('Could not tie database hash '.
    $ENV{'request.course.fn'}.' for '.$ENV{'user.name'}.
                            ' at '.$ENV{'user.domain'});
             return HTTP_SERVICE_UNAVAILABLE;
         }
   # -------------------------- Class was not initialized or page fliped strangely
     } else {
         $ENV{'user.error.msg'}="/adm/flip:bre:0:0:Choose Course";
         return HTTP_NOT_ACCEPTABLE; 
     } 
   
   
   
   
   # ------TRASH BELOW
   # --------------------------- TRASH
   
   $r->print('<html><body>'.$ENV{'form.postdata'}.'</body></html>');    $r->print('</body></html>');
   return OK;    return OK;
   
   
   # ========================================================= TOTAL TRASH
   
   my $requrl=$r->uri;    my $requrl=$r->uri;
 # ----------------------------------------------------------------- Tie db file  # ----------------------------------------------------------------- Tie db file

Removed from v.1.1  
changed lines
  Added in v.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>