From: naoki i. <am...@us...> - 2008-04-28 11:17:38
|
Update of /cvsroot/popfile/engine/UI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27948/UI Modified Files: HTML.pm Log Message: Change Log 1. POP3 proxy no longer returns both '+OK' and '-ERR' when bad account is passed Proxy/POP3.pm 2. POP3S proxy and POP3 proxy share the POP3 accounts Classifier/Bayes.pm 3. Account table is used in the transparent proxy mode too Classifier/Bayes.pm In the transparent proxy mode, if the specified user is not found then POPFile will use the accounts table. 4. Add 'timeout' status message on the Password page 5. Add status messages for changing between Multiuser and Single user modes on the Administration page UI/HTML.pm languages/English.pm languages/Nihongo.pm 6. Add multiuser mode tests tests/TestPOP3.tst 7. Add some tests tests/TestBayes.tst tests for copying magnets and corpus tests for get_magnet_header_and_value 8. Fix TestHTML to pass on MSWin32 tests/TestHTML.tst tests/TestHTML.script 9. Remove an unwanted comment UI/HTML.pm Current state of the test suite: TestBayesScript PASS TestBayes PASS TestConfiguration PASS TestHistory PASS TestHTML PASS * TestHTTP PASS TestIMAP PASS TestInsertScript PASS * TestLogger PASS TestMailParse PASS TestModule PASS TestMQ PASS TestMutex PASS TestPipeScript PASS TestPOP3 PASS TestProxy PASS TestWordMangle PASS TestXMLRPC PASS * : TODO : needs to add tests for multi user support Index: HTML.pm =================================================================== RCS file: /cvsroot/popfile/engine/UI/HTML.pm,v retrieving revision 1.392 retrieving revision 1.393 diff -C2 -d -r1.392 -r1.393 *** HTML.pm 25 Apr 2008 16:26:27 -0000 1.392 --- HTML.pm 28 Apr 2008 11:17:43 -0000 1.393 *************** *** 364,375 **** return $session; } else { $self->history_()->stop_query( $self->{sessions__}{$session}{q} ); delete $self->{sessions__}{$session}; ! return undef; } } - # Check that the session ID is still valid in the API. - if ( defined( $user ) ) { # $self->{sessions__}{$session}{lastused} = time; --- 364,375 ---- return $session; } else { + # time out + $self->history_()->stop_query( $self->{sessions__}{$session}{q} ); delete $self->{sessions__}{$session}; ! return 'TIMEOUT'; } } if ( defined( $user ) ) { # $self->{sessions__}{$session}{lastused} = time; *************** *** 392,396 **** } else { ! return undef; } } --- 392,396 ---- } else { ! return 'TIMEOUT'; } } *************** *** 487,493 **** --- 487,498 ---- my $session; + my $timeout = 0; if ( $cookie ne '' ) { $session = $self->handle_cookie__( $cookie, $client ); + if ( defined($session) && ( $session eq 'TIMEOUT' ) ) { + $timeout = 1; + $session = undef; + } } *************** *** 656,660 **** my $continue; ! ( $session, $continue ) = $self->password_page( $client, $original_url ); if ( !defined( $continue ) || # PROFILE BLOCK START $continue eq '/password' ) { # PROFILE BLOCK STOP --- 661,665 ---- my $continue; ! ( $session, $continue ) = $self->password_page( $client, $original_url, $timeout ); if ( !defined( $continue ) || # PROFILE BLOCK START $continue eq '/password' ) { # PROFILE BLOCK STOP *************** *** 1248,1252 **** my $single_user_mode_changed = 0; ! # TODO: add status messages # Read the CGI parameters and set the configuration vars accordingly --- 1253,1265 ---- my $single_user_mode_changed = 0; ! # Changed between the Single user mode and Multiuser mode ! ! if ( defined $self->{form_}->{single_user} ) { ! if ( $self->global_config_( 'single_user' ) ) { ! $self->status_message__( $templ, $self->language($session)->{Users_SingleUserModeOn} ); ! } else { ! $self->status_message__( $templ, $self->language($session)->{Users_MultiUserModeOn} ); ! } ! } # Read the CGI parameters and set the configuration vars accordingly *************** *** 1615,1619 **** if ( $single_user_mode_changed ) { ! $self->http_redirect_( $client, "/administration", $session ); return; } --- 1628,1632 ---- if ( $single_user_mode_changed ) { ! $self->http_redirect_( $client, "/administration?single_user=" . $self->global_config_( 'single_user' ), $session ); return; } *************** *** 3874,3877 **** --- 3887,3891 ---- # $client The web browser to send the results to # $url The higher level page the password prompt is to be embedded in + # $timeout 1 if session timeout # # Returns undef if login failed, or a session key value if it succeeded *************** *** 3880,3884 **** sub password_page { ! my ( $self, $client, $url ) = @_; my $session; --- 3894,3898 ---- sub password_page { ! my ( $self, $client, $url, $timeout ) = @_; my $session; *************** *** 3898,3901 **** --- 3912,3919 ---- $templ->param( 'Password_If_SingleUser' => $single_user ); + if ( $timeout ) { + $self->error_message__( $templ, $self->language('GLOBAL')->{Password_SessionTimeout} ); + } + $self->{form_}{username} = 'admin' if ( $single_user ); |