From: naoki i. <am...@us...> - 2008-04-06 08:27:05
|
Update of /cvsroot/popfile/engine/POPFile In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14448/POPFile Modified Files: API.pm History.pm Log Message: Change Log 1. There's no need to create account if pop3 transparent proxy server is used 2. Add a new option to use SSL when using pop3 transparent proxy 3. Add a new test for get_session_key_from_token with pop3 transparent proxy Proxy/POP3.pm Classifier/Bayes.pm skins/default/pop3-chain-panel.thtml languages/English.msg tests/TestBayes.tst Memo: If the pop3 transparent proxy server is defined (e.g. mail.example.com), POPFile will accept 'USER username' command and act as if the user 'username' has an account 'use...@ma...'. 4. insert.pl now supports multiuser mode insert.pl Classifier/Bayes.pm New command line options: insert.pl - insert mail messages into a specific bucket of the specific user Usage: insert.pl [<user>] <bucket> <messages> <user> The name of the user (multiuser mode only) <bucket> The name of the bucket <messages> Filename of message(s) to insert 5. A new session key is generated in the single user mode to avoid releasing administrator's session key Proxy/POP3.pm Classifier/Bayes.pm tests/TestBayes.tst 6. Merged a patch to solve the sqlite3 (DBD::SQLite 1.x) issues POPFile/History.pm 7. Fixed a bug that POP3.pm had not passed get_slot_fields no session keys Proxy/POP3.pm 8. New tips for deleting accounts from user skins/users-page.thtml languages/English.msg 9. New XMLRPC APIs (Ticket #39) POPFile/API.pm New APIs get_user_name_from_session initialize_users_password (ADMIN ONLY) change_users_password (ADMIN ONLY) set_password_for_user get_user_name_from_id 10. Update language file languages/Nihongo.msg Current state of the test suite: TestBayesScript PASS TestBayes PASS TestConfiguration PASS * TestHistory PASS * TestHTML PASS * TestHTTP PASS TestIMAP not tested yet TestInsertScript PASS * TestLogger PASS TestMailParse PASS TestModule PASS TestMQ PASS TestMutex PASS TestPipeScript PASS TestPOP3 fail (horribly) TestProxy PASS TestWordMangle PASS TestXMLRPC PASS (but child process does not terminate) * : needs to add tests for multi user support TODO 1. multi user mode tests are needed tests/TestConfiguration.tst tests/TestHistory.tst tests/TestHTML.tst tests/TestInsertScript.tst Index: History.pm =================================================================== RCS file: /cvsroot/popfile/engine/POPFile/History.pm,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** History.pm 5 Apr 2008 16:50:45 -0000 1.49 --- History.pm 6 Apr 2008 08:27:07 -0000 1.50 *************** *** 254,260 **** $self->db_()->begin_work unless ($in_transaction); - # TODO Replace the hardcoded user ID 1 with the looked up - # user ID from the session key - my $test = $self->db_()->selectrow_arrayref( "select id from history where committed = $r limit 1;"); --- 254,257 ---- *************** *** 1028,1032 **** $select =~ s/XXX/$fields_slot/; $self->{queries__}{$id}{query} = $self->db_()->prepare( $select ); - $self->{queries__}{$id}{query}->execute; $self->{queries__}{$id}{cache} = (); } --- 1025,1028 ---- *************** *** 1113,1119 **** my $rows = $start + $count - $size; $self->log_( 2, "Getting $rows rows from database" ); ! push ( @{$self->{queries__}{$id}{cache}}, ! @{$self->{queries__}{$id}{query}->fetchall_arrayref( ! undef, $start + $count - $size )} ); } --- 1109,1117 ---- my $rows = $start + $count - $size; $self->log_( 2, "Getting $rows rows from database" ); ! $self->{queries__}{$id}{query}->execute; ! $self->{queries__}{$id}{cache} = ! $self->{queries__}{$id}{query}->fetchall_arrayref( ! undef, $start + $count - 1 ); ! $self->{queries__}{$id}{query}->finish; } *************** *** 1209,1212 **** --- 1207,1212 ---- if ( $bucket ne 'unknown_class' ) { + # TODO : hardcoded userid 1 + my ( $slot, $file ) = $self->reserve_slot( $session, 1 ); rename $msg, $file; Index: API.pm =================================================================== RCS file: /cvsroot/popfile/engine/POPFile/API.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** API.pm 20 Feb 2006 02:01:57 -0000 1.14 --- API.pm 6 Apr 2008 08:27:07 -0000 1.15 *************** *** 102,110 **** sub get_user_id { shift->{c}->get_user_id( @_ ); } sub get_user_id_from_session { shift->{c}->get_user_id_from_session( @_ ); } sub add_account { shift->{c}->add_account( @_ ); } sub remove_account { shift->{c}->remove_account( @_ ); } sub get_user_parameter { shift->{c}->get_user_parameter( @_ ); } ! sub get_user_parameter_from_id { shift->{c}->get_user_parameter_from_id( @_ );} ! sub set_user_parameter_from_id { shift->{c}->get_user_parameter_from_id( @_ );} # These APIs return lists and need to be altered to arrays before returning --- 102,115 ---- sub get_user_id { shift->{c}->get_user_id( @_ ); } sub get_user_id_from_session { shift->{c}->get_user_id_from_session( @_ ); } + sub get_user_name_from_session { shift->{c}->get_user_name_from_session( @_ ); } sub add_account { shift->{c}->add_account( @_ ); } sub remove_account { shift->{c}->remove_account( @_ ); } sub get_user_parameter { shift->{c}->get_user_parameter( @_ ); } ! sub get_user_parameter_from_id { shift->{c}->get_user_parameter_from_id( @_ ); } ! sub set_user_parameter_from_id { shift->{c}->get_user_parameter_from_id( @_ ); } ! sub get_user_name_from_id { shift->{c}->get_user_name_from_id( @_ ); } ! ! sub change_users_password { shift->{c}->change_users_password( @_ ); } ! sub set_password_for_user { shift->{c}->set_password_for_user( @_ ); } # These APIs return lists and need to be altered to arrays before returning *************** *** 123,126 **** --- 128,133 ---- sub get_user_parameter_list { [ shift->{c}->get_bucket_word_list( @_ ) ]; } + sub initialize_users_password { [ shift->{c}->initialize_users_password( @_ ) ]; } + # This API is used to add a message to POPFile's history, process the message # and do all the things POPFile would have done if it had received the message |