|
From: <jgr...@us...> - 2003-09-10 18:26:32
|
Update of /cvsroot/popfile/engine/Proxy
In directory sc8-pr-cvs1:/tmp/cvs-serv28115/Proxy
Modified Files:
NNTP.pm POP3.pm SMTP.pm
Log Message:
Added UI elements for controlling forking of proxies, added sensible defaults for forking
Index: NNTP.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/NNTP.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** NNTP.pm 10 Sep 2003 14:00:41 -0000 1.17
--- NNTP.pm 10 Sep 2003 18:26:29 -0000 1.18
***************
*** 71,77 ****
my ( $self ) = @_;
! # By default we don't fork
! $self->config_( 'force_fork', 0 );
# Default ports for NNTP service and the user interface
--- 71,77 ----
my ( $self ) = @_;
! # By default we don't fork on Windows
! $self->config_( 'force_fork', ($^O eq 'MSWin32')?0:1 );
# Default ports for NNTP service and the user interface
***************
*** 97,100 ****
--- 97,104 ----
$self );
+ $self->register_configuration_item_( 'configuration', # PROFILE BLOCK START
+ 'nntp_force_fork',
+ $self ); # PROFILE BLOCK STOP
+
$self->register_configuration_item_( 'configuration',
'nntp_separator',
***************
*** 393,396 ****
--- 397,420 ----
}
+ if ( $name eq 'nntp_force_fork' ) {
+ $body .= "<span class=\"configurationLabel\">$$language{Configuration_NNTPFork}:</span><br />\n";
+ $body .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"\"><tr><td nowrap=\"nowrap\">\n";
+
+ if ( $self->config_( 'force_fork' ) == 0 ) {
+ $body .= "<form action=\"/configuration\">\n";
+ $body .= "<span class=\"securityWidgetStateOff\">$$language{No}</span>\n";
+ $body .= "<input type=\"submit\" class=\"toggleOn\" id=\"windowTrayIconOn\" name=\"toggle\" value=\"$$language{ChangeToYes}\" />\n";
+ $body .= "<input type=\"hidden\" name=\"nntp_force_fork\" value=\"1\" />\n";
+ $body .= "<input type=\"hidden\" name=\"session\" value=\"$session_key\" />\n</form>\n";
+ } else {
+ $body .= "<form action=\"/configuration\">\n";
+ $body .= "<span class=\"securityWidgetStateOn\">$$language{Yes}</span>\n";
+ $body .= "<input type=\"submit\" class=\"toggleOn\" id=\"windowTrayIconOff\" name=\"toggle\" value=\"$$language{ChangeToNo}\" />\n";
+ $body .= "<input type=\"hidden\" name=\"nntp_force_fork\" value=\"0\" />\n";
+ $body .= "<input type=\"hidden\" name=\"session\" value=\"$session_key\" />\n</form>\n";
+ }
+ $body .= "</td></tr></table>\n";
+ }
+
return $body;
}
***************
*** 436,439 ****
--- 460,470 ----
if ( $name eq 'nntp_local' ) {
$self->config_( 'local', $$form{nntp_local}-1 ) if ( defined($$form{nntp_local}) );
+ }
+
+
+ if ( $name eq 'nntp_force_fork' ) {
+ if ( defined($$form{nntp_force_fork}) ) {
+ $self->config_( 'force_fork', $$form{nntp_force_fork} );
+ }
}
Index: POP3.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/POP3.pm,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** POP3.pm 10 Sep 2003 14:00:41 -0000 1.74
--- POP3.pm 10 Sep 2003 18:26:29 -0000 1.75
***************
*** 71,76 ****
my ( $self ) = @_;
! # By default we don't fork
! $self->config_( 'force_fork', 0 );
# Default ports for POP3 service and the user interface
--- 71,76 ----
my ( $self ) = @_;
! # By default we don't fork on Windows
! $self->config_( 'force_fork', ($^O eq 'MSWin32')?0:1 );
# Default ports for POP3 service and the user interface
***************
*** 104,107 ****
--- 104,111 ----
$self ); # PROFILE BLOCK STOP
+ $self->register_configuration_item_( 'configuration', # PROFILE BLOCK START
+ 'pop3_force_fork',
+ $self ); # PROFILE BLOCK STOP
+
$self->register_configuration_item_( 'security', # PROFILE BLOCK START
'pop3_local',
***************
*** 574,577 ****
--- 578,601 ----
}
+ if ( $name eq 'pop3_force_fork' ) {
+ $body .= "<span class=\"configurationLabel\">$$language{Configuration_POPFork}:</span><br />\n";
+ $body .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"\"><tr><td nowrap=\"nowrap\">\n";
+
+ if ( $self->config_( 'force_fork' ) == 0 ) {
+ $body .= "<form action=\"/configuration\">\n";
+ $body .= "<span class=\"securityWidgetStateOff\">$$language{No}</span>\n";
+ $body .= "<input type=\"submit\" class=\"toggleOn\" id=\"windowTrayIconOn\" name=\"toggle\" value=\"$$language{ChangeToYes}\" />\n";
+ $body .= "<input type=\"hidden\" name=\"pop3_force_fork\" value=\"1\" />\n";
+ $body .= "<input type=\"hidden\" name=\"session\" value=\"$session_key\" />\n</form>\n";
+ } else {
+ $body .= "<form action=\"/configuration\">\n";
+ $body .= "<span class=\"securityWidgetStateOn\">$$language{Yes}</span>\n";
+ $body .= "<input type=\"submit\" class=\"toggleOn\" id=\"windowTrayIconOff\" name=\"toggle\" value=\"$$language{ChangeToNo}\" />\n";
+ $body .= "<input type=\"hidden\" name=\"pop3_force_fork\" value=\"0\" />\n";
+ $body .= "<input type=\"hidden\" name=\"session\" value=\"$session_key\" />\n</form>\n";
+ }
+ $body .= "</td></tr></table>\n";
+ }
+
return $body;
}
***************
*** 632,635 ****
--- 656,665 ----
return "<blockquote><div class=\"error01\">$$language{Security_Error1}</div></blockquote>";
}
+ }
+ }
+
+ if ( $name eq 'pop3_force_fork' ) {
+ if ( defined($$form{pop3_force_fork}) ) {
+ $self->config_( 'force_fork', $$form{pop3_force_fork} );
}
}
Index: SMTP.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Proxy/SMTP.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** SMTP.pm 10 Sep 2003 14:00:41 -0000 1.18
--- SMTP.pm 10 Sep 2003 18:26:29 -0000 1.19
***************
*** 71,76 ****
my ( $self ) = @_;
! # By default we do fork
! $self->config_( 'force_fork', 1 );
# Default port for SMTP service
--- 71,76 ----
my ( $self ) = @_;
! # By default we don't fork on Windows
! $self->config_( 'force_fork', ($^O eq 'MSWin32')?0:1 );
# Default port for SMTP service
***************
*** 94,97 ****
--- 94,101 ----
$self );
+ $self->register_configuration_item_( 'configuration', # PROFILE BLOCK START
+ 'smtp_force_fork',
+ $self ); # PROFILE BLOCK STOP
+
$self->register_configuration_item_( 'security',
'smtp_local',
***************
*** 358,361 ****
--- 362,385 ----
}
+ if ( $name eq 'smtp_force_fork' ) {
+ $body .= "<span class=\"configurationLabel\">$$language{Configuration_SMTPFork}:</span><br />\n";
+ $body .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"\"><tr><td nowrap=\"nowrap\">\n";
+
+ if ( $self->config_( 'force_fork' ) == 0 ) {
+ $body .= "<form action=\"/configuration\">\n";
+ $body .= "<span class=\"securityWidgetStateOff\">$$language{No}</span>\n";
+ $body .= "<input type=\"submit\" class=\"toggleOn\" id=\"windowTrayIconOn\" name=\"toggle\" value=\"$$language{ChangeToYes}\" />\n";
+ $body .= "<input type=\"hidden\" name=\"smtp_force_fork\" value=\"1\" />\n";
+ $body .= "<input type=\"hidden\" name=\"session\" value=\"$session_key\" />\n</form>\n";
+ } else {
+ $body .= "<form action=\"/configuration\">\n";
+ $body .= "<span class=\"securityWidgetStateOn\">$$language{Yes}</span>\n";
+ $body .= "<input type=\"submit\" class=\"toggleOn\" id=\"windowTrayIconOff\" name=\"toggle\" value=\"$$language{ChangeToNo}\" />\n";
+ $body .= "<input type=\"hidden\" name=\"smtp_force_fork\" value=\"0\" />\n";
+ $body .= "<input type=\"hidden\" name=\"session\" value=\"$session_key\" />\n</form>\n";
+ }
+ $body .= "</td></tr></table>\n";
+ }
+
return $body;
}
***************
*** 405,408 ****
--- 429,438 ----
return "<blockquote><div class=\"error01\">$$language{Security_Error1}</div></blockquote>";
}
+ }
+ }
+
+ if ( $name eq 'smtp_force_fork' ) {
+ if ( defined($$form{smtp_force_fork}) ) {
+ $self->config_( 'force_fork', $$form{smtp_force_fork} );
}
}
|