From: John Graham-C. <jgr...@us...> - 2005-08-21 22:18:31
|
Update of /cvsroot/popfile/engine/POPFile In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11349/POPFile Modified Files: API.pm Log Message: More v0.23.0 work; mostly around the test suite and the ability to change passwords. *** NOTE: Had to run 'dos2unix' because a number of files had CRLF line endings. POPFile standard is Unix-style LF only line endings on files. *** tests/TestBayes.tst and Classifier/Bayes.pm: Add tests for APIs that had no tests (and fix the bugs that the tests showed up!). All APIs now have tests; the new tests cover: add_account create_user get_accounts get_bucket_id get_bucket_name get_user_id get_user_list get_user_parameter get_user_parameter_from_id get_user_parameter_list remove_account remove_user set_user_parameter_from_id *** Classifier/Bayes.pm, tests/TestBayes.tst, UI/HTML.pm create_user now also creates a random password for the user and the password is displayed when the user is created in the UI. *** Classifier/Bayes.pm, tests/TestBayes.tst, UI/HTML.pm, skins/default/configuration-bar.thtml Added the ability to change password for a user. This is done in the configuration bar and added new APIs and tests (validate_password and set_password) for a user. *** POPFile/API.pm: Add external access to the following new APIs: add_account create_user get_user_id get_user_id_from_session get_user_parameter get_user_parameter_from_id get_user_parameter_list remove_account remove_user set_user_parameter_from_id *** tests/TestHTTP.tst: Remove redirection tests since this is no longer handled by the HTTP module. *** Current state of the test suite: TestBayesScript fail TestBayes PASS TestConfiguration fail TestHistory fail TestHTML fail (horribly) TestHTTP PASS TestIMAP PASS TestInsertScript fail TestLogger PASS TestMailParse fail TestModule PASS TestMQ PASS TestMutex PASS TestPipeScript PASS TestPOP3 fail TestProxy PASS TestWordMangle PASS TestXMLRPC fail *** TODO tests/TestModule.tst needs updating for the user_*_config_ APIs that have been added. Look into why we get bogus complaints about the primary key not being unique when we do a database upgrade. I think some of these are caused by the fact that popfile.sql contains some INSERT statements and we are getting double inserts. Perhaps the upgrade should be using UPDATE instead. Index: API.pm =================================================================== RCS file: /cvsroot/popfile/engine/POPFile/API.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** API.pm 11 Feb 2005 00:34:36 -0000 1.11 --- API.pm 21 Aug 2005 22:17:47 -0000 1.12 *************** *** 38,42 **** } - # I'm generally against doing obscure things in Perl because it makes the code # hard to read, but since this entire file is a bunch of wrappers for the --- 38,41 ---- *************** *** 98,102 **** sub add_stopword { shift->{c}->add_stopword( @_ ); } sub remove_stopword { shift->{c}->remove_stopword( @_ ); } ! sub get_html_colored_message { shift->{c}->get_html_colored_message( @_); } # These APIs return lists and need to be altered to arrays before returning --- 97,111 ---- sub add_stopword { shift->{c}->add_stopword( @_ ); } sub remove_stopword { shift->{c}->remove_stopword( @_ ); } ! sub get_html_colored_message { shift->{c}->get_html_colored_message( @_ ); } ! ! sub create_user { shift->{c}->create_user( @_ ); } ! sub remove_user { shift->{c}->remove_user( @_ ); } ! 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 *************** *** 113,116 **** --- 122,126 ---- sub get_bucket_word_list { [ shift->{c}->get_bucket_word_list( @_ ) ]; } sub get_bucket_word_prefixes { [ shift->{c}->get_bucket_word_prefixes( @_ ) ]; } + sub get_user_parameter_list { [ shift->{c}->get_bucket_word_list( @_ ) ]; } # This API is used to add a message to POPFile's history, process the message *************** *** 132,136 **** # Convert the two files into streams that can be passed to the # classifier - open IN, "<$in" or return undef; --- 142,145 ---- |