* Started work on the mail server form.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 5 years ago
parent c3869a2ff6
commit a3105c08a7
  1. 103
      cgi-bin/striker
  2. 67
      html/skins/alteeve/email.html
  3. 19
      share/words.xml

@ -372,7 +372,7 @@ sub process_email_menu
if ($anvil->data->{cgi}{task}{value} eq "email_server") if ($anvil->data->{cgi}{task}{value} eq "email_server")
{ {
#process_email_server_page($anvil); process_email_server_page($anvil);
} }
elsif ($anvil->data->{cgi}{task}{value} eq "email_recipient") elsif ($anvil->data->{cgi}{task}{value} eq "email_recipient")
{ {
@ -400,6 +400,107 @@ sub process_email_menu
return(0); return(0);
} }
#
sub process_email_server_page
{
my ($anvil) = @_;
if ($anvil->data->{cgi}{save}{value})
{
# Verify it's sane. If not, send it back.
# Confirmed?
if ($anvil->data->{cgi}{save}{value})
{
}
}
### Still here, show the menu.
# Outgoing mail server
my $say_outgoing_mail_server = defined $anvil->data->{cgi}{outgoing_mail_server}{value} ? $anvil->data->{cgi}{outgoing_mail_server}{value} : "";
my $outgoing_mail_server_class = $anvil->data->{cgi}{outgoing_mail_server}{alert} ? "input_alert" : "input_clear";
my $outgoing_mail_server_form = $anvil->Template->get({file => "main.html", name => "input_text_form", variables => {
name => "outgoing_mail_server",
id => "outgoing_mail_server",
field => "#!string!striker_0168!#",
description => "#!string!striker_0169!#",
value => defined $anvil->data->{cgi}{outgoing_mail_server}{value} ? $anvil->data->{cgi}{outgoing_mail_server}{value} : "",
default_value => "",
class => $outgoing_mail_server_class,
extra => "",
}});
# Login name
my $say_login_name = defined $anvil->data->{cgi}{login_name}{value} ? $anvil->data->{cgi}{login_name}{value} : "";
my $login_name_class = $anvil->data->{cgi}{login_name}{alert} ? "input_alert" : "input_clear";
my $login_name_form = $anvil->Template->get({file => "main.html", name => "input_text_form", variables => {
name => "login_name",
id => "login_name",
field => "#!string!striker_0170!#",
description => "#!string!striker_0171!#",
value => defined $anvil->data->{cgi}{login_name}{value} ? $anvil->data->{cgi}{login_name}{value} : "",
default_value => "",
class => $login_name_class,
extra => "",
}});
# Password
my $say_login_password = defined $anvil->data->{cgi}{login_password}{value} ? $anvil->data->{cgi}{login_password}{value} : "";
my $login_password_class = $anvil->data->{cgi}{login_password}{alert} ? "input_alert" : "input_clear";
my $login_password_form = $anvil->Template->get({file => "main.html", name => "input_text_form", variables => {
name => "login_password",
id => "login_password",
field => "#!string!striker_0172!#",
description => "#!string!striker_0173!#",
value => defined $anvil->data->{cgi}{login_password}{value} ? $anvil->data->{cgi}{login_password}{value} : "",
default_value => "",
class => $login_password_class,
extra => "",
}});
# connection security
my $connection_security_select = $anvil->Template->select_form({
name => "connection_security",
options => [
"none#!#".$anvil->Words->string({key => "striker_0174"}),
"ssl_tls#!#".$anvil->Words->string({key => "striker_0175"}),
"starttls!#".$anvil->Words->string({key => "striker_0176"})
],
blank => 1,
selected => defined $anvil->data->{cgi}{connection_security}{value} ? $anvil->data->{cgi}{connection_security}{value} : "ifn_link1",
class => $anvil->data->{cgi}{connection_security}{alert} ? "input_alert" : "input_clear",
});
# Authentication method
my $authentication_method_select = $anvil->Template->select_form({
name => "authentication_method",
options => [
"normal_password#!#".$anvil->Words->string({key => "striker_0177"}),
"encrypted_password#!#".$anvil->Words->string({key => "striker_0178"}),
"kerberos_gssapi#!#".$anvil->Words->string({key => "striker_0179"}),
"ntlm#!#".$anvil->Words->string({key => "striker_0180"}),
"tls_certificate#!#".$anvil->Words->string({key => "striker_0181"}),
"oauth2#!#".$anvil->Words->string({key => "striker_0182"})
],
blank => 1,
selected => defined $anvil->data->{cgi}{authentication_method}{value} ? $anvil->data->{cgi}{authentication_method}{value} : "ifn_link1",
class => $anvil->data->{cgi}{authentication_method}{alert} ? "input_alert" : "input_clear",
});
$anvil->data->{form}{back_link} = "?";
$anvil->data->{form}{refresh_link} = "?email=true";
$anvil->data->{form}{body} = $anvil->Template->get({file => "email.html", name => "mail-server-menu", variables => {
outgoing_mail_server => $outgoing_mail_server_form,
login_name => $login_name_form,
login_password => $login_password_form,
connection_security => $connection_security_select,
authentication_method => $authentication_method_select,
}});
return(0);
}
# This handles the "Striker" menu items. # This handles the "Striker" menu items.
sub process_striker_menu sub process_striker_menu
{ {

@ -35,3 +35,70 @@
</table> </table>
<!-- end main-menu --> <!-- end main-menu -->
<!-- start mail-server-menu -->
<table align="center" class="mail_server">
<form name="mail_server" action="" method="post">
<div id="hostmail_server">
<tr>
<td colspan="2" class="title">
#!string!message_0154!#
</td>
</tr>
<tr>
<td colspan="2">
&nbsp;
</td>
</tr>
<tr>
<td colspan="2">
#!string!message_0155!#
</td>
</tr>
<tr>
<td colspan="2">
&nbsp;
</td>
</tr>
<tr>
<td colspan="2">
#!variable!outgoing_mail_server!#
</td>
</tr>
<tr>
<td colspan="2">
#!variable!login_name!#
</td>
</tr>
<tr>
<td colspan="2">
#!variable!login_password!#
</td>
</tr>
<tr>
<td colspan="2">
#!string!striker_0183!#<br />
#!variable!connection_security!#
</td>
</tr>
<tr>
<td colspan="2">
#!string!striker_0184!#<br />
#!variable!authentication_method!#
</td>
</tr>
<tr>
<td colspan="2">
&nbsp;
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="save" id="save" class="button" value="#!string!striker_0067!#">
</td>
</tr>
</div>
<input type="hidden" name="email" id="email" value="true" />
<input type="hidden" name="task" id="task" value="email_server" />
</form>
</table>
<!-- end mail-server-menu -->

@ -258,6 +258,8 @@ About to try to download aproximately: [#!variable!packages!#] packages needed t
<key name="message_0151">This is a RHEL host and has not yet been subscribed, but there is no internet access detected. OS Updates likely won't work, nor will subscribing the system. These tasks will be deferred until later in the setup process.</key> <key name="message_0151">This is a RHEL host and has not yet been subscribed, but there is no internet access detected. OS Updates likely won't work, nor will subscribing the system. These tasks will be deferred until later in the setup process.</key>
<key name="message_0152">There is no internet access detected. OS Updates likely won't work and will be deferred until later in the setup process.</key> <key name="message_0152">There is no internet access detected. OS Updates likely won't work and will be deferred until later in the setup process.</key>
<key name="message_0153">Local repository</key> <key name="message_0153">Local repository</key>
<key name="message_0154">Mail Server Configuration</key>
<key name="message_0155">When alert emails are sent, they are stored locally and then forwarded to a mail server. This is where you can configure the mail server that alerts are forwarded to for delivery to recipients.</key>
<!-- Log entries --> <!-- Log entries -->
<key name="log_0001">Starting: [#!variable!program!#].</key> <key name="log_0001">Starting: [#!variable!program!#].</key>
@ -1023,6 +1025,23 @@ If you are comfortable that the target has changed for a known reason, you can s
<key name="striker_0165">Alert email server and recipient configuration.</key> <key name="striker_0165">Alert email server and recipient configuration.</key>
<key name="striker_0166">Configure which server(s) can be used for forwarding email alerts to.</key> <key name="striker_0166">Configure which server(s) can be used for forwarding email alerts to.</key>
<key name="striker_0167">Configure who will receive email alerts.</key> <key name="striker_0167">Configure who will receive email alerts.</key>
<key name="striker_0168">Outgoing mail server</key>
<key name="striker_0169">This is the host name or IP address of the server that email alerts are forwarded to.</key>
<key name="striker_0170">Login Name</key>
<key name="striker_0171">This is the the user name used when authenticating with the outgoing mail server.</key>
<key name="striker_0172">Login Password</key>
<key name="striker_0173">This is the the password for the user name used when authenticating with the outgoing mail server.</key>
<key name="striker_0174">None</key> <!-- Email Connection Security - None -->
<key name="striker_0175">SSL/TLS</key> <!-- Email Connection Security - SSL/TLS -->
<key name="striker_0176">STARTTLS</key> <!-- Email Connection Security - STARTTLS -->
<key name="striker_0177">Normal Password</key> <!-- Email Authentication Method - Normal Password -->
<key name="striker_0178">Encrypted Password</key> <!-- Email Authentication Method - Encrypted Password -->
<key name="striker_0179">Kerberos / GSSAPI</key> <!-- Email Authentication Method - Kerneros / GSSAPI -->
<key name="striker_0180">NTLM</key> <!-- Email Authentication Method - NTLM -->
<key name="striker_0181">TLS Certificate</key> <!-- Email Authentication Method - TLS Certificate -->
<key name="striker_0182">OAuth2</key> <!-- Email Authentication Method - OAuth2 -->
<key name="striker_0183">Connection Security</key>
<key name="striker_0184">Authentication method</key>
<!-- These are generally units and appended to numbers --> <!-- These are generally units and appended to numbers -->
<key name="suffix_0001">#!variable!number!#/sec</key> <key name="suffix_0001">#!variable!number!#/sec</key>

Loading…
Cancel
Save