From: martinahansen Date: Tue, 15 Dec 2009 08:00:05 +0000 (+0000) Subject: this is the index we want from xeon X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5f9f149db5849ab5175f332702c24a777419085a;p=biopieces.git this is the index we want from xeon git-svn-id: http://biopieces.googlecode.com/svn/trunk@812 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_perl/Maasha/Filesys.pm b/code_perl/Maasha/Filesys.pm index 0f5f93d..5c26fdd 100644 --- a/code_perl/Maasha/Filesys.pm +++ b/code_perl/Maasha/Filesys.pm @@ -413,6 +413,8 @@ sub ls_dirs close $dh; + @dirs = sort @dirs; + return wantarray ? @dirs : \@dirs; } diff --git a/www/index.cgi b/www/index.cgi index 1fc10db..ef3f488 100755 --- a/www/index.cgi +++ b/www/index.cgi @@ -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' );