From: naoki i. <am...@us...> - 2008-03-30 10:22:35
|
Update of /cvsroot/popfile/engine/Classifier In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5961/Classifier Modified Files: Bayes.pm Log Message: Change Log 1. When the single user mode is disabled or enabled the UI will be refreshed UI/HTML.pm 2. Logout link now has the login username UI/HTML.pm skins/default/common-middle.thtml 3. Magnetized messages are now not able to be classified UI/HTML.pm skins/default/history-page.thtml 4. Removed old style error handling in the UI UI/HTML.pm skins/default/magnet-page.thtml skins/default/administration-page.thtml skins/default/advanced-page.thtml skins/default/corpus-page.thtml skins/default/style.css 5. Update language file languages/Nihongo.msg Index: Bayes.pm =================================================================== RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v retrieving revision 1.358 retrieving revision 1.359 diff -C2 -d -r1.358 -r1.359 *** Bayes.pm 30 Mar 2008 05:33:57 -0000 1.358 --- Bayes.pm 30 Mar 2008 10:22:36 -0000 1.359 *************** *** 1651,1654 **** --- 1651,1675 ---- #---------------------------------------------------------------------------- # + # get_user_name_from_session + # + # $session A session key previously returned by get_session_key + # + # Returns the user name associated with a session + # + #---------------------------------------------------------------------------- + sub get_user_name_from_session + { + my ( $self, $session ) = @_; + + my $userid = $self->valid_session_key__( $session ); + if ( defined($userid) ) { + return $self->get_user_name_from_id( $session, $userid ); + } else { + return undef; + } + } + + #---------------------------------------------------------------------------- + # # release_session_key # *************** *** 2521,2524 **** --- 2542,2547 ---- my $quarantine = $self->get_bucket_parameter( $session, $classification, 'quarantine' ); + # TODO : Should we use user's configuration? + my $modification = $self->user_config_( 1, 'subject_mod_left' ) . $classification . $self->user_config_( 1, 'subject_mod_right' ); *************** *** 2549,2552 **** --- 2572,2577 ---- # Add the XPL header + # TODO : Should we use user's configuration? + my $xpl = $self->user_config_( 1, 'xpl_angle' )?'<':''; *************** *** 2557,2560 **** --- 2582,2587 ---- $xpl .= ":" . $self->module_config_( 'html', 'port' ) . "/jump_to_message?view=$slot"; + # TODO : Should we use user's configuration? + if ( $self->user_config_( 1, 'xpl_angle' ) ) { $xpl .= '>'; *************** *** 3867,3870 **** --- 3894,3924 ---- #---------------------------------------------------------------------------- # + # get_user_name_from_id + # + # Returns the name of a user + # + # $session A valid session ID + # $userid The ID of the user + # + #---------------------------------------------------------------------------- + sub get_user_name_from_id + { + my ( $self, $session, $id ) = @_; + + my $userid = $self->valid_session_key__( $session ); + return undef if ( !defined( $userid ) ); + + my $h = $self->db_()->prepare( "select name from users where id = $id;" ); + $h->execute; + if ( my $row = $h->fetchrow_arrayref ) { + $h->finish; + return $row->[0]; + } else { + return undef; + } + } + + #---------------------------------------------------------------------------- + # # set_bucket_parameter # *************** *** 4073,4078 **** } ! $self->db_()->do( # PROFILE BLOCK START ! "delete from buckets where buckets.userid = $userid and buckets.name = '$bucket';" ); # PROFILE BLOCK STOP $self->db_update_cache__( $session ); --- 4127,4135 ---- } ! $self->db_()->do( # PROFILE BLOCK START ! "delete from buckets where ! buckets.userid = $userid and ! buckets.name = '$bucket' and ! buckets.pseudo = 0;" ); # PROFILE BLOCK STOP $self->db_update_cache__( $session ); *************** *** 4511,4514 **** --- 4568,4573 ---- # Pass language parameter to add_stopword() + # TODO : hard-coded 1 + return $self->{parser__}->{mangle__}->add_stopword( $stopword, $self->user_module_config_( 1, 'html', 'language' ) ); } *************** *** 4523,4526 **** --- 4582,4587 ---- # Pass language parameter to remove_stopword() + # TODO : hard-coded 1 + return $self->{parser__}->{mangle__}->remove_stopword( $stopword, $self->user_module_config_( 1, 'html', 'language' ) ); } |