Update of /cvsroot/popfile/engine/UI
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30027/UI
Modified Files:
HTML.pm HTTP.pm
Log Message:
Change Log
1. Message count, False positive count and False negative count are not
copied when cloning user
Classifier/Bayes.pm
2. Users page cannot be accessed in the single user mode
UI/HTML.pm
3. Fixed a bug that malformed cookies would crash POPFile
UI/HTTP.pm
4. Tests for multiuser mode
5. Tests for cookies
6. Tests for redirection
7. Tests for status messages
tests/TestHTML.tst
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.393
retrieving revision 1.394
diff -C2 -d -r1.393 -r1.394
*** HTML.pm 28 Apr 2008 11:17:43 -0000 1.393
--- HTML.pm 30 Apr 2008 14:41:49 -0000 1.394
***************
*** 310,313 ****
--- 310,314 ----
if ( !defined( $checksum ) ) {
+ $self->log_( 0, "Invalid cookie received, had no checksum" );
return undef;
}
***************
*** 782,785 ****
--- 783,792 ----
}
+ # In the single user mode, remove the users URLs
+
+ if ( $self->global_config_( 'single_user' ) ) {
+ delete $url_table{'/users'};
+ }
+
# Any of the standard pages can be found in the url_table, the
# other pages are probably files on disk
***************
*** 1128,1132 ****
$self->global_config_( 'language', $language );
! $self->cache_language_for_user( $language, 'global' );
}
--- 1135,1139 ----
$self->global_config_( 'language', $language );
! $self->cache_global_language( $language );
}
Index: HTTP.pm
===================================================================
RCS file: /cvsroot/popfile/engine/UI/HTTP.pm,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** HTTP.pm 25 Apr 2008 16:26:27 -0000 1.41
--- HTTP.pm 30 Apr 2008 14:41:49 -0000 1.42
***************
*** 316,324 ****
$cookie =~ /popfile=([^\r\n]+)/;
! if ( defined( $1 ) ) {
! return $self->{crypto__}->decrypt( decode_base64( $1 ) );
! } else {
! return '';
}
}
--- 316,328 ----
$cookie =~ /popfile=([^\r\n]+)/;
! if ( defined( $1 ) && ( length( $1 ) eq 216 ) ) {
! my $decoded_cookie = decode_base64( $1 );
! if ( $decoded_cookie =~ /^Salted__(.{8})/ ) {
! # print "Decrypted : ", $self->{crypto__}->decrypt( $decoded_cookie ), "\n";
! return $self->{crypto__}->decrypt( $decoded_cookie );
! }
}
+
+ return '';
}
|