]> git.donarmstrong.com Git - biopieces.git/commitdiff
this is the index we want from xeon
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 15 Dec 2009 08:00:05 +0000 (08:00 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 15 Dec 2009 08:00:05 +0000 (08:00 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@812 74ccb610-7750-0410-82ae-013aeee3265d

code_perl/Maasha/Filesys.pm
www/index.cgi

index 0f5f93d2d3eef8363fbd7d976e9ffd282a3b7ffb..5c26fdd777471965af6d60c1f9e90a2b44ee5927 100644 (file)
@@ -413,6 +413,8 @@ sub ls_dirs
 
     close $dh;
 
+    @dirs = sort @dirs;
+
     return wantarray ? @dirs : \@dirs;
 }
 
index 1fc10db23b37336386438d198a49f28a21534f8c..ef3f4885b49be33560bb03bdf66bb7b4d34c056e 100755 (executable)
@@ -109,7 +109,7 @@ sub cookie_default
     $cookie->{ 'SESSION_DIR' }     = "Sessions";
     $cookie->{ 'LIST_PAGES' }      = [ qw( clade genome assembly contig browse ) ];
 
-    $cookie->{ 'USER' }            = $cgi->param( 'user' );
+    $cookie->{ 'USER' }            = $cgi->param( 'user' ) || '';
     $cookie->{ 'PASSWORD' }        = $cgi->param( 'password' );
     $cookie->{ 'SESSION_ID' }      = $cgi->param( 'session_id' );
 
@@ -199,10 +199,35 @@ sub cookie_session
 
     $session = Maasha::BGB::Session::session_restore( "$cookie->{ 'SESSION_DIR' }/sessions.txt" );
 
-    $cookie->{ 'PAGE' } = 'login' if not $cookie->{ 'SESSION_ID' };
-    $cookie->{ 'PAGE' } = 'login' if $cookie->{ 'SESSION_ID' } ne $ENV{ 'SSL_SESSION_ID' };
-    $cookie->{ 'PAGE' } = 'login' if not exists $session->{ $cookie->{ 'USER' } };
-    $cookie->{ 'PAGE' } = 'login' if $session->{ $cookie->{ 'USER' } }->{ 'SESSION_ID' } ne $cookie->{ 'SESSION_ID' };
+    # if ( $cookie->{ 'SESSION_ID' } )
+    # {
+    #     if ( $cookie->{ 'SESSION_ID' } ne $ENV{ 'SSL_SESSION_ID' } ) {
+    #         $cookie->{ 'PAGE' } = 'login';
+    #         print STDERR "HER1"; # DEBUG
+    #     }
+    # }
+    # else
+    # {
+    #     $cookie->{ 'PAGE' } = 'login';
+    # 
+    #     print STDERR "HER2"; # DEBUG
+    # }
+
+    if ( exists $session->{ $cookie->{ 'USER' } } and $cookie->{ 'SESSION_ID' } )
+    {
+        if ( $session->{ $cookie->{ 'USER' } }->{ 'SESSION_ID' } ne $cookie->{ 'SESSION_ID' } ) {
+            $cookie->{ 'PAGE' } = 'login';
+            print STDERR "HER3"; # DEBUG
+        }
+    }
+    else
+    {
+        $cookie->{ 'PAGE' } = 'login';
+        print STDERR "HER4"; # DEBUG
+        print STDERR "NO COOKIE SESSION ID\n" if not $cookie->{ 'SESSION_ID' }; # DEBUG
+        print STDERR "NO COOKIE SESSION ID\n" if not $cookie->{ 'USER' }; # DEBUG
+        print STDERR "NO SESSION USER\n"      if not exists $session->{ $cookie->{ 'USER' } }; # DEBUG
+    }
 }
 
 
@@ -220,20 +245,29 @@ sub cookie_login
 
     my ( $session );
 
+<<<<<<< .mine
+=======
     $session = Maasha::BGB::Session::session_restore( "$cookie->{ 'SESSION_DIR' }/sessions.txt" );
     
+>>>>>>> .r811
     if ( $cookie->{ 'USER' } and $cookie->{ 'PASSWORD' } )
     {
+        $session = Maasha::BBrowser::Session::session_restore( "$cookie->{ 'SESSION_DIR' }/sessions.txt" );
+    
         if ( exists $session->{ $cookie->{ 'USER' } } and
              $session->{ $cookie->{ 'USER' } }->{ 'PASSWORD' } eq Digest::MD5::md5_hex( $cookie->{ 'PASSWORD' } ) )
         {
+<<<<<<< .mine
+            $session->{ $cookie->{ 'USER' } }->{ 'SESSION_ID' } ||= Maasha::BBrowser::Session::session_new();
+            # $session->{ $cookie->{ 'USER' } }->{ 'SESSION_ID' }   = $ENV{ 'SSL_SESSION_ID' };
+=======
             # $session->{ $cookie->{ 'USER' } }->{ 'SESSION_ID' } ||= Maasha::BGB::Session::session_new();
             $session->{ $cookie->{ 'USER' } }->{ 'SESSION_ID' }   = $ENV{ 'SSL_SESSION_ID' };
+>>>>>>> .r811
             $session->{ $cookie->{ 'USER' } }->{ 'TIME' }         = Maasha::Common::time_stamp();
 
             $cookie->{ 'SESSION_ID' } = $session->{ $cookie->{ 'USER' } }->{ 'SESSION_ID' };
             $cookie->{ 'LOGIN' }      = "OK";
-            $cookie->{ 'USER' }       = $cookie->{ 'USER' };
             $cookie->{ 'PAGE' }       = 'clade'; 
 
             Maasha::BGB::Session::session_store( "$cookie->{ 'SESSION_DIR' }/sessions.txt", $session );
@@ -490,7 +524,9 @@ sub page
         push @html, page_taxonomy( $cookie );
     }
 
-    push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "session_id", value => "$cookie->{ 'SESSION_ID' }" ) );
+    if ( $cookie->{ 'SESSION_ID' } ) {
+        push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "session_id", value => "$cookie->{ 'SESSION_ID' }" ) );
+    }
 
     return wantarray ? @html : \@html;
 }
@@ -973,7 +1009,7 @@ sub section_dna
     $beg =~ tr/,//d;
     $end =~ tr/,//d;
 
-    $seq = ">$cookie->{ 'CONTIG' }_$beg" . "_$end" . "_$cookie->{ 'STRAND' }\n";
+    $seq = join ";", ">$cookie->{ 'GENOME' }", $cookie->{ 'ASSEMBLY' }, $cookie->{ 'CONTIG' }, $beg, $end, "$cookie->{ 'STRAND' }\n";
     $seq .= Maasha::BGB::Track::dna_get( $cookie );
 
     push @html, Maasha::XHTML::h2( txt => "DNA", class => 'center' );