From: Sam S. <ssc...@us...> - 2005-02-25 21:54:05
|
Update of /cvsroot/popfile/engine/Proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25399/Proxy Modified Files: SMTP.pm NNTP.pm POP3.pm Log Message: Continue refactoring HTML UI "status" and "error" messages to use the new status_message__ and error_message__ functions. Progress: All proxy and UI dynamic widgets complete. IMAP _not_ done. Tests forthcoming. Also, these changes make the configuration widgets presentation-language agnostic. That is pretty neat. Perhaps XMLRPC could provide a source-validated configuration API. Index: POP3.pm =================================================================== RCS file: /cvsroot/popfile/engine/Proxy/POP3.pm,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** POP3.pm 20 Feb 2005 10:06:02 -0000 1.107 --- POP3.pm 25 Feb 2005 21:53:54 -0000 1.108 *************** *** 505,509 **** if ( $response == 0 ) { $self->echo_to_dot_( $mail, $client ); ! } } --- 505,509 ---- if ( $response == 0 ) { $self->echo_to_dot_( $mail, $client ); ! } } *************** *** 524,528 **** if ( $response == 0 ) { $self->echo_to_dot_( $mail, $client ); ! } } else { next; --- 524,528 ---- if ( $response == 0 ) { $self->echo_to_dot_( $mail, $client ); ! } } else { next; *************** *** 692,702 **** if ( $name eq 'pop3_security' ) { $templ->param( 'POP3_Security_Local' => ( $self->config_( 'local' ) == 1 ) ); ! } else { ! if ( $name eq 'pop3_chain' ) { $templ->param( 'POP3_Chain_Secure_Server' => $self->config_( 'secure_server' ) ); $templ->param( 'POP3_Chain_Secure_Port' => $self->config_( 'secure_port' ) ); ! } else { $self->SUPER::configure_item( $name, $templ, $language ); ! } } } --- 692,702 ---- if ( $name eq 'pop3_security' ) { $templ->param( 'POP3_Security_Local' => ( $self->config_( 'local' ) == 1 ) ); ! } else { ! if ( $name eq 'pop3_chain' ) { $templ->param( 'POP3_Chain_Secure_Server' => $self->config_( 'secure_server' ) ); $templ->param( 'POP3_Chain_Secure_Port' => $self->config_( 'secure_port' ) ); ! } else { $self->SUPER::configure_item( $name, $templ, $language ); ! } } } Index: NNTP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Proxy/NNTP.pm,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** NNTP.pm 27 Dec 2004 16:51:28 -0000 1.37 --- NNTP.pm 25 Feb 2005 21:53:54 -0000 1.38 *************** *** 152,156 **** } ! return $self->SUPER::start();; } # ---------------------------------------------------------------------------- --- 152,157 ---- } ! return $self->SUPER::start();; ! } # ---------------------------------------------------------------------------- *************** *** 325,329 **** # Commands expecting a code + text response ! if ( $command =~ /^ *(LIST|HEAD|BODY|NEWGROUPS|NEWNEWS|LISTGROUP|XGTITLE|XINDEX|XHDR|XOVER|XPAT|XROVER|XTHREAD)/i ) { my ( $response, $ok ) = $self->get_response_( $news, --- 326,330 ---- # Commands expecting a code + text response ! if ( $command =~ /^ *(LIST|HEAD|BODY|NEWGROUPS|NEWNEWS|LISTGROUP|XGTITLE|XINDEX|XHDR|XOVER|XPAT|XROVER|XTHREAD)/i ) { my ( $response, $ok ) = $self->get_response_( $news, *************** *** 352,356 **** # Commands expecting a single-line response ! if ( $command =~ /^ *(GROUP|STAT|IHAVE|LAST|NEXT|SLAVE|MODE|XPATH)/i ) { $self->get_response_( $news, $client, $command ); --- 353,357 ---- # Commands expecting a single-line response ! if ( $command =~ /^ *(GROUP|STAT|IHAVE|LAST|NEXT|SLAVE|MODE|XPATH)/i ) { $self->get_response_( $news, $client, $command ); *************** *** 444,448 **** } ! #$self->SUPER::configure_item( $name, $language, $session_key ); } --- 445,449 ---- } ! $self->SUPER::configure_item( $name, $templ, $language); } *************** *** 463,476 **** my ( $self, $name, $templ, $language, $form ) = @_; if ( $name eq 'nntp_port' ) { if ( defined $$form{nntp_port} ) { if ( ( $$form{nntp_port} >= 1 ) && ( $$form{nntp_port} < 65536 ) ) { ! $self->config_( 'port', $$form{nntp_port} ); ! $templ->param( 'nntp_port_feedback' => sprintf $$language{Configuration_NNTPUpdate}, $self->config_( 'port' ) ); ! } ! else { ! $templ->param( 'nntp_port_feedback' => "<div class=\"error01\">$$language{Configuration_Error3}</div>" ); } ! } } --- 464,478 ---- my ( $self, $name, $templ, $language, $form ) = @_; + my ($status, $error); + if ( $name eq 'nntp_port' ) { if ( defined $$form{nntp_port} ) { if ( ( $$form{nntp_port} >= 1 ) && ( $$form{nntp_port} < 65536 ) ) { ! $status = sprintf $$language{Configuration_NNTPUpdate}, $self->config_( 'port' ); ! } else { ! $error = $$language{Configuration_Error3}; } ! } ! return ($status, $error); } *************** *** 479,488 **** if ( length($$form{nntp_separator}) == 1 ) { $self->config_( 'separator', $$form{nntp_separator} ); ! $templ->param( 'nntp_separator_feedback' => sprintf $$language{Configuration_NNTPSepUpdate}, $self->config_( 'separator' ) ); ! } ! else { ! $templ->param( 'nntp_separator_feedback' => "<div class=\"error01\">\n$$language{Configuration_Error1}</div>\n" ); } } } --- 481,490 ---- if ( length($$form{nntp_separator}) == 1 ) { $self->config_( 'separator', $$form{nntp_separator} ); ! $status = sprintf $$language{Configuration_NNTPSepUpdate}, $self->config_( 'separator' ); ! } else { ! $error = $$language{Configuration_Error1}; } } + return ($status, $error); } *************** *** 491,494 **** --- 493,497 ---- $self->config_( 'local', $$form{nntp_local} ); } + return( undef, undef); } *************** *** 498,504 **** $self->config_( 'force_fork', $$form{nntp_force_fork} ); } } ! ! # $self->SUPER::validate_item( $name, $language, $form ); } --- 501,507 ---- $self->config_( 'force_fork', $$form{nntp_force_fork} ); } + return( undef, undef); } ! return $self->SUPER::validate_item( $name, $templ, $language, $form ); } Index: SMTP.pm =================================================================== RCS file: /cvsroot/popfile/engine/Proxy/SMTP.pm,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** SMTP.pm 27 Dec 2004 16:51:28 -0000 1.39 --- SMTP.pm 25 Feb 2005 21:53:54 -0000 1.40 *************** *** 350,354 **** ! #$self->SUPER::configure_item( $name, $templ, $language ); } --- 350,354 ---- ! $self->SUPER::configure_item( $name, $templ, $language ); } *************** *** 369,372 **** --- 369,374 ---- my ( $self, $name, $templ, $language, $form ) = @_; + my ($status, $error, $changed); + if ( $name eq 'smtp_fork_and_port' ) { *************** *** 378,386 **** if ( ( $$form{smtp_port} >= 1 ) && ( $$form{smtp_port} < 65536 ) ) { $self->config_( 'port', $$form{smtp_port} ); ! $templ->param( 'smtp_port_feedback' => sprintf( $$language{Configuration_SMTPUpdate}, $self->config_( 'port' ) ) ); } else { ! $templ->param( 'smtp_port_feedback' => "<div class=\"error01\">$$language{Configuration_Error3}</div>" ); } } } --- 380,389 ---- if ( ( $$form{smtp_port} >= 1 ) && ( $$form{smtp_port} < 65536 ) ) { $self->config_( 'port', $$form{smtp_port} ); ! $status = sprintf( $$language{Configuration_SMTPUpdate}, $self->config_( 'port' ) ); } else { ! $error = $$language{Configuration_Error3}; } } + return( $status, $error ); } *************** *** 389,392 **** --- 392,396 ---- $self->config_( 'local', $$form{smtp_local} ); } + return ( $status, $error ); } *************** *** 394,399 **** if ( defined $$form{smtp_chain_server} ) { $self->config_( 'chain_server', $$form{smtp_chain_server} ); ! $templ->param( 'smtp_server_feedback' => sprintf $$language{Security_SMTPServerUpdate}, $self->config_( 'chain_server' ) ) ; } } --- 398,404 ---- if ( defined $$form{smtp_chain_server} ) { $self->config_( 'chain_server', $$form{smtp_chain_server} ); ! $status = sprintf( $$language{Security_SMTPServerUpdate}, $self->config_( 'chain_server' ) ); } + return( $status, $error ); } *************** *** 403,416 **** if ( ( $$form{smtp_chain_server_port} >= 1 ) && ( $$form{smtp_chain_server_port} < 65536 ) ) { $self->config_( 'chain_port', $$form{smtp_chain_server_port} ); ! $templ->param( 'smtp_port_feedback' => sprintf $$language{Security_SMTPPortUpdate}, $self->config_( 'chain_port' ) ); ! } ! else { ! $templ->param( 'smtp_port_feedback' => "<div class=\"error01\">$$language{Security_Error1}</div>" ); } } } ! ! #$self->SUPER::validate_item( $name, $templ, $language, $form ); } --- 408,420 ---- if ( ( $$form{smtp_chain_server_port} >= 1 ) && ( $$form{smtp_chain_server_port} < 65536 ) ) { $self->config_( 'chain_port', $$form{smtp_chain_server_port} ); ! $status = sprintf( $$language{Security_SMTPPortUpdate}, $self->config_( 'chain_port' ) ) ! } else { ! $error = $$language{Security_Error1}; } } + return( $status, $error ); } ! return $self->SUPER::validate_item( $name, $templ, $language, $form ); } |