diff -aurN smeserver-manager-0.1.0.old/createlinks smeserver-manager-0.1.0/createlinks
--- smeserver-manager-0.1.0.old/createlinks 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/createlinks 2020-04-11 20:30:30.778000000 +0400
@@ -9,6 +9,17 @@
# links to add
+for ( qw( sme_core.css
+ sme_main.css
+ sme_menu.css
+ styles.css
+ ) )
+{
+ templates2events("/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/$_", qw(
+ bootstrap-console-save console-save
+ ));
+}
+
# templates to expand
for my $event ( qw( manager2-modify bootstrap-console-save console-save ) )
{
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/50body smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/50body
--- smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/50body 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/50body 2020-04-10 16:54:07.067000000 +0400
@@ -0,0 +1,250 @@
+{
+ $OUT = <<'EOF';
+
+/* from e-smith-manager to smeserver_manager2 */
+
+/*----------------------------------------------------------------------
+ * copyright (C) 1999-2003 Mitel Networks Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Technical support for this program is available from Mitel Networks
+ * Please visit our web site www.mitel.com for details.
+ *----------------------------------------------------------------------
+ */
+
+/* This is the stylesheet used as the basis for older broswers.
+
+Note that you CANNOT simly add styles here and hope they work. ONLY CSS
+level 1 styles should be in this file. Everyting else goes into the other 3
+files.
+
+These basic styles ensire that browsers that don't understand the @import
+method will still be usable. All modern browsers will use the styles in
+sme_main.css, sme_menu.css or sme_header.css depending on the frame in which
+the page is found.
+*/
+
+/* Default HTML styles */
+body {
+ background: #ffffff;
+ color: #000000;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ border-width: 0;
+}
+
+table, tr, td, div, p, form {
+ color: #000000;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+p {
+ margin-top: 8px;
+ margin-bottom: 2px;
+}
+
+form {
+ margin-top: 2px;
+ margin-bottom: 2px;
+}
+
+span {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+.notsmall {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+h1, .h1 {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #333333;
+ font-size: 18px;
+ margin-bottom: 4px;
+ margin-top: 12px;
+}
+
+h2, .h2 {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #333333;
+ font-size: 14px;
+ margin-bottom: 3px;
+ margin-top: 12px;
+}
+
+h3, .h3 {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ color: #333333;
+ font-size: 12px;
+ margin-bottom: 2px;
+ margin-top: 12px;
+}
+
+h4, .h4 {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-style: italic;
+ color: #333333;
+ font-size: 12px;
+ margin-bottom: 2px;
+ margin-top: 10px;
+}
+
+ol, ul, li {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ font-weight: normal;
+ color: black;
+}
+
+ul {
+ list-style-type: circle;
+}
+
+/* Core styles for use with sme_header.css*/
+body.header {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ background: #cccccc;
+ margin-top: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ margin-left: 0px;
+}
+
+.hilightbar {
+ background-color: #ffc50a;
+ font-size: 4px;
+}
+
+.infobar {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ background-color: #cccccc;
+}
+
+.darkergrey {
+ color: #666666;
+}
+
+td.darkgrey {
+ background-color: #888888;
+}
+
+a.update {
+ color: red;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ background: #cccccc;
+}
+
+/* Core styles for use with sme_menu.css */
+
+body.menu {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ background-color: #e8f3e1;
+}
+
+td.section {
+ padding-bottom: 2px;
+ padding-top: 8px;
+}
+
+.section {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ font-weight: bold;
+ background-color: #e8f3e1;
+}
+
+a.item {
+ color: #00008b;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ background: #e8f3e1;
+}
+
+a.sl {
+ color: green;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ background: #e8f3e1;
+}
+
+a.alert {
+ color: red;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ background: #e8f3e1;
+}
+
+/* Core styles for use with sme_main.css */
+body.main {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ background-color: #ffffff;
+ color: #000000;
+}
+
+td.sme-noborders-label {
+ font-weight: bold;
+ width: 33%;
+ text-align: right;
+}
+
+hr.sectionbar {
+ color: #666666;
+ background-color: #666666;
+ height: 1px;
+ width: 80%;
+ border: 0;
+}
+
+hr.sme-copyrightbar {
+ color: #dddddd;
+ background-color: #dddddd;
+ height: 1px;
+ width: 100%;
+ border: 0;
+}
+
+.sme-copyright {
+ color: #777777;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+}
+
+/*These style definitions were found int he old css file (manager.css)
+but don't seem to ever be referenced in the code. They're here
+for reference.
+
+.centerit {
+ text-align: center;
+}
+.highlight {
+ background: #ffc61e;
+}
+.subheading {
+ background: #ffffff;
+ color: #1e385b;
+}
+*/
+
+EOF
+}
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/90contribs smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/90contribs
--- smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/90contribs 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/90contribs 2020-04-10 16:53:43.349000000 +0400
@@ -0,0 +1,71 @@
+{
+ $OUT =<<'HERE';
+
+/* from e-smith-manager to smeserver_manager2 */
+
+/*----------------------------------------------------------------------
+ * copyright (C) 1999-2003 Mitel Networks Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Technical support for this program is available from Mitel Networks
+ * Please visit our web site www.mitel.com for details.
+ *----------------------------------------------------------------------
+ */
+
+/*contribs.org styling
+*/
+body.header {
+background: #bee6a2;
+ }
+.hilightbar {
+background-color: #ffffff;
+ }
+.infobar {
+background-color: #98d36e;
+ }
+a.update {
+font-size: 11px;
+background: #98d36e;
+ }
+
+/* Core styles for use with sme_menu.css */
+body.menu {
+background-color: #e8f3e1;
+ }
+td.section {
+background-color: #e8f3e1;
+ }
+a.item {
+background: #e8f3e1;
+ }
+a.sl {
+background: #e8f3e1;
+ }
+a.alert {
+background: #e8f3e1;
+ }
+
+/* Core Styles for use with sme_main.css */
+hr.sectionbar {
+color: #8ebe43;
+background-color: #8ebe43;
+ }
+hr.sme-copyrightbar {
+color: #8ebe43;
+background-color: #8ebe43;
+ }
+HERE
+}
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/template-begin smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/template-begin
--- smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/template-begin 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_core.css/template-begin 2006-03-16 01:59:54.000000000 +0400
@@ -0,0 +1 @@
+/* DO NOT MODIFY THIS FILE! It is updated automatically */
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/50body smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/50body
--- smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/50body 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/50body 2020-04-10 16:53:04.667000000 +0400
@@ -0,0 +1,440 @@
+{
+ $OUT = <<'EOF';
+
+/* from e-smith-manager to smeserver_manager2 */
+
+/*----------------------------------------------------------------------
+ * copyright (C) 1999-2003 Mitel Networks Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Technical support for this program is available from Mitel Networks
+ * Please visit our web site www.mitel.com for details.
+ *----------------------------------------------------------------------
+ */
+
+/* This is the stylesheet used in the main panels only.
+
+ This file inherits the styles use in sme_core in the "header" section, and
+ as noted in the code below. Note that some of the styles here are empty.
+ This is because the style definition has moved safely to sme_core.css
+ and the placeholder is left here for reference or future use.
+
+ There are a lot of styles in here, so read carefully. Each one is documented.
+
+ Styles that were in the old stylesheets, but are not used in the UI are at the
+ bottom, commented out. These can be removed at the end of the 6.0 cycle */
+
+/* general page properties */
+body, body.main {
+ margin-top: 5px;
+ margin-right: 20px;
+ margin-bottom: 5px;
+ margin-left: 5px;
+}
+
+
+/* Table properties ****************************************/
+/* There are THREE types of tables
+ 1. *.sme-layout* is used for layout purposes. It is the "master
+ container" on a page. It controls the top-level table
+ inside of which everything else is put.
+ 2. *.sme-noborders* is used for layout, and defines a borderless table and
+ cells used within it.
+ 2. *.sme-border* is used for tabular data, and defines a header row and borders
+ for tables that need borders
+
+ */
+
+/*First, some defaults */
+td {
+ text-align: left;
+}
+
+
+/*
+sme-layout* : Used for top-level layout
+*/
+
+table.sme-layout {
+ border-collapse: collapse;
+ margin-bottom: 2px;
+ margin-top: 2px;
+}
+
+tr.sme-layout {
+ border: 1px solid #dddddd;
+}
+
+td.sme-layout {
+ border: 1px solid #dddddd;
+}
+
+/*This special style is actually used only for the button row along the bottom of each page*/
+th.sme-layout {
+ border: 1px solid #dddddd;
+ background-color: #e8f3e1;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 9pt;
+ font-weight: bold;
+ color: #000000;
+ text-align: right;
+ padding: 4px;
+}
+
+/*
+sme-noborders* : Used for mid-level layout
+*/
+table.sme-noborders {
+ padding: 0px;
+ margin-top: 0px;
+ margin-bottom: 20px;
+ margin-left: 0px;
+ margin-right: 0px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+td.sme-noborders-label {
+ font-weight: bold;
+ /*width: 250px;*/
+ text-align: right;
+ /*vertical-align: top;*/
+ background-color: #e8f3e1;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+td.sme-noborders-content {
+ text-align: left;
+ vertical-align: top;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+td.sme-noborders-info, div.sme-noborders-info {
+ text-align: left;
+ vertical-align: top;
+}
+/* Used for a left-most column of radio buttons (see date/time panel) */
+td.sme-radiobutton {
+ width: 30px;
+}
+/*
+sme-border* : Used for tabular data
+*/
+table.sme-border {
+ border-collapse: collapse;
+ border: 2px solid #cccccc;
+ empty-cells: show;
+ margin: 5px 5px 5px 2px;
+}
+td.sme-border,
+td.sme-border-warning,
+td.sme-border-right,
+td.sme-border-center {
+ border: 1px solid #cccccc;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ font-weight: normal;
+ color: #000000;
+ text-align: left;
+ padding-left: 2px;
+ padding-right: 2px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+}
+td.sme-border-warning {
+ color: red;
+ }
+td.sme-border-right {text-align: right;}
+td.sme-border-center {text-align: center;}
+th.sme-border {
+ border: 1px solid #cccccc;
+ background-color: #bee6a2;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ font-weight: bold;
+ color: #000000;
+ text-align: center;
+ vertical-align: bottom;
+ padding-left: 2px;
+ padding-right: 2px;
+ padding-left: 3px;
+ padding-right: 3px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ /*border-width: 1px;
+ border-style: solid;
+ border-color: #F2F0EE #75736E #75736E #F2F0EE ;*/
+}
+td.sme-border a, td.sme-border-right a, td.sme-border-center a {
+ font-size: 10px;
+}
+
+/* misc layout stuff*/
+/* these two are for any error messages that pop up*/
+div.error, div.sme-error, span.error, span.sme-error {
+ color: red;
+ background-color: #ffffff;
+ border-width: 1px;
+ border-style: solid;
+ border-color: red ;
+ padding: 2px;
+ margin-left: 20px;
+ margin-right: 20px;
+ margin-top:0px;
+ margin-bottom:0px;
+
+}
+
+div.error-noborders, div.sme-error-noborders,
+span.error-noborders, span.sme-error-noborders
+{
+ color: red;
+ background-color: #ffffff;
+ border-width: 0px;
+}
+
+div.error h2, span.error h2,
+div.error p, span.error p
+{
+ color: red;
+}
+/* These are for the special case of a link being inside an error message */
+div.sme-error a, div.error a, span.error a, span.sme-error a,
+div.error-noborders a, div.sme-error-noborders a,
+span.error-noborders a, span.sme-error-noborders a
+{
+ color: #ff0000;
+ font-weight: bold;
+ text-decoration: underline;
+}
+
+/* For when a link is the error message */
+a.error:link, a.error:visited, a.error:hover, a.error:active {
+ color: #ff0000;
+ font-weight: normal;
+ text-decoration: underline;
+}
+
+/* these two are for any success messages that pop up*/
+div.success, span.success {
+ color: #006400;
+ background-color: #ffffff;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #006400 ;
+ padding: 2px;
+ margin-left: 20px;
+ margin-right: 20px;
+ margin-top:0px;
+ margin-bottom:0px;
+
+}
+
+/* These two are for the special case of a link being inside a success message */
+div.success a, span.success a
+{
+ color: #006400;
+ font-weight: bold;
+ text-decoration: underline;
+}
+
+div.success h2, span.success h2,
+div.success p, span.success p
+{
+ color: green;
+}
+
+/*These two define the copyright footer styles, one for the line and one for the text*/
+hr.sme-copyrightbar {
+}
+.sme-copyright {
+}
+
+/* These ones define styles for the links that are made to look like
+ standard form submit buttons */
+a.button-like:link,
+a.button-like:visited,
+a.button-like:hover,
+a.button-like:active,
+a.button-like-small:link,
+a.button-like-small:visited,
+a.button-like-small:hover,
+a.button-like-small:active {
+ font-family: sans-serif;
+ font-size: 13px;
+ color: black;
+ background: #D4D0C8;
+ text-decoration: none;
+ text-align: left;
+ border-color: #F2F0EE #75736E #75736E #F2F0EE ;
+ margin-top: 10px;
+ margin-right: 2px;
+ margin-bottom: 10px;
+ margin-left: 2px;
+ border-style: solid;
+ border-top-width: 2px;
+ border-right-width: 2px;
+ border-bottom-width: 2px;
+ border-left-width: 2px;
+ padding-top: 2px;
+ padding-bottom: 2px;
+ padding-left: 6px;
+ padding-right: 6px;
+ }
+a.button-like-small:link,
+a.button-like-small:visited,
+a.button-like-small:hover,
+a.button-like-small:active {
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ font-size: 10px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ padding-left: 1px;
+ padding-right: 1px;
+}
+a.button-like:active,
+a.button-like-small:active {
+ border-color: #75736E #F2F0EE #F2F0EE #75736E ;
+}
+
+/* EXPERIMENTAL SECTION */
+/* These are styles used to experiment with. */
+
+/* class for links, similar to the class in sme_menu.css, but for a red button */
+a.button-like-red:link,
+a.button-like-red:visited,
+a.button-like-red:hover,
+a.button-like-red:active {
+ border-left: #F1726C 2px solid;
+ border-right: #B42025 2px solid;
+ border-top: #F1726C 2px solid;
+ border-bottom: #B42025 2px solid;
+ }
+a.button-like-red:active {
+ border-color: #75736E #F2F0EE #F2F0EE #75736E ;
+}
+
+/*These are style definitions found in the UI but not defined in any file I
+ could locate. They're listed here for historical purposes, but have been
+ removed from the UI
+
+pagedescription (used in the first paragraph of text on a page) [HTML.pm]
+label (used in forms) [HTML.pm]
+field (used in forms) [HTML.pm]
+fielddescription (used ???)[HTML.pm]
+buttons (used in forms) [HTML.pm]
+*/
+/*td.sme-submitbutton {
+ text-align: right;
+}
+*/
+
+/*These style definitions were found int he old css file (manager.css)
+ but don't seem to ever be referenced in the code. They're here
+ for reference.
+
+.banner {
+ background: #000000;
+ color: #ffffff;
+}
+.banner-right {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ background: #e17200;
+ color: #ffffff;
+}
+.border {
+ background: #000000;
+ color: #000000;
+ border-color: #000000;
+}
+.sidebar {
+ width: 200px;
+ background: #ffffff;
+ font-size: smaller;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: normal;
+}
+.sidebar-title {
+ background: #1e385b;
+ color: #ffffff;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+}
+.newsitem {
+ background: #ffffff;
+ color: #000000;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ margin-left: 5px;
+ margin-right: 5px;
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+.newsitem-title {
+ background: #cccccc;
+ color: #ffffff;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+}
+.newsitem-footer {
+ background: #cccccc;
+ color: #000000;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: smaller;
+ text-align: right;
+}
+.newsitem-detail {
+ font-size: smaller;
+ font-weight: normal;
+}
+.formlabel {
+ background: #c0c0c0;
+ color: #000000;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: small;
+ font-weight: bold;
+ text-align: right;
+}
+.welcome-link {
+ background: #ffffff;
+ color: #1e385b;
+}
+.littlelink {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+}
+#textlayer {
+ position: absolute;
+ visibility: inherit;
+ top: 160px;
+ left: 50px;
+ z-index: 2;
+}
+#para {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ color: #000000;
+}
+#title {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ padding: 7px 7px 7px 7px;
+ color: #ffffff;
+}
+*/
+
+EOF
+}
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/90contribs smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/90contribs
--- smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/90contribs 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/90contribs 2020-04-10 16:52:25.340000000 +0400
@@ -0,0 +1,50 @@
+{
+ $OUT =<<'HERE';
+
+/* from e-smith-manager to smeserver_manager2 */
+
+/*----------------------------------------------------------------------
+ * copyright (C) 1999-2003 Mitel Networks Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Technical support for this program is available from Mitel Networks
+ * Please visit our web site www.mitel.com for details.
+ *----------------------------------------------------------------------
+ */
+/*contribs.org styling */
+
+/* This special style is actually used only for the button row along the bottom of each page */
+th.sme-layout {
+border: 1px solid #8ebe43;
+background-color: #bee6a2;
+ }
+table.sme-border {
+border: 2px solid #dddddd;
+ }
+td.sme-border-warning,
+td.sme-border-right,
+td.sme-border-center {
+border: 1px solid #dddddd;
+ }
+td.sme-border-right {text-align: right;}
+td.sme-border-center {text-align: center;}
+th.sme-border {
+border: 1px solid #dddddd;
+background-color: #e8f3e1;
+ }
+HERE
+}
+
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/template-begin smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/template-begin
--- smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/template-begin 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_main.css/template-begin 2006-03-16 01:59:54.000000000 +0400
@@ -0,0 +1 @@
+/* DO NOT MODIFY THIS FILE! It is updated automatically */
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_menu.css/50body smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_menu.css/50body
--- smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_menu.css/50body 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_menu.css/50body 2020-04-10 16:51:14.026000000 +0400
@@ -0,0 +1,229 @@
+{
+ $OUT = <<'EOF';
+
+/* from e-smith-manager to smeserver_manager2 */
+
+/*----------------------------------------------------------------------
+ * copyright (C) 1999-2003 Mitel Networks Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Technical support for this program is available from Mitel Networks
+ * Please visit our web site www.mitel.com for details.
+ *----------------------------------------------------------------------
+ */
+
+/* This is the stylesheet used in the navigation panel only
+
+ This file inherits the styles use in sme_core in the "navigation" section,
+ and as noted in the code below. Note that some of the styles here are empty.
+ This is because the style definition has moved safely to sme_core.css and
+ the placeholder is left here for reference or future use.
+
+ There are a lot of styles in here, so read carefully. Each one is
+ documented.
+
+ Styles that were in the old stylesheets, but are not used in the UI are at
+ the bottom, commented out. These can be removed at the end of the 6.0
+ cycle */
+
+/* Sets the general page properties */
+body, body.menu {
+ margin-top: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ margin-left: 2px;
+}
+
+/* This is the section heading style */
+.section {
+}
+
+td.menu-cell {
+ margin-top: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ margin-left: 0px;
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+
+}
+
+/*
+All the a links use pseudoclasses to control the two visual link styles.
+For example:
+ a.item:link the general link item
+ a.item-current:link: the active link item
+
+The switch from item to item-current is done with a javascript script in the head of the
+navigation page, using the onClick event.
+
+We are making heavy use of the cascade with these.
+*/
+
+/* a:link controls the look of a link when the mouse is nowhere near it */
+a.item:link, a.item-current:link,
+a.warn:link, a.warn-current:link {
+ display: block;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ color: black;
+ background: #e8f3e1;
+ text-decoration: none;
+ text-align: left;
+ border-color: #e8f3e1;
+ margin-top: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ margin-left: 0px;
+ border-style: solid;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ padding-right: 10px;
+ padding-left: 10px;
+ padding-top: 0px;
+ padding-bottom: 2px;
+ }
+
+/* a:visited controls the look of a visited link (one that has been clicked) */
+a.item:visited, a.item-current:visited,
+a.warn:visited, a.warn-current:visited {
+ display: block;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ color: black;
+ background: #e8f3e1;
+ text-decoration: none;
+ border-color: #e8f3e1;
+ margin-top: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ margin-left: 0px;
+ border-style: solid;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ padding-right: 10px;
+ padding-left: 10px;
+ padding-bottom: 2px;
+ text-align: left;
+}
+
+/* a:hover controls the look of a link under the curser*/
+a.item:hover, a.item-current:hover,
+a.warn:hover, a.warn-current:hover {
+ display: block;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ color: black;
+ text-decoration: none;
+ background: #cccccc;
+ border-color: #888888;
+ margin-top: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ margin-left: 0px;
+ border-style: solid;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ padding-right: 10px;
+ padding-left: 10px;
+ padding-bottom: 2px;
+ text-align: left;
+}
+
+/* a:active controls the look of a link as it is selected*/
+a.item:active, a.item-current:active,
+a.warn:active, a.warn-current:active {
+ display: block;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ color: white;
+ background: black;
+ text-decoration: none ;
+ border-color: #000000;
+ margin-top: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ margin-left: 0px;
+ border-style: solid;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ padding-right: 10px;
+ padding-left: 10px;
+ padding-bottom: 2px;
+ text-align: left;
+}
+
+/*
+These styles are to ensure that a selected link appears selected, even if the link
+opens in another frame. This uses a javascript chunk in the head of the navigation
+frame to change the style using the onClick event.
+*/
+a.item-current:link, a.warn-current:link,
+a.item-current:visited, a.warn-current:visited,
+a.item-current:active, a.warn-current:active,
+a.item-current:hover, a.warn-current:hover {
+ display: block;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ color: black;
+ text-decoration: none;
+ background: #ffffff;
+ border-color: #888888;
+ margin-top: 0px;
+ margin-right: 0px;
+ margin-bottom: 0px;
+ margin-left: 0px;
+ border-style: solid;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ padding-right: 10px;
+ padding-left: 10px;
+ padding-bottom: 2px;
+ text-align: left;
+}
+
+/* these two add a border on the styles defined directly above when
+the mouse is hovering over them */
+a.item-current:hover, a.warn-current:hover {
+ border-color: #888888;
+}
+
+/* These redefine a few elements to make room for the icon to the left of the warn class*/
+a.warn:link, a.warn-current:link,
+a.warn:visited, a.warn-current:visited,
+a.warn:active, a.warn-current:active,
+a.warn:hover, a.warn-current:hover {
+ background-image: url(/server-common/warn.gif);
+ background-repeat: no-repeat;
+ background-position: 10px;
+ padding-left: 25px;
+}
+/*end*/
+
+EOF
+}
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_menu.css/template-begin smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_menu.css/template-begin
--- smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_menu.css/template-begin 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/sme_menu.css/template-begin 2006-03-16 01:59:54.000000000 +0400
@@ -0,0 +1 @@
+/* DO NOT MODIFY THIS FILE! It is updated automatically */
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css/50body smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css/50body
--- smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css/50body 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css/50body 2020-04-11 20:04:09.221000000 +0400
@@ -0,0 +1,201 @@
+{
+ $OUT = <<'EOF';
+
+/* smeserver_manager2 */
+
+/*----------------------------------------------------------------------
+ * copyright (C) 1999-2003 Mitel Networks Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Technical support for this program is available from Mitel Networks
+ * Please visit our web site www.mitel.com for details.
+ *----------------------------------------------------------------------
+ */
+
+/* This is the basic stylesheet originally used in the mojo version.
+ */
+
+body{
+ background-color: #FFF;
+}
+
+#container{
+ max-width: 100%;
+ position: relative;
+ margin: auto;
+}
+
+#navigation{
+ width: 190px;
+ position: absolute;
+ margin-left: 0px;
+ padding: 5px;
+ background-color: #E8F3E1;
+/* height: 600px; */
+ overflow: auto;
+}
+
+#main{
+ margin-left: 195px;
+ padding: 10px;
+}
+
+#central{
+ margin-left: 0px;
+ padding: 5px;
+}
+
+#footer{
+ margin-left: 0px;
+ padding: 5px;
+}
+
+#header {
+ background: #bee6a2;
+}
+
+#header h1, a:link, a:visited {
+ color: black;
+ text-decoration: none;
+/* contribs.org styling */
+}
+
+.sme-error {
+ color: red;
+ background-color: #ffffff;
+ border-width: 1px;
+ border-style: solid;
+ border-color: red ;
+ padding: 2px;
+ margin-left: 10px;
+ margin-right: 10px;
+ margin-top:0px;
+ margin-bottom:0px;
+}
+
+#footer img {
+ float: right;
+ position: fixed;
+ margin-left: 40%;
+}
+
+label.field-with-error {
+ color: #dd7e5e
+}
+
+input.field-with-error {
+ background-color: #fd9e7e
+}
+
+span.label {
+ display: inline-block;
+ font-weight: bold;
+ background-color: #e8f3e1; /*lightgreen;*/
+ width: 30%;
+ text-align: right;
+}
+
+span.data {
+ padding: 2px;
+ font-weight: bold;
+ margin-left: 0%;
+/* background-color: lightblue;*/
+}
+
+span.data2 {
+ padding: 2px;
+/* background-color: lightblue; */
+}
+
+input.action {
+ margin-left: 0px;
+ color: darkgreen;
+ background-color: #bee6a2; /*lightgreen;*/
+}
+
+input.action2 {
+ margin-left: 0px;
+ color: black;
+ background-color: #d4d0c8;
+}
+
+#modul.desc {
+ padding: 3px;
+ background-color: grey;
+}
+
+[type = 'text'] {
+ margin-left: 0px;
+ /*background-color: lightblue;*/
+}
+
+.a, .return {
+ color: #661866;
+ font-weight: bold;
+}
+
+.section {
+ line-height: 20px;
+}
+.a, .item {
+ line-height: 15px;
+}
+
+#module {
+/* height: 600px; */
+ overflow: auto;
+}
+
+
+#h2l1 {
+ height: 40px;
+ width: 100%;
+}
+#h2e11 {
+ width: 70%;
+ float: left;
+}
+#h2e12 {
+ background-color: #C0E7A6;
+ float: left;
+ text-align: right;
+}
+
+#h2l2 {
+/* background-color: #A8F9E7;*/
+ border-top: solid white 3px;
+ border-bottom: solid white 2px;
+ height: 14px;
+ width: 100%;
+ padding: 1px;
+}
+
+#h2e21 {
+ float: left;
+ width: 70%;
+}
+
+#h2e22,#h2e23 {
+ float: left;
+ width: 10%;
+ text-align: center;
+}
+
+
+/*end*/
+
+EOF
+}
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css/template-begin smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css/template-begin
--- smeserver-manager-0.1.0.old/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css/template-begin 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/templates/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/themes/default/public/css/styles.css/template-begin 2006-03-16 01:59:54.000000000 +0400
@@ -0,0 +1 @@
+/* DO NOT MODIFY THIS FILE! It is updated automatically */
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/conf/srvmngr.conf smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/conf/srvmngr.conf
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/conf/srvmngr.conf 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/conf/srvmngr.conf 2020-04-08 16:41:09.000000000 +0400
@@ -1,8 +1,6 @@
{
secrets => ['new sessionsLeYTmFPhw3q', 'for validation QrPTZhWJmqCjyGZmguK'],
-# theme => 'default',
- theme => 'AdminLTE',
- navigation_has_changed => 1,
+ theme => 'default',
modules_dir => "lib/SrvMngr/Controller",
debug => 0,
}
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Backup.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Backup.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Backup.pm 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Backup.pm 2020-03-29 00:57:45.000000000 +0400
@@ -0,0 +1,963 @@
+package SrvMngr::Controller::Backup;
+
+#----------------------------------------------------------------------
+# heading : Administration
+# description : Backup or restore
+# navigation : 4000 4200
+# Copyright (C) 2002 Mitel Networks Corporation
+#----------------------------------------------------------------------
+# routes : end
+
+use strict;
+use warnings;
+use Mojo::Base 'Mojolicious::Controller';
+
+use Locale::gettext;
+use SrvMngr::I18N;
+use SrvMngr qw(theme_list init_session_cgi ip_number_or_blank);
+
+use Quota;
+use esmith::ConfigDB;
+use esmith::AccountsDB;
+
+use esmith::util;
+use File::Basename;
+use File::Find;
+use File::Path qw(make_path remove_tree);
+
+use esmith::Backup;
+use esmith::BackupHistoryDB;
+use esmith::cgi;
+use esmith::util;
+use esmith::lockfile;
+
+our $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
+our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
+our $rdb = esmith::ConfigDB->open('/etc/e-smith/restore')
+ || die "Couldn't open restore db";
+
+
+#$File::Find::dont_use_nlink = 1; # fix for Windows shares
+
+# These statements _must_ come _after_ the FormMagick constructor. It sets
+# POST_MAX and DISABLE_UPLOADS to values that will cause this script to fail
+# on restores and verification of files.
+##$CGI::POST_MAX = -1; # allow any size POST
+##$CGI::DISABLE_UPLOADS = 0; # need to upload to restore from desktop
+
+#$fm->parse_xml();
+
+my $es_backup = new esmith::Backup or die "Couldn't create Backup object\n";
+
+my @directories = $es_backup->restore_list;
+@directories = grep { -e "/$_" } @directories;
+
+my @backup_excludes = $es_backup->excludes;
+
+# Unbuffer standard output so that files and directories are listed as
+# they are restored
+$| = 1;
+
+# Store away current gid of 'www' group.
+my $www_gid = getgrnam("www");
+
+
+sub main {
+
+ my $c = shift;
+ $c->app->log->info($c->log_req);
+
+ my %bac_datas = ();
+ my $title = $c->l('bac_BACKUP_TITLE');
+ my $notif;
+
+ $bac_datas{'function'} = 'desktop_backup';
+ my ($tarsize, $dumpsize, undef, undef) = $c->CalculateSizes();
+
+ my $module = $cdb->get('backup');
+ if ($module) {
+ $module = $module->prop('Program');
+ }
+
+ # The default e-smith backup program is flexbackup.
+ unless (defined $module) {
+ $module = "flexbackup";
+ } elsif ($module eq '') {
+ $module = "flexbackup";
+ }
+
+ $bac_datas{'tarsize'} = $tarsize;
+ $bac_datas{'dumpsize'} = $dumpsize;
+ $bac_datas{'module'} = $module;
+
+ if ($tarsize =~ /Tb/ or $tarsize =~ /(\d+)Gb/ and $1 >= 2) {
+ $notif = $c->l("bac_BACKUP_DESKTOP_TOO_BIG");
+ }
+
+ my $rec = $cdb->get('backup');
+ my ($backup_status, $backupwk_status) = 'disabled';
+
+ if ($rec) {
+ $backup_status = $rec->prop('status') || 'disabled';
+ }
+
+ if ($backup_status eq "enabled") {
+ $bac_datas{'backupTime'} = $rec->prop('backupTime');
+ $bac_datas{'reminderTime'} = $rec->prop('reminderTime');
+ }
+
+ $rec = $cdb->get('backupwk');
+ if ($rec) {
+ $backupwk_status = $rec->prop('status') || 'disabled';
+ }
+
+ if ($backupwk_status eq "enabled") {
+ $bac_datas{'backupwkTime'} = $rec->prop('BackupTime');
+
+ }
+
+ $bac_datas{'backupStatus'} = $backup_status;
+ $bac_datas{'backupwkStatus'} = $backupwk_status;
+
+ $c->stash( title => $title, notif => $notif, bac_datas => \%bac_datas );
+ $c->render(template => 'backup');
+
+};
+
+
+sub do_display {
+
+ my $c = shift;
+ $c->app->log->info($c->log_req);
+
+ my $rt = $c->current_route;
+ my ($res, $result) = '';
+
+ my $function = $c->param('Function');
+
+ if ($function =~ /^(\S+)$/) {
+ $function = $1;
+ } elsif ($function =~ /^\s*$/) {
+ $function = "zoverall";
+ } else {
+ $result = $c->l('bac_INVALID_FUNCTION') . $function;
+ $function = undef;
+ }
+
+ my %bac_datas = ();
+ $bac_datas{'function'} = $function;
+
+ my $title = $c->l('bac_BACKUP_TITLE');
+ my ($notif, $dest) = '';
+
+ if ( $function eq 'desktop_backup' ) {
+ my $res = desktopBackup();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $bac_datas{function} = 'SUC';
+ $result = $c->l('bac_SUCCESS');
+ $c->app->log->info('desktop backup LAUNCHED');
+ $c->flash(success => $result);
+ } else {
+ $c->flash(error => $result);
+ }
+ $c->redirect_to("backup");
+ }
+
+
+ if ( $function eq 'tape_configure' ) {
+
+ $bac_datas{'status'} = 'unchecked';
+ my $backupTime = "2:00";
+
+ my $rec = $cdb->get('backup');
+ if ($rec) {
+ $backupTime = $rec->prop('backupTime') || "2:00";
+
+ my $backup_status = $rec->prop('status');
+ if (defined $backup_status && $backup_status eq "enabled") {
+ $bac_datas{'status'} = "checked";
+ }
+ }
+ ($bac_datas{backupAMPM}, $bac_datas{reminderAMPM}) = 'AM';
+
+ ($bac_datas{backupHour}, $bac_datas{backupMin}) = split (":", $backupTime, -1);
+ if ($bac_datas{backupHour} > 11) {
+ if ($bac_datas{backupHour} > 12) {
+ $bac_datas{backupHour} -= 12;
+ }
+ $bac_datas{backupAMPM} = 'PM';
+ }
+
+ # Obtain time for reminder notice from the backup cron template
+ my $reminderTime = "14:00";
+ if ($rec) {
+ $reminderTime = $rec->prop('reminderTime') || "14:00";
+ }
+
+ ($bac_datas{reminderHour}, $bac_datas{reminderMin}) = split (":", $reminderTime, -1);
+ if ($bac_datas{reminderHour} > 12) {
+ $bac_datas{reminderHour} -= 12;
+ $bac_datas{reminderAMPM} = 'PM';
+ }
+ }
+
+
+ if ( $function eq 'workstn_configure' ) {
+
+ my $rec = $cdb->get('backupwk');
+ $bac_datas{vfstype} = $rec->prop('VFSType') || 'cifs';
+ $bac_datas{status} = $rec->prop('status');
+
+ }
+
+
+ $dest = "back_$function";
+
+ $c->stash( title => $title, notif => $result, bac_datas => \%bac_datas );
+ return $c->render( template => $dest );
+
+};
+
+
+sub do_update {
+
+ my $c = shift;
+ $c->app->log->info($c->log_req);
+
+ my $rt = $c->current_route;
+ my $function = $c->param('Function');
+
+ my %bac_datas = ();
+ $bac_datas{function} = $function;
+ my $title = $c->l('bac_BACKUP_TITLE');
+ my ($dest, $res, $result) = '';
+
+
+ if ( $function eq 'desktop_backup' ) {
+
+ # should not happen !! no desktop_backup template !!
+
+ my $res = desktopBackup();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $bac_datas{function} = 'SUC';
+ $result = $c->l('bac_SUCCESS');
+ $c->stash( notif => $result );
+ $c->redirect_to("/backup");
+ }
+ }
+
+
+ if ( $function eq 'tape_configure' ) {
+
+ my $status = $c->param('Tapebackup');
+ my $backupHour = $c->param('BackupHour');
+ my $backupMin = $c->param('BackupMin');
+ my $bampm = $c->param('BackupAMPM');
+ my $reminderHour = $c->param('ReminderHour');
+ my $reminderMin = $c->param('ReminderMin');
+ my $rampm = $c->param('ReminderAMPM');
+
+ ## $c->l('bac_UPDATING_TAPE_CONF')
+
+ if (defined $status && $status eq "on") {
+
+ if ($backupHour =~ /^(.*)$/) {
+ $backupHour = $1;
+ } else {
+ $backupHour = "12";
+ }
+ if (($backupHour < 1) || ($backupHour > 12)) {
+ $result .= $c->l('bac_ERR_INVALID_HOUR').$backupHour.
+ ' '.$c->l('bac_BETWEEN_0_AND_12').' ';
+ }
+
+ if ($backupMin =~ /^(.*)$/) {
+ $backupMin = $1;
+ } else {
+ $backupMin = "0";
+ }
+ if (($backupMin < 0) || ($backupMin > 59)) {
+ $result .= $c->l('bac_ERR_INVALID_MINUTE').$backupMin.
+ ' '.$c->l('bac_BETWEEN_0_AND_59').' ';
+ }
+
+ if ($reminderHour =~ /^(.*)$/) {
+ $reminderHour = $1;
+ } else {
+ $reminderHour = "12";
+ }
+ if (($reminderHour < 1) || ($reminderHour > 12)) {
+ $result .= $c->l('bac_ERR_INVALID_REMINDER_HOUR').$reminderHour.
+ ' '.$c->l('bac_BETWEEN_0_AND_12').' ';
+ }
+
+ if ($reminderMin =~ /^(.*)$/) {
+ $reminderMin = $1;
+ } else {
+ $reminderMin = "0";
+ }
+ if (($reminderMin < 0) || ($reminderMin > 59)) {
+ $result .= $c->l('bac_ERR_INVALID_REMINDER_MINUTE').$reminderMin.
+ ' '.$c->l('bac_BETWEEN_0_AND_59').' ';
+ }
+ }
+ else
+ {
+ # service disabled no controls
+ }
+
+ ##$result .= ' ** Blocked for testing ** !';
+
+ if ( ! $result ) {
+ $res = $c->updateTapeBackupConfig($status, $backupHour,
+ $backupMin, $bampm, $reminderHour, $reminderMin, $rampm);
+
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $bac_datas{function} = 'SUC';
+ if (defined $status && $status eq "on") {
+ $result .= ($c->l('bac_SUCCESSFULLY_ENABLED_TAPE').' '.
+ $c->l('bac_WITH_BACKUP_TIME')."$backupHour:$backupMin".' '.
+ $c->l('bac_WITH_REMINDER_TIME')."$reminderHour:$reminderMin");
+ } else {
+ $result .= $c->l('bac_SUCCESSFULLY_DISABLED');
+ }
+ }
+ }
+ }
+
+
+ if ( $function eq 'tape_restore' ) {
+
+ my $lock_file = "/var/lock/subsys/e-smith-restore";
+ my $file_handle = &esmith::lockfile::LockFileOrReturn($lock_file);
+
+ unless ($file_handle) {
+ $result .= $c->l('bac_UNABLE_TO_RESTORE_CONF').' '.
+ $c->l('ANOTHER_RESTORE_IN_PROGRESS');
+ }
+
+ $result .= ' ** Blocked for testing ** ! (HARD TO TEST!)';
+
+ if ( ! $result ) {
+ my $res = $c->tapeRestore( $lock_file, $file_handle );
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $bac_datas{function} = 'SUC';
+ $result = $c->l('bac_SUCCESS');
+ }
+ }
+ }
+
+
+ if ( $function eq 'workstn_configure' ) {
+
+# $bac_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = $c->zzzz( $c->param('ZZZZ') );
+# $result .= $res . ' DMS ' unless $res eq 'OK';
+
+ $result .= ' ** Blocked for testing ** !';
+
+ if ( ! $result ) {
+ $res = $c->workstnConfigure();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $bac_datas{function} = 'SUC';
+ $result = $c->l('bac_SUCCESS');
+ }
+ }
+ }
+
+
+ if ( $function eq 'workstn_verify' ) {
+
+# $bac_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = $c->zzzz( $c->param('ZZZZ') );
+# $result .= $res . ' DMS ' unless $res eq 'OK';
+
+ $result .= ' ** Blocked for testing ** !';
+
+ if ( ! $result ) {
+ $res = $c->workstnVerify();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $bac_datas{function} = 'SUC';
+ $result = $c->l('bac_SUCCESS');
+ }
+ }
+ }
+
+
+ if ( $function eq 'workstn_restore' ) {
+
+# $bac_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = $c->zzzz( $c->param('ZZZZ') );
+# $result .= $res . ' DMS ' unless $res eq 'OK';
+
+ $result .= ' ** Blocked for testing ** !';
+
+ if ( ! $result ) {
+ $res = $c->workstnRestore();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $bac_datas{function} = 'SUC';
+ $result = $c->l('bac_SUCCESS');
+ }
+ }
+ }
+
+
+ if ( $function eq 'workstn_sel_restore' ) {
+
+# $bac_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = $c->zzzz( $c->param('ZZZZ') );
+# $result .= $res . ' DMS ' unless $res eq 'OK';
+
+ $result .= ' ** Blocked for testing ** !';
+
+ if ( ! $result ) {
+ $res = $c->workstnSelRestore();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $bac_datas{function} = 'SUC';
+ $result = $c->l('bac_SUCCESS');
+ }
+ }
+ }
+
+
+ # common part for all functions
+
+ $c->stash( title => $title, bac_datas => \%bac_datas );
+ if ($bac_datas{function} ne 'SUC') {
+ $c->flash(error => $result);
+ $bac_datas{'function'} = $function;
+ $dest = "back_$function";
+ return $c->render(template => $dest);
+ }
+
+ my $message = $function . ' updates DONE';
+ $c->app->log->info($message);
+ $c->flash(success => $result);
+
+ #return to 'backup' route !!!
+ $c->redirect_to('backup');
+
+};
+
+
+sub get_function_options {
+
+ my $c = shift;
+
+ return [[ $c->l('bac_DESKTOP_BACKUP') => 'desktop_backup' ],
+ [ $c->l('bac_TAPE_CONFIGURE') => 'tape_configure' ],
+ [ $c->l('bac_TAPE_RESTORE') => 'tape_restore' ],
+ [ $c->l('bac_WORKSTN_CONFIGURE') => 'workstn_configure' ],
+ [ $c->l('bac_WORKSTN_VERIFY') => 'workstn_verify' ],
+ [ $c->l('bac_WORKSTN_RESTORE') => 'workstn_restore' ],
+ [ $c->l('bac_WORKSTN_SEL_RESTORE') => 'workstn_sel_restore']];
+
+}
+
+
+sub desktopBackup {
+
+ my $c = shift;
+
+ # Generate a header that will trigger a download and send data as
+ # an octet stream.
+
+ my $backups = esmith::BackupHistoryDB->open;
+ my $now = time();
+ my $backup_rec = $backups->new_record($now, {
+ type => 'backup_record',
+ BackupType => 'desktop',
+ StartEpochTime => $now,
+ });
+ my $CompressionLevel = $cdb->get_prop("backupconsole", "CompressionLevel") || "-6";
+ my @exclude = map (" --exclude=$_",@backup_excludes);
+
+ # Dump the current mysql tables so that they are part of the image.
+ # The events handle cases where mysqld is not enabled, and/or is
+ # not running.
+
+ my $status = system("/sbin/e-smith/signal-event", "pre-backup", "desktop");
+ if ($status)
+ {
+ desktopBackupRecordStatus($backup_rec, 'pre-backup', $status);
+ return ($c->l('bac_OPERATION_STATUS_REPORT').
+ $c->l('bac_ERR_PRE_BACKUP'));
+ }
+
+ print "Expires: 0\n";
+ print "Content-type: application/octet-stream\n";
+ print "Content-disposition: attachment; filename=smeserver.tgz\n";
+ print "\n";
+ setpgrp;
+ my $ourpgrp = getpgrp;
+ local $SIG{PIPE} = sub
+ {
+ local $SIG{HUP} = 'IGNORE';
+ warn "Got sigpipe - sending HUP to $ourpgrp\n";
+ kill HUP => -$ourpgrp;
+ desktopBackupRecordStatus($backup_rec,
+ 'send2browser', 'Incomplete');
+ exit 1;
+ };
+
+ open(RD,
+ "/bin/tar --directory / --create @directories --file=-"
+ . "@exclude | /usr/bin/gzip $CompressionLevel |"
+ );
+
+ while (
Welcome to SME Server, the leading Linux distribution for
@@ -185,7 +186,7 @@
This software comes with ABSOLUTELY NO WARRANTY.
- Please click here
+ Please click here
to view detailed support, warranty and licensing information.
'.
+ $c->l('bac_ERR_RESTORING_GID'));
+ warn ($c->l('bac_ERR_RESTORING_GID')."\n");
+ }
+ unless(system("/usr/sbin/usermod", "-g", "$www_gid", "www") == 0)
+ {
+ $rec->set_prop('errmsg', $rec->prop('errmsg').'
'.
+ $c->l('bac_ERR_RESTORING_INITIAL_GRP'));
+ warn ($c->l('bac_ERR_RESTORING_INITIAL_GRP')."\n");
+ }
+ unless(system("/sbin/e-smith/signal-event", "post-upgrade") == 0)
+ {
+ $rec->set_prop('errmsg', $rec->prop('errmsg').'
'.
+ $c->l('bac_ERR_UPDATING_CONF_AFTER_TAPE_RESTORE'));
+ $rec->delete_prop('state');
+ die ($c->l('bac_ERR_UPDATING_CONF_AFTER_TAPE_RESTORE'));
+ }
+
+ my $finish = time;
+ $rec->set_prop('state', 'complete');
+ $rec->set_prop('finish', $finish);
+
+ my $start = $rec->prop('start');
+ $start = scalar localtime($start);
+ $finish = scalar localtime($finish);
+
+ &esmith::lockfile::UnlockFile($file_handle);
+
+ exit;
+ }
+ else
+ {
+ # Error
+
+ $rec->delete_prop('state');
+ $rec->set_prop('errmsg', $c->l('bac_COULD_NOT_FORK'));
+ die ($c->l("bac_COULD_NOT_FORK")." $!\n");
+ }
+}
+
+
+sub get_VFSType_options {
+
+ my $c = shift;
+ return [[ $c->l('cifs') => 'cifs' ], [ $c->l('nfs') => 'nfs' ],
+ [ $c->l('local removable disk') => 'usb' ], [ $c->l('Mounted disk') => 'mnt' ]];
+}
+
+
+sub getWorkstnBackupConfig {
+
+ my ($c) = @_;
+ my $out;
+
+ my $backupwk_status;
+ my $enabledIncOnlyTimeout = "";
+ my $backupwkLogin = 'backup';
+ my $backupwkPassword = 'backup';
+ my $backupwkStation = 'host';
+ my $backupwkFolder = 'share';
+ my $backupwkMount = '/mnt/smb';
+ my $setsNumber;
+ my $filesinset;
+ my $backupwkTime;
+ my $backupwkTimeout;
+ my $backupwkIncOnlyTimeout;
+ my $VFSType;
+ my $compression;
+ my $dof;
+ my @dlabels = split(' ', $c->l('bac_DOW'));
+
+ # Obtain backup informations from configuration
+ my $rec = $cdb->get('backupwk');
+ if ($rec) {
+ $backupwkTime = $rec->prop('BackupTime') || '2:00';
+ $backupwkLogin = $rec->prop('Login') || 'backup';
+ $backupwkPassword = $rec->prop('Password') || 'backup';
+ $backupwkStation = $rec->prop('SmbHost') || 'host';
+ $backupwkFolder = $rec->prop('SmbShare') || 'share';
+ $backupwkMount = $rec->prop('Mount') || '/mnt/smb';
+ $VFSType = $rec->prop('VFSType') || 'cifs';
+ $setsNumber = $rec->prop('SetsMax') || '1';
+ $filesinset = $rec->prop('DaysInSet') || '1';
+ $backupwkTimeout = $rec->prop('Timeout') || '12';
+ $backupwkIncOnlyTimeout = $rec->prop('IncOnlyTimeout') || 'yes';
+ $compression = $rec->prop('Compression') || '0';
+ $dof = (defined $rec->prop('FullDay')) ? $rec->prop('FullDay') : '7';
+ $backupwk_status = $rec->prop('status');
+ }
+
+ if ($rec) {
+ if ($VFSType eq 'usb') {
+ $out .= $c->l('bac_WORKSTN_BACKUP_USB').' '.$backupwkFolder.'
';
+ }
+ elsif ($VFSType eq 'mnt') {
+ $out .= $c->l('bac_WORKSTN_BACKUP_MNT').' '.$backupwkMount.'
';
+ } else {
+ $out .= $c->l('bac_WORKSTN_BACKUP_HOST').' '.$backupwkStation.' ';
+ $out .= $c->l('bac_WORKSTN_BACKUP_VFSTYPE').' '.$VFSType.'
';
+ $out .= $c->l('bac_WORKSTN_BACKUP_SHARE').' '.$backupwkFolder.'
';
+ }
+ if ($VFSType eq 'cifs') {
+ $out .= $c->l('bac_LOGIN').' '.$backupwkLogin.'
';
+ $out .= $c->l('PASSWORD').' ********
';
+ }
+ $out .= $c->l('bac_WORKSTN_BACKUP_SETSNUM').' '.$setsNumber.'
';
+ $out .= $c->l('bac_WORKSTN_BACKUP_DAYSINSET').' '.$filesinset.'
';
+ $out .= $c->l('bac_WORKSTN_BACKUP_COMPRESSION').' '.$compression.'
';
+ $out .= $c->l('bac_WORKSTN_BACKUP_TOD').' '.$backupwkTime.'
';
+ $out .= $c->l('bac_WORKSTN_BACKUP_TIMEOUT').' '.$backupwkTimeout.' '.$c->l('bac_HOURS');
+ if ( $backupwkIncOnlyTimeout eq 'yes' ) {
+ $out .= $c->l('bac_WORKSTN_BACKUP_INCONLY_TIMEOUT')
+ }
+ $out .= '
';
+
+ if ( $dof eq '7' ) {
+ $out .= $c->l('bac_WORKSTN_FULL_BACKUP_EVERYDAY').'
';
+ } else {
+ $out .= $c->l('bac_WORKSTN_FULL_BACKUP_DAY').' '.$dlabels[$dof].'
';
+ }
+ } else {
+ $out = $c->l('bac_WORKSTN_BACKUP_NOT_CONFIGURED');
+ }
+
+ return $out;
+}
+
+
+1;
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Bugreport.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Bugreport.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Bugreport.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Bugreport.pm 2020-03-29 00:58:37.000000000 +0400
@@ -1,5 +1,12 @@
package SrvMngr::Controller::Bugreport;
+#----------------------------------------------------------------------
+# heading : Miscellaneous
+# description : Report a bug
+# navigation : 7000 7300
+
+# routes : end
+#------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Clamav.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Clamav.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Clamav.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Clamav.pm 2020-03-29 00:59:33.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Clamav;
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : Antivirus (ClamAV)
+# navigation : 6000 6720
+#
+# routes : end
+#------------------------------
+
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Datetime.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Datetime.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Datetime.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Datetime.pm 2020-03-29 01:00:09.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Datetime;
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : Date and time
+# navigation : 6000 6100
+
+# routes : end
+#------------------------------
+
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Directory.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Directory.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Directory.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Directory.pm 2020-03-29 01:01:13.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Directory;
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : Directory
+# navigation : 6000 6300
+#
+# routes : end
+#----------------------------------------------------------------------
+
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Domains.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Domains.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Domains.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Domains.pm 2020-03-29 01:07:44.000000000 +0400
@@ -1,5 +1,12 @@
package SrvMngr::Controller::Domains;
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : DOMAINS
+# navigation : 6000 6600
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Emailsettings.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Emailsettings.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Emailsettings.pm 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Emailsettings.pm 2020-04-09 23:55:19.952000000 +0400
@@ -0,0 +1,967 @@
+package SrvMngr::Controller::Emailsettings;
+
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : E-mail
+# navigation : 6000 6700
+#
+#
+# routes : end
+#----------------------------------------------------------------------
+use strict;
+use warnings;
+use Mojo::Base 'Mojolicious::Controller';
+
+use Locale::gettext;
+use SrvMngr::I18N;
+
+use SrvMngr qw(theme_list init_session_cgi ip_number_or_blank);
+
+use esmith::ConfigDB;
+use esmith::AccountsDB;
+
+use esmith::util;
+use File::Basename;
+
+our $pattern_db = esmith::ConfigDB->open("mailpatterns");
+our $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
+
+
+sub main {
+
+ my $c = shift;
+ $c->app->log->info($c->log_req);
+
+ my %mai_datas = ();
+ my $title = $c->l('mai_FORM_TITLE');
+
+ $mai_datas{'trt'} = 'LIST';
+ $mai_datas{fetchmailmethod} = $cdb->get_prop('fetchmail', 'Method');
+
+ $c->stash( title => $title, notif => '', mai_datas => \%mai_datas );
+ $c->render(template => 'emailsettings');
+
+};
+
+
+sub do_display {
+
+ my $c = shift;
+
+ my $rt = $c->current_route;
+ my $trt = ($c->param('trt') || 'LIST');
+
+ my %mai_datas = ();
+ my $title = $c->l('mai_FORM_TITLE');
+ my ($notif, $dest) = '';
+
+ $mai_datas{'trt'} = $trt;
+
+ if ( $trt eq 'ACC' ) {
+ $dest = 'emailaccess';
+ $mai_datas{fetchmailmethod} = $cdb->get_prop('fetchmail', 'Method');
+ }
+
+ if ( $trt eq 'FIL' ) {
+ $dest = 'emailfilter';
+ $mai_datas{'virusstatus'} = $c->get_virus_status();
+ $mai_datas{'spamstatus'} = $cdb->get_prop('spamassassin', 'status');
+ $mai_datas{'spamsensitivity'} = $cdb->get_prop('spamassassin', 'Sensitivity','medium');
+ $mai_datas{'spamtaglevel'} = $cdb->get_prop('spamassassin', 'TagLevel') || '0';
+ $mai_datas{'spamrejectlevel'} = $cdb->get_prop('spamassassin', 'RejectLevel') || '0';
+ $mai_datas{spamsortspam} = $cdb->get_prop('spamassassin', 'SortSpam');
+ $mai_datas{spamsubjecttag} = $cdb->get_prop('spamassassin', 'SubjectTag');
+ $mai_datas{spamsubject} = $cdb->get_prop('spamassassin', 'Subject');
+ }
+
+ if ( $trt eq 'REC' ) {
+ $dest = 'emailreceive';
+ $mai_datas{fetchmailmethod} = $cdb->get_prop('fetchmail', 'Method');
+ $mai_datas{freqoffice} = $cdb->get_prop('fetchmail', 'FreqOffice');
+ $mai_datas{freqoutside} = $cdb->get_prop('fetchmail', 'FreqOutside');
+ $mai_datas{freqweekend} = $cdb->get_prop('fetchmail', 'FreqWeekend');
+ $mai_datas{secondarymailserver} = $cdb->get_prop('fetchmail', 'SecondaryMailServer');
+ $mai_datas{secondarymailaccount} = $cdb->get_prop('fetchmail', 'SecondaryMailAccount');
+ $mai_datas{secondarymailpassword} = $cdb->get_prop('fetchmail', 'SecondaryMailPassword');
+ $mai_datas{specifyheader} = get_secondary_mail_use_envelope();
+ $mai_datas{secondarymailenvelope} = $cdb->get_prop('fetchmail', 'SecondaryMailEnvelope');
+
+ }
+
+ if ( $trt eq 'DEL' ) {
+ $dest = 'emaildeliver';
+ $mai_datas{emailunknownuser} = $cdb->get_value('EmailUnknownUser') || '"returntosender';
+ $mai_datas{delegatemailserver} = $cdb->get_value('DelegateMailServer');
+ $mai_datas{smtpsmarthost} = $cdb->get_value('SMTPSmartHost');
+ $mai_datas{smtpauthproxystatus} = $cdb->get_prop('smtp-auth-proxy', 'status') || 'disabled';
+ $mai_datas{smtpauthproxyuserid} = $cdb->get_prop('smtp-auth-proxy', 'Userid') || '';
+ $mai_datas{smtpauthproxypassword} = $cdb->get_prop('smtp-auth-proxy', 'Passwd') || '';
+ }
+
+
+ $c->stash( title => $title, notif => $notif, mai_datas => \%mai_datas );
+ return $c->render( template => $dest );
+
+};
+
+
+sub do_update {
+
+ my $c = shift;
+ $c->app->log->info($c->log_req);
+
+ my $rt = $c->current_route;
+ my $trt = $c->param('trt');
+
+ my %mai_datas = ();
+ $mai_datas{trt} = $trt;
+
+ my $title = $c->l('mai_FORM_TITLE');
+
+ my ($dest, $res, $result) = '';
+
+ if ( $trt eq 'ACC' ) {
+
+ $dest = 'emailaccess';
+# $mai_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = xxxxxxx( $c );
+# $result .= $res unless $res eq 'OK';
+
+ if ( ! $result ) {
+ $res = $c->change_settings_access();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $mai_datas{trt} = 'SUC';
+ $result = $c->l('mai_SUCCESS');
+ }
+ }
+ }
+
+ if ( $trt eq 'FIL' ) {
+
+ $dest = 'emailfilter';
+# $mai_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = zzzzzz( $c );
+# $result .= $res unless $res eq 'OK';
+
+ if ( ! $result ) {
+ $res = $c->change_settings_filtering();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $mai_datas{trt} = 'SUC';
+ $result = $c->l('mai_SUCCESS');
+ }
+ }
+ }
+
+ if ( $trt eq 'REC' ) {
+
+ $dest = 'emailreceive';
+# $mai_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = yyyyyyyyy( $c );
+# $result .= $res unless $res eq 'OK';
+
+ if ( ! $result ) {
+ $res = $c->change_settings_reception();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $mai_datas{trt} = 'SUC';
+ $result = $c->l('mai_SUCCESS');
+ }
+ }
+ }
+
+ if ( $trt eq 'DEL' ) {
+
+ $dest = 'emaildeliver';
+# $mai_datas{xxx} = $c->param('XXX');
+
+ # controls
+ $res = $c->ip_number_or_blank( $c->param('DelegateMailServer') );
+ $result .= $res . ' DMS ' unless $res eq 'OK';
+
+ $res = $c->validate_smarthost( $c->param('SMTPSmartHost') );
+ $result .= $res . ' SH ' unless $res eq 'OK';
+
+ $res = $c->nonblank_if_smtpauth( $c->param('SMTPSmartHost') );
+ $result .= $res . ' SH ' unless $res eq 'OK';
+
+ $res = $c->nonblank_if_smtpauth( $c->param('SMTPAUTHPROXY_Userid') );
+ $result .= $res . ' USR ' unless $res eq 'OK';
+
+ $res = $c->nonblank_if_smtpauth( $c->param('SMTPAUTHPROXY_Passwd') );
+ $result .= $res . ' PWD ' unless $res eq 'OK';
+
+ if ( ! $result ) {
+ $res = $c->change_settings_delivery();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $mai_datas{trt} = 'SUC';
+ $result = $c->l('mai_SUCCESS');
+ }
+ }
+ }
+
+
+ $c->stash( title => $title, notif => $result, mai_datas => \%mai_datas );
+ if ($mai_datas{trt} ne 'SUC') {
+ return $c->render(template => $dest);
+ }
+ $c->redirect_to("/emailsettings");
+
+};
+
+
+sub get_virus_status {
+
+ my ($c, $localise) = @_;
+
+ my $status = $cdb->get_prop("qpsmtpd", 'VirusScan') || 'disabled';
+
+ return $localise ? $c->localise_status($status) : $status;
+}
+
+sub get_spam_status {
+
+ my ($c, $localise) = @_;
+
+ my $status = $cdb->get_prop('spamassassin', 'status') || 'disabled';
+
+ return $localise ? $c->localise_status($status) : $status;
+}
+
+
+sub localise_status {
+
+ my ($c, $status) = @_;
+
+ return $c->l($status eq 'enabled' ? $c->l('ENABLED') : $c->l('DISABLED'));
+}
+
+
+sub get_prop {
+
+ my ($c, $item, $prop, $default) = @_;
+
+ return $cdb->get_prop($item, $prop) || $default;
+}
+
+
+sub get_value {
+
+ my $c = shift;
+ my $item = shift;
+
+ return $cdb->get_value($item) || '';
+}
+
+
+sub get_emailunknownuser_status {
+
+ my ($c, $localise) = @_;
+
+ my $options = $c->get_emailunknownuser_options();
+
+ my $val = $cdb->get_value('EmailUnknownUser') || "returntosender";
+
+ return $localise ? $c->l($options->{$val}) : $val;
+}
+
+
+sub get_patterns_status {
+
+ my ($c, $localise) = @_;
+
+ my $status = $cdb->get_prop("qpsmtpd", 'PatternsScan') || 'disabled';
+
+ return $localise ? $c->localise_status($status) : $status;
+}
+
+
+sub adjust_patterns {
+
+ my $c = shift;
+
+ my @selected = @{$c->every_param('BlockExecutableContent')};
+
+ foreach my $pattern ( $pattern_db->get_all_by_prop( type => "pattern") )
+ {
+ my $status = (grep $pattern->key eq $_, @selected) ? 'enabled'
+ : 'disabled';
+ $pattern->set_prop('Status', $status);
+ }
+
+ $pattern_db->reload;
+
+ return scalar @selected;
+
+}
+
+
+sub get_current_pop3_access {
+
+ my ($c, $localise) = @_;
+
+ my $pop3Status = $cdb->get_prop('pop3', 'status') || 'enabled';
+ my $pop3Access = $cdb->get_prop('pop3', 'access') || 'private';
+
+ my $pop3sStatus = $cdb->get_prop('pop3s', 'status') || 'enabled';
+ my $pop3sAccess = $cdb->get_prop('pop3s', 'access') || 'private';
+
+ my $options = get_pop_options();
+
+ if ($pop3Status ne 'enabled' && $pop3sStatus ne 'enabled')
+ {
+ return $localise ? $c->l($options->{disabled}) : 'disabled';
+ }
+ elsif ($pop3Status eq 'enabled' && $pop3Access eq 'public')
+ {
+ return $localise ? $c->l($options->{public}) : 'public';
+ }
+ elsif ($pop3sStatus eq 'enabled' && $pop3sAccess eq 'public')
+ {
+ return $localise ? $c->l($options->{publicSSL}) : 'publicSSL';
+ }
+ return $localise ? $c->l($options->{private}) : 'private';
+}
+
+
+sub get_current_imap_access {
+
+ my ($c, $localise) = @_;
+
+ my $imapStatus = $cdb->get_prop('imap', 'status') || 'enabled';
+ my $imapAccess = $cdb->get_prop('imap', 'access') || 'private';
+
+ my $imapsStatus = $cdb->get_prop('imaps', 'status') || 'enabled';
+ my $imapsAccess = $cdb->get_prop('imaps', 'access') || 'private';
+
+ my $options = get_imap_options();
+
+ if (($imapStatus ne 'enabled' || $imapAccess eq 'localhost') && $imapsStatus ne 'enabled')
+ {
+ return $localise ? $c->l($options->{disabled}) : 'disabled';
+ }
+ if ($imapStatus eq 'enabled' && $imapAccess eq 'public')
+ {
+ return $localise ? $c->l($options->{public}) : 'public';
+ }
+ elsif ($imapsStatus eq 'enabled' && $imapsAccess eq 'public')
+ {
+ return $localise ? $c->l($options->{publicSSL}) : 'publicSSL';
+ }
+ return $localise ? $c->l($options->{private}) : 'private';
+}
+
+
+sub get_current_smtp_auth {
+
+ my ($c, $localise) = @_;
+
+ my $smtpStatus = $cdb->get_prop('qpsmtpd', 'status') || 'enabled';
+ my $smtpAuth = $cdb->get_prop('qpsmtpd', 'Authentication') || 'enabled';
+
+ my $smtpsStatus = $cdb->get_prop('sqpsmtpd', 'status') || 'enabled';
+ my $smtpsAuth = $cdb->get_prop('sqpsmtpd', 'Authentication') || 'enabled';
+
+ my $options = get_smtp_auth_options();
+
+ if ($smtpStatus eq 'enabled' && $smtpAuth eq 'enabled')
+ {
+ return $localise ? $c->l($options->{public}) : 'public';
+ }
+ elsif ($smtpsStatus eq 'enabled' && $smtpsAuth eq 'enabled')
+ {
+ return $localise ? $c->l($options->{publicSSL}) : 'publicSSL';
+ }
+ return $localise ? $c->l($options->{disabled}) : 'disabled';
+}
+
+
+sub get_current_webmail_status {
+
+ my ($c, $localise) = @_;
+
+ # determine status of webmail
+ my $WebmailStatus = "disabled";
+
+ my $IMPStatus = $cdb->get_prop('imp', 'status') || 'disabled';
+ my $SSLonly = $cdb->get_prop('imp', 'access') || 'disabled';
+
+ my $HordeStatus = $cdb->get_prop('horde', 'status') || 'disabled';
+
+ my $MysqlStatus = $cdb->get_prop('mariadb', 'status') || 'disabled';
+
+ my $PHPStatus = $cdb->get_prop('php', 'status') || 'disabled';
+
+ my $Networkaccess = $cdb->get_prop('horde','access') || 'disabled';
+
+ # all four components must be on for webmail to be working
+ if ( ( $IMPStatus eq "enabled" )
+ && ( $HordeStatus eq "enabled" )
+ && ( $MysqlStatus eq "enabled" )
+ && ( $PHPStatus eq "enabled" )
+ && ( $Networkaccess eq "public"))
+ {
+ $WebmailStatus = ( $SSLonly eq "SSL" ) ? "enabledSSL" : "enabled";
+ }
+
+ elsif ( ( $IMPStatus eq "enabled" )
+ && ( $HordeStatus eq "enabled" )
+ && ( $MysqlStatus eq "enabled" )
+ && ( $PHPStatus eq "enabled" )
+ && ( $Networkaccess eq "private" ))
+ {
+ $WebmailStatus = ( $SSLonly eq "SSL" ) ? "localnetworkSSL" : "enabled";
+ }
+
+ my $options = get_webmail_options();
+
+ return $localise ? $c->l($options->{$WebmailStatus})
+ : $WebmailStatus;
+
+}
+
+
+sub get_pop_opt {
+
+ my $c = shift;
+
+ return [[ $c->l('DISABLED') => 'disabled' ],
+ [ $c->l('NETWORKS_ALLOW_LOCAL') => 'private' ],
+ [ $c->l('mai_SECURE_POP3') => 'publicSSL' ],
+ [ $c->l('mai_INSECURE_POP3') => 'public' ]];
+
+}
+
+
+sub get_pop_options {
+
+ my $c = @_;
+
+ my %options = (
+ disabled => 'DISABLED',
+ private => 'NETWORKS_ALLOW_LOCAL',
+ publicSSL => 'mai_SECURE_POP3'
+ );
+
+ my $access = $cdb->get_prop('pop3', 'access') || 'private';
+
+ $options{public} = 'mai_INSECURE_POP3' if ($access eq 'public');
+
+ \%options;
+}
+
+
+sub get_imap_opt {
+
+ my $c = shift;
+
+ return [[ $c->l('DISABLED') => 'disabled' ],
+ [ $c->l('NETWORKS_ALLOW_LOCAL') => 'private' ],
+ [ $c->l('mai_SECURE_IMAP') => 'publicSSL' ],
+ [ $c->l('mai_INSECURE_IMAP') => 'public' ]];
+
+}
+
+
+sub get_imap_options {
+
+ my $c = shift;
+
+ my %options = (
+ disabled => 'DISABLED',
+ private => 'NETWORKS_ALLOW_LOCAL',
+ publicSSL => 'mai_SECURE_IMAP'
+ );
+
+ my $access = $cdb->get_prop('imap', 'access') || 'private';
+
+ $options{public} = 'mai_INSECURE_IMAP' if ($access eq 'public');
+
+ \%options;
+}
+
+
+sub get_smtp_auth_options {
+
+ my $c = shift;
+
+ my %options = ( disabled => 'DISABLED', publicSSL => 'mai_SECURE_SMTP', public => 'mai_INSECURE_SMTP');
+
+ \%options;
+}
+
+
+sub get_webmail_opt {
+
+ my $c = shift;
+
+ return [[ $c->l('DISABLED') => 'disabled' ],
+ [ $c->l('mai_ENABLED_SECURE_ONLY') => 'enabledSSL' ],
+ [ $c->l('mai_ONLY_LOCAL_NETWORK_SSL') => 'localnetworkSSL' ],
+ [ $c->l('mai_ENABLED_BOTH') => 'public' ]];
+
+}
+
+
+sub get_webmail_options {
+
+ my $c = shift;
+
+ my %options = (
+ disabled => 'DISABLED',
+ enabledSSL => 'mai_ENABLED_SECURE_ONLY',
+ localnetworkSSL => 'mai_ONLY_LOCAL_NETWORK_SSL' );
+
+ my $access = $cdb->get_prop('imp', 'access') || 'SSL';
+
+ $options{public} = 'ENABLED_BOTH' if ($access eq 'full');
+
+ \%options;
+}
+
+
+sub get_retrieval_opt {
+
+ my $c = shift;
+
+ return $cdb->get("SystemMode")->value eq "servergateway-private"
+ ? [ $c->l('mai_MULTIDROP') => 'multidrop']
+ : [[ $c->l('mai_STANDARD') => 'standard'],
+ [ $c->l('mai_ETRN') => 'etrn' ],
+ [ $c->l('mai_MULTIDROP') => 'multidrop']];
+}
+
+
+sub get_smtp_auth_opt {
+
+ my $c = shift;
+
+ return [[ $c->l('DISABLED') => 'disabled'],
+ [ $c->l('mai_SECURE_SMTP') => 'publicSSL'],
+ [ $c->l('mai_INSECURE_SMTP') => 'public']];
+}
+
+
+sub get_emailunknownuser_options {
+
+ my $c = shift;
+ my $accounts = esmith::AccountsDB->open_ro();
+ my %existingAccounts = ('admin' => $c->l("mai_FORWARD_TO_ADMIN"),
+ 'returntosender' => $c->l("mai_RETURN_TO_SENDER") );
+
+ foreach my $account ($accounts->get_all) {
+ next if $account->key eq 'everyone';
+ if ($account->prop('type') =~ /(user|group|pseudonym)/) {
+ $existingAccounts{$account->key} = $c->l("mai_FORWARD_TO") . " " . $account->key;
+ }
+ }
+ return(\%existingAccounts);
+}
+
+
+sub get_emailunknownuser_opt {
+
+ my $c = shift;
+ my $accounts = esmith::AccountsDB->open_ro();
+
+ my @existingAccounts = ([ $c->l("mai_FORWARD_TO_ADMIN") => 'admin'],
+ [ $c->l("mai_RETURN_TO_SENDER") => 'returntosender']);
+
+ foreach my $account ($accounts->get_all) {
+ next if $account->key eq 'everyone';
+ if ($account->prop('type') =~ /(user|group|pseudonym)/) {
+ push @existingAccounts, [ $c->l("mai_FORWARD_TO") . " " . $account->key => $account->key];
+ }
+ }
+ return(\@existingAccounts);
+}
+
+
+sub get_patterns_opt {
+
+ my $c = shift;
+ my @options;
+
+ foreach my $pattern ( $pattern_db->get_all_by_prop( type => "pattern" ) ) {
+ my %props = $pattern->props;
+ push @options, [ $props{'Description'} => $pattern->key ];
+ }
+ return \@options;
+}
+
+
+sub get_patterns_current_opt {
+
+ my $c = shift;
+ my @selected;
+
+ foreach my $pattern ( $pattern_db->get_all_by_prop( type => "pattern" ) ) {
+ my %props = $pattern->props;
+ push @selected, $pattern->key if ($props{'Status'} eq 'enabled');
+ }
+ return \@selected;
+}
+
+sub get_spam_level_options {
+
+ return [ 0..20 ];
+}
+
+
+sub get_spam_sensitivity_opt {
+
+ my $c = shift;
+
+ return [[ $c->l('mai_VERYLOW') => 'verylow' ],
+ [ $c->l('mai_LOW') => 'low' ],
+ [ $c->l('mai_MEDIUM') => 'medium' ],
+ [ $c->l('mai_HIGH') => 'high' ],
+ [ $c->l('mai_VERYHIGH') => 'veryhigh' ],
+ [ $c->l('mai_CUSTOM') => 'custom' ]];
+
+}
+
+
+sub fetchmail_freq {
+
+ my $c = shift;
+
+ return [[ $c->l('mai_NEVER') => 'never' ],
+ [ $c->l('mai_EVERY5MIN') => 'every5min' ],
+ [ $c->l('mai_EVERY15MIN') => 'every15min' ],
+ [ $c->l('mai_EVERY30MIN') => 'every30min' ],
+ [ $c->l('mai_EVERYHOUR') => 'everyhour' ],
+ [ $c->l('mai_EVERY2HRS') => 'every2hrs' ]];
+}
+
+
+sub display_multidrop {
+
+ my $status = $cdb->get_prop('fetchmail', 'status') || 'disabled';
+
+ # XXX FIXME - WIP
+ # Only display ETRN/multidrop settings if relevant
+ # To do this, we need an "Show ETRN/multidrop settings" button
+ # in standard mode.
+
+ # return ($status eq 'enabled');
+ return 1;
+}
+
+
+sub change_settings_reception {
+
+ my $c = shift;
+
+ my $FetchmailMethod = ( $c->param('FetchmailMethod') || 'standard' );
+
+ my $FetchmailFreqOffice = ( $c->param('FreqOffice') || 'every15min' );
+
+ my $FetchmailFreqOutside = ( $c->param('FreqOutside') || 'everyhour' );
+ my $FetchmailFreqWeekend = ( $c->param('FreqWeekend') || 'everyhour' );
+ my $SpecifyHeader = ( $c->param('SpecifyHeader') || 'off' );
+
+ my $fetchmail = $cdb->get('fetchmail') || $cdb->new_record( "fetchmail",
+ { type => "service", status => "disabled" } );
+
+ if ( $FetchmailMethod eq 'standard' ) {
+ $fetchmail->set_prop( 'status', 'disabled' );
+ $fetchmail->set_prop( 'Method', $FetchmailMethod );
+ }
+ else {
+ $fetchmail->set_prop( 'status', 'enabled' );
+ $fetchmail->set_prop( 'Method', $FetchmailMethod );
+ $fetchmail->set_prop( 'SecondaryMailServer',
+ $c->param('SecondaryMailServer') )
+ unless ( $c->param('SecondaryMailServer') eq '' );
+
+ $fetchmail->set_prop('FreqOffice', $FetchmailFreqOffice );
+ $fetchmail->set_prop('FreqOutside', $FetchmailFreqOutside );
+ $fetchmail->set_prop('FreqWeekend', $FetchmailFreqWeekend );
+ $fetchmail->set_prop('SecondaryMailAccount',
+ $c->param('SecondaryMailAccount') )
+ unless ( $c->param('SecondaryMailAccount') eq '' );
+
+ $fetchmail->set_prop( 'SecondaryMailPassword',
+ $c->param('SecondaryMailPassword') )
+ unless ( $c->param('SecondaryMailPassword') eq '' );
+
+ if ( $SpecifyHeader eq 'on' ) {
+ $fetchmail->merge_props(
+ 'SecondaryMailEnvelope' => $c->param('SecondaryMailEnvelope') );
+ }
+ else {
+ $fetchmail->delete_prop('SecondaryMailEnvelope');
+ }
+ }
+
+ my $smtpAuth = ($c->param('SMTPAuth') || 'public');
+ if ($smtpAuth eq 'public') {
+ $cdb->set_prop("qpsmtpd", "Authentication", "enabled" );
+ $cdb->set_prop("sqpsmtpd", "Authentication", "enabled" );
+ } elsif ($smtpAuth eq 'publicSSL') {
+ $cdb->set_prop("qpsmtpd", "Authentication", "disabled" );
+ $cdb->set_prop("sqpsmtpd", "Authentication", "enabled" );
+ } else {
+ $cdb->set_prop("qpsmtpd", "Authentication", "disabled" );
+ $cdb->set_prop("sqpsmtpd", "Authentication", "disabled" );
+ }
+
+ unless ( system( "/sbin/e-smith/signal-event", "email-update" ) == 0 )
+ {
+ return $c->l('mai_ERROR_UPDATING_CONFIGURATION');
+ }
+ return 'OK';
+}
+
+
+sub change_settings_delivery {
+
+ my ($c) = shift;
+
+ my $EmailUnknownUser = ($c->param('EmailUnknownUser') || 'returntosender');
+
+ $cdb->set_value('SMTPSmartHost', $c->param('SMTPSmartHost'));
+ $cdb->set_value('DelegateMailServer', $c->param('DelegateMailServer'));
+ $cdb->set_value('EmailUnknownUser', $EmailUnknownUser);
+
+ my $proxy = $cdb->get('smtp-auth-proxy');
+ my %props = $proxy->props;
+
+ for ( qw(Userid Passwd status) )
+ {
+ $props{$_} = $c->param("SMTPAUTHPROXY_$_");
+ }
+
+ $proxy->merge_props(%props);
+
+ unless ( system( "/sbin/e-smith/signal-event", "email-update" ) == 0 )
+ {
+ return $c->l('mai_ERROR_UPDATING_CONFIGURATION');
+ }
+ return 'OK';
+}
+
+
+sub change_settings_access {
+
+ my $c = shift;
+
+ my $pop3Access = ($c->param('POPAccess') || 'private');
+ if ($pop3Access eq 'disabled') {
+ $cdb->set_prop('pop3', "status", "disabled" );
+ $cdb->set_prop('pop3s', "status", "disabled" );
+ } else {
+ $cdb->set_prop('pop3', "status", "enabled" );
+ $cdb->set_prop('pop3s', "status", "enabled" );
+ }
+ if ($pop3Access eq 'public') {
+ $cdb->set_prop('pop3', "access", "public" );
+ $cdb->set_prop('pop3s', "access", "public" );
+ } elsif ($pop3Access eq 'publicSSL') {
+ $cdb->set_prop('pop3', "access", "private" );
+ $cdb->set_prop('pop3s', "access", "public" );
+ } else {
+ $cdb->set_prop('pop3', "access", "private" );
+ $cdb->set_prop('pop3s', "access", "private" );
+ }
+
+ my $imapAccess = ($c->param('IMAPAccess') || 'private');
+ if ($imapAccess eq 'disabled') {
+ $cdb->set_prop('imap', "status", "enabled" );
+ $cdb->set_prop('imap', "access", "localhost" );
+ $cdb->set_prop('imaps', "status", "disabled" );
+ } elsif ($imapAccess eq 'public') {
+ $cdb->set_prop('imap', "status", "enabled" );
+ $cdb->set_prop('imap', "access", "public" );
+ $cdb->set_prop('imaps', "status", "enabled" );
+ $cdb->set_prop('imaps', "access", "public" );
+ } elsif ($imapAccess eq 'publicSSL') {
+ $cdb->set_prop('imap', "status", "enabled" );
+ $cdb->set_prop('imap', "access", "private" );
+ $cdb->set_prop('imaps', "status", "enabled" );
+ $cdb->set_prop('imaps', "access", "public" );
+ } else {
+ $cdb->set_prop('imap', "status", "enabled" );
+ $cdb->set_prop('imap', "access", "private" );
+ $cdb->set_prop('imaps', "status", "enabled" );
+ $cdb->set_prop('imaps', "access", "private" );
+ }
+
+ #------------------------------------------------------------
+ # Set webmail state in configuration database, and access
+ # type for SSL
+ # PHP and MySQL should always be on, and are enabled by default
+ # We don't do anything with them here.
+ #------------------------------------------------------------
+
+ my $webmail = ($c->param('WebMail') || 'disabled');
+ if ( $webmail eq "enabled" ) {
+ $cdb->set_prop('php', "status", $webmail );
+ $cdb->set_prop('mariadb',"status", $webmail );
+ $cdb->set_prop('imp',"status", $webmail );
+ $cdb->set_prop('horde', "status", $webmail );
+ $cdb->set_prop('imp',"access", "full" );
+ $cdb->set_prop('horde',"access", "public" );
+ $cdb->set_prop('horde',"HttpsOnly", "no" );
+ }
+ elsif ( $webmail eq "enabledSSL" ) {
+ $cdb->set_prop('php',"status", "enabled" );
+ $cdb->set_prop('mariadb',"status", "enabled" );
+ $cdb->set_prop('imp',"status", 'enabled' );
+ $cdb->set_prop('horde',"status", 'enabled' );
+ $cdb->set_prop('imp',"access", "SSL" );
+ $cdb->set_prop('horde',"access", "public" );
+ $cdb->set_prop('horde',"HttpsOnly", "yes" );
+ }
+
+ elsif ( $webmail eq "localnetworkSSL" ) {
+ $cdb->set_prop('php',"status", "enabled" );
+ $cdb->set_prop('mariadb',"status", "enabled" );
+ $cdb->set_prop('imp',"status", 'enabled' );
+ $cdb->set_prop('horde',"status", 'enabled' );
+ $cdb->set_prop('imp',"access", "SSL" );
+ $cdb->set_prop('horde',"access", "private" );
+ $cdb->set_prop('horde',"HttpsOnly", "yes" );
+ }
+
+ else {
+ $cdb->set_prop('imp',"status", 'disabled' );
+ $cdb->set_prop('horde',"status", 'disabled' );
+ }
+
+ unless ( system( "/sbin/e-smith/signal-event", "email-update" ) == 0 ) {
+ return $c->l('mai_ERROR_UPDATING_CONFIGURATION');
+ }
+
+ return 'OK';
+}
+
+
+sub change_settings_filtering {
+
+ my $c = shift;
+
+ my $virus_status = ( $c->param('VirusStatus') || 'disabled' );
+ $cdb->set_prop("qpsmtpd", 'VirusScan', $virus_status);
+
+ for my $param ( qw(
+ status
+ Sensitivity
+ TagLevel
+ RejectLevel
+ SortSpam
+ Subject
+ SubjectTag) )
+ {
+ $cdb->set_prop('spamassassin', $param, $c->param("Spam$param"));
+ }
+
+ my $patterns_status = $c->adjust_patterns() ? 'enabled' : 'disabled';
+ $cdb->set_prop("qpsmtpd", 'PatternsScan', $patterns_status);
+
+ unless ( system( "/sbin/e-smith/signal-event", "email-update" ) == 0 )
+ {
+ return $c->l('mai_ERROR_UPDATING_CONFIGURATION');
+ }
+
+ return 'OK';
+
+}
+
+
+#sub blank_or_ip_number {
+
+# my ($c, $value) = @_;
+
+# return 'OK' unless (defined $value); # undef is blank
+# return 'OK' if ($value =~ /^$/); # blank is blank
+# return $c->call_fm_validation("ip_number",$value,''); # otherwise, validate the input
+
+#}
+
+
+sub nonblank_if_smtpauth {
+
+ my ($c, $value) = @_;
+
+ return "OK" unless ($c->param("SMTPAUTHPROXY_status") eq 'enabled');
+
+ return ($value =~ /\S+/) ? "OK" : $c->l('mai_VALIDATION_SMTPAUTH_NONBLANK');
+
+}
+
+
+sub get_secondary_mail_use_envelope {
+
+ my $use_envelope = $cdb->get_prop('fetchmail', 'SecondaryMailEnvelope');
+ if ( defined $use_envelope ) {
+ return ('on');
+ } else {
+ return ('off');
+ }
+}
+
+
+sub validate_smarthost {
+ my $fm = shift;
+ my $smarthost = shift;
+
+ return ('OK') if ( $smarthost =~ /^(\S+\.\S+)$/ );
+
+ return ('OK') if ( $smarthost eq '' );
+
+ return "INVALID_SMARTHOST";
+
+}
+
+
+1;
+
+
+__END__
+blank_or_ip_number
+change_settings_access
+change_settings_delivery
+change_settings_filtering
+change_settings_reception
+display_multidrop
+do_display
+do_update
+fetchmail_freq
+get_current_imap_access
+get_current_pop3_access
+get_current_smtp_auth
+get_current_webmail_status
+get_emailunknownuser_opt
+get_emailunknownuser_options
+get_emailunknownuser_status
+get_imap_opt
+get_imap_options
+get_patterns_current_opt
+get_patterns_opt
+get_patterns_status
+get_pop_opt
+get_pop_options
+get_prop
+get_retrieval_opt
+get_smtp_auth_opt
+get_smtp_auth_options
+get_spam_level_options
+get_spam_sensitivity_opt
+get_spam_status
+get_value
+get_virus_status
+get_webmail_opt
+get_webmail_options
+localise_status
+main
+nonblank_if_smtpauth
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Groups.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Groups.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Groups.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Groups.pm 2020-03-29 01:08:31.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Groups;
+#----------------------------------------------------------------------
+# heading : Collaboration
+# description : GROUPS
+# navigation : 2000 2200
+#----------------------------------------------------------------------
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
@@ -23,7 +31,7 @@
my %grp_datas = ();
my $title = $c->l('grp_FORM_TITLE');
- my $modul = '';
+ my $notif = '';
$grp_datas{trt} = 'LIST';
@@ -33,7 +41,7 @@
@groups = $adb->groups();
}
- $c->stash( title => $title, modul => $modul, grp_datas => \%grp_datas, groups => \@groups );
+ $c->stash( title => $title, notif => $notif, grp_datas => \%grp_datas, groups => \@groups );
$c->render(template => 'groups');
};
@@ -54,18 +62,15 @@
my %grp_datas = ();
my $title = $c->l('grp_FORM_TITLE');
- my $modul = '';
+ my $notif = '';
$grp_datas{'trt'} = $trt;
if ( $trt eq 'ADD' ) {
- my %users = @{gen_users_list( $c )};
-
- $c->stash( users => \%users );
-
}
+
if ( $trt eq 'UPD' ) {
my %members = ();
@@ -78,14 +83,13 @@
$grp_datas{description} = $rec->prop('Description') || '';
%members = @{gen_members_list( $c, $group )};
-
- %users = @{gen_users_list( $c )};
}
$c->stash( members => \%members, users => \%users );
}
+
if ( $trt eq 'DEL' ) {
my %members = ();
@@ -102,14 +106,12 @@
%ibays = @{gen_ibays_list($c, $group)};
}
- # $c->flash(message => 'Del display Group okkkkkkkkkkkk');
- # $c->app->log->info("members: " . $c->dumper(%members));
- # $c->app->log->info("ibays: " . $c->dumper(%ibays));
$c->stash( grp_datas => \%grp_datas, members => \%members, ibays => \%ibays );
}
+
if ( $trt eq 'LIST' ) {
my @groups;
if ($adb) {
@@ -120,7 +122,7 @@
}
- $c->stash( title => $title, modul => $modul, grp_datas => \%grp_datas );
+ $c->stash( title => $title, notif => $notif, grp_datas => \%grp_datas );
$c->render( template => 'groups' );
};
@@ -134,19 +136,21 @@
my $rt = $c->current_route;
my $trt = ($c->param('trt') || 'LIST');
- my $result = '';
+ my %grp_datas = ();
+ my $title = $c->l('grp_FORM_TITLE');
+ my ($res, $result) = '';
+ my $groupName = $c->param('groupName');
if ( $trt eq 'ADD' ) {
- my $groupName = $c->param('groupName');
my $groupDesc = $c->param('groupDesc');
- my @members = $c->param('groupMembers');
-
+ my @members = @{$c->every_param('groupMembers')};
+
+
my $members = join ( ",", @members );
- $c->app->log->info("members: " . $c->dumper($groupName) . " " .$c->dumper($groupDesc) . " " .$c->dumper(@members) . " " . $c->dumper($members));
# controls (validate ?????)
- my $res = validate_group( $c, $groupName );
+ $res = validate_group( $c, $groupName );
$result .= $res unless $res eq 'OK';
$res = validate_group_length( $c, $groupName );
@@ -166,8 +170,6 @@
$groupDesc, 'Members', $members
);
- $c->app->log->info("props: " . $c->dumper(%props));
-
if ( ! $result ) {
$adb->new_record( $groupName, \%props );
@@ -175,8 +177,6 @@
# Untaint groupName before use in system()
($groupName) = ($groupName =~ /^([a-z][\-\_\.a-z0-9]*)$/);
- #???$c->clear_params();
-
system("/sbin/e-smith/signal-event", "group-create", "$groupName") ==0
or $result .= $c->l('qgp_CREATE_ERROR')."\n";
@@ -184,14 +184,14 @@
if ( ! $result ) {
$result = $c->l('grp_CREATED_GROUP') . ' ' . $groupName;
+ $trt = 'SUC';
}
}
if ( $trt eq 'UPD' ) {
- my $groupName = $c->param('groupName');
my $groupDesc = $c->param('groupDesc');
- my @members = $c->param('groupMembers');
+ my @members = @{$c->every_param('groupMembers')};
my $members = join ( ",", @members );
# controls
@@ -204,16 +204,12 @@
if ( ! $result ) {
- # $c->app->log->info("groupName: " . $c->dumper($groupName) . " , " . $c->dumper($members). " << " . $c->dumper(@members));
-
$adb->get($groupName)->set_prop( 'Members', $members );
$adb->get($groupName)->set_prop( 'Description', $groupDesc );
# Untaint groupName before use in system()
($groupName) = ($groupName =~ /^([a-z][\-\_\.a-z0-9]*)$/);
- #???$c->clear_params();
-
system("/sbin/e-smith/signal-event", "group-modify", "$groupName") ==0
or $result .= $c->l('qgp_MODIFY_ERROR')."\n";
@@ -221,35 +217,39 @@
if ( ! $result ) {
$result = $c->l('grp_MODIFIED_GROUP') . ' ' . $groupName;
+ $trt = 'SUC';
}
}
if ( $trt eq 'DEL' ) {
-
- my $group = ($c->param ('group') || '');
- if ($group =~ /^([a-z][\-\_\.a-z0-9]*)$/) {
- $group = $1;
+ if ($groupName =~ /^([a-z][\-\_\.a-z0-9]*)$/) {
+ $groupName = $1;
} else {
- $result .= $c->l('grp_ERR_INTERNAL_FAILURE') . ':' . $group;
+ $result .= $c->l('grp_ERR_INTERNAL_FAILURE') . ':' . $groupName;
}
- my $rec = $adb->get($group);
- $result .= $c->l('grp_ERR_INTERNAL_FAILURE') . ':' . $group unless ($rec);
+ my $rec = $adb->get($groupName);
+ $result .= $c->l('grp_ERR_INTERNAL_FAILURE') . ':' . $groupName unless ($rec);
if ( ! $result ) {
- my $res = delete_group( $c, $group );
+ my $res = delete_group( $c, $groupName );
$result .= $res unless $res eq 'OK';
if ( ! $result ) {
- $result = $c->l('grp_DELETED_GROUP') . ' ' . $group;
+ $result = $c->l('grp_DELETED_GROUP') . ' ' . $groupName;
+ $trt = 'SUC';
}
}
}
- my $title = $c->l('grp_FORM_TITLE');
+ $grp_datas{'group'} = $groupName;
+ $grp_datas{'trt'} = $trt;
- $c->stash( title => $title, modul => $result );
- $c->render(template => 'module');
+ $c->stash( title => $title, notif => $result, grp_datas => \%grp_datas );
+ if ($grp_datas{trt} ne 'SUC') {
+ return $c->render(template => 'groups');
+ }
+ $c->redirect_to('/groups');
};
@@ -325,9 +325,8 @@
$names{$user->key} = $user->prop('FirstName') . " "
. $user->prop('LastName');
}
- @users = %names;
- return \@users;
+ return \%names;
}
@@ -346,6 +345,7 @@
=cut
+
sub validate_is_group () {
my $c = shift;
my $group = shift;
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Hostentries.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Hostentries.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Hostentries.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Hostentries.pm 2020-03-29 01:08:52.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Hostentries;
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : Hostnames and addresses
+# navigation : 6000 6500
+#----------------------------------------------------------------------
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Ibays.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Ibays.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Ibays.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Ibays.pm 2020-03-29 01:09:10.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Ibays;
+#----------------------------------------------------------------------
+# heading : Collaboration
+# description : Information bays
+# navigation : 2000 2500
+#
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial_ori.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial_ori.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial_ori.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial_ori.pm 1970-01-01 04:00:00.000000000 +0400
@@ -1,49 +0,0 @@
-package SrvMngr::Controller::Initial;
-
-use strict;
-use warnings;
-
-use Mojo::Base 'Mojolicious::Controller';
-
-use Locale::gettext;
-use SrvMngr::I18N;
-
-sub main {
- my $c = shift;
- $c->app->log->info($c->log_req);
-
- #SrvMngr->startsess();
- if ( not defined $c->session->{lang} ) {
- init_session( $c );
- }
-
- my $title = $c->l('initial_FORM_TITLE');
- my $modul = $c->render_to_string(inline => $c->l('initial_FRAMES_BODY'));
-
- $c->stash( title => $title, modul => $modul, nav => \%nav );
-
- $c->render(template => 'initial');
-
-}
-
-
-sub init_session {
- my $c = shift;
-
- $c->app->log->info("Init datas in welcome page.");
-
- my %datas = ();
- %datas = SrvMngr::Model::Main->init_data( %datas );
- $c->session->{lang} = $datas{'lang'};
- $c->session->{copyRight} = $c->l($datas{'copyRight'});
- $c->session->{releaseVersion} = $datas{'releaseVersion'};
- $c->session->{PwdSet} = $datas{'PwdSet'};
- $c->session->{Unsafe} = $datas{'Unsafe'};
- $c->session->{SystemName} = $datas{'SystemName'};
- $c->session->{DomainName} = $datas{'DomainName'};
- $c->languages($datas{'lang'});
-
-}
-
-
-1;
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Initial.pm 2020-03-29 01:02:15.000000000 +0400
@@ -1,5 +1,8 @@
package SrvMngr::Controller::Initial;
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Localnetworks.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Localnetworks.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Localnetworks.pm 2020-04-08 23:43:19.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Localnetworks.pm 2020-04-08 21:27:35.000000000 +0400
@@ -1,5 +1,12 @@
package SrvMngr::Controller::Localnetworks;
+#----------------------------------------------------------------------
+# heading : Security
+# description : Local networks
+# navigation : 5000 5300
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
@@ -280,6 +287,7 @@
}
else
{ my $simpleMask = esmith::util::computeLocalNetworkPrefix( $network, $networkMask );
- return (ret=>'ln_SUCCESS_NONSTANDARD_RANGE',vars=>"$network,$networkMask,$networkRouter,$totalHosts,$firstAddr,$lastAddr,$simpleMask");
+ return ($fm->render_to_string(inline => l('ln_SUCCESS_NONSTANDARD_RANGE',
+ vars=>"$network,$networkMask,$networkRouter,$totalHosts,$firstAddr,$lastAddr,$simpleMask")));
}
}
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Main.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Main.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Main.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Main.pm 2020-03-29 01:02:26.000000000 +0400
@@ -1,5 +1,8 @@
package SrvMngr::Controller::Main;
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Manual.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Manual.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Manual.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Manual.pm 2020-04-08 20:03:49.000000000 +0400
@@ -1,5 +1,8 @@
package SrvMngr::Controller::Manual;
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
@@ -7,7 +10,6 @@
use Locale::gettext;
use SrvMngr::I18N;
-
use SrvMngr qw(theme_list init_session_cgi);
@@ -18,9 +20,7 @@
my $title = $c->l('manual_FORM_TITLE');
my $modul = $c->render_to_string(inline => $c->l('manual_DESCRIPTION'));
- $c->stash( releaseVersion => $c->session->{releaseVersion}, copyRight => $c->session->{copyRight},
- PwdSet => $c->session->{PwdSet}, Unsafe => $c->session->{Unsafe},
- title => $title, modul => $modul);
+ $c->stash( title => $title, modul => $modul);
$c->render(template => 'manual');
}
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modsearch.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modsearch.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modsearch.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modsearch.pm 2020-03-29 01:02:58.000000000 +0400
@@ -1,5 +1,8 @@
package SrvMngr::Controller::Modsearch;
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modules.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modules.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modules.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Modules.pm 2020-03-29 01:03:09.000000000 +0400
@@ -7,6 +7,9 @@
use Locale::gettext;
use SrvMngr::I18N;
+#
+# routes : end
+#----------------------------------------------------------------------
use SrvMngr qw(theme_list init_session_cgi);
sub bugreport {
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Portforwarding.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Portforwarding.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Portforwarding.pm 2020-04-08 23:43:19.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Portforwarding.pm 2020-04-08 20:43:38.000000000 +0400
@@ -1,5 +1,12 @@
package SrvMngr::Controller::Portforwarding;
+#----------------------------------------------------------------------
+# heading : Security
+# description : Port forwarding
+# navigation : 5000 5400
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Printers.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Printers.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Printers.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Printers.pm 2020-03-29 01:10:06.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Printers;
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : Printers
+# navigation : 6000 6400
+#
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Proxy.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Proxy.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Proxy.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Proxy.pm 2020-03-29 01:10:21.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Proxy;
+#----------------------------------------------------------------------
+# heading : Security
+# description : Proxy settings
+# navigation : 5000 5500
+#----------------------------------------------------------------------
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Pseudonyms.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Pseudonyms.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Pseudonyms.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Pseudonyms.pm 2020-03-29 01:10:46.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Pseudonyms;
+#----------------------------------------------------------------------
+# heading : Collaboration
+# description : Pseudonyms
+# navigation : 2000 2400
+#----------------------------------------------------------------------
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Qmailanalog.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Qmailanalog.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Qmailanalog.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Qmailanalog.pm 2020-03-29 01:11:05.000000000 +0400
@@ -1,5 +1,12 @@
package SrvMngr::Controller::Qmailanalog;
+#----------------------------------------------------------------------
+# heading : Administration
+# description : Mail log file analysis
+# navigation : 4000 4500
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Quota.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Quota.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Quota.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Quota.pm 2020-03-29 01:11:21.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Quota;
+#----------------------------------------------------------------------
+# heading : Collaboration
+# description : Quotas
+# navigation : 2000 2300
+#----------------------------------------------------------------------
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Reboot.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Reboot.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Reboot.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Reboot.pm 2020-04-08 20:07:02.000000000 +0400
@@ -1,5 +1,12 @@
package SrvMngr::Controller::Reboot;
+#----------------------------------------------------------------------
+# heading : Administration
+# description : Reboot or shutdown
+# navigation : 4000 4700
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
@@ -9,15 +16,6 @@
use SrvMngr qw(theme_list init_session_cgi);
-#use esmith::util;
-#use File::Basename;
-#use Exporter;
-#use Carp;
-
-#our @EXPORT = qw( change_settings
-#);
-
-
sub main {
@@ -67,8 +65,8 @@
}
}
- #$c->stash( title => $title, modul => $result );
- #$c->render(template => 'module');
+ $c->stash( title => $title, modul => $result );
+ $c->render(template => 'module');
};
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Remoteaccess.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Remoteaccess.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Remoteaccess.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Remoteaccess.pm 2020-03-29 01:12:09.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Remoteaccess;
+#----------------------------------------------------------------------
+# heading : Security
+# description : Remote access
+# navigation : 5000 5200
+#----------------------------------------------------------------------
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Request.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Request.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Request.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Request.pm 2020-03-29 01:04:15.000000000 +0400
@@ -1,5 +1,8 @@
package SrvMngr::Controller::Request;
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Review.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Review.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Review.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Review.pm 2020-03-29 01:12:34.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Review;
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : Review configuration
+# navigation : 6000 6800
+#----------------------------------------------------------------------
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Starterwebsite.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Starterwebsite.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Starterwebsite.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Starterwebsite.pm 2020-03-29 01:12:49.000000000 +0400
@@ -1,5 +1,12 @@
package SrvMngr::Controller::Starterwebsite;
+#----------------------------------------------------------------------
+# heading : Miscellaneous
+# description : Create starter web site
+# navigation : 7000 7100
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Support.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Support.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Support.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Support.pm 2020-03-29 01:13:17.000000000 +0400
@@ -1,5 +1,12 @@
package SrvMngr::Controller::Support;
+#----------------------------------------------------------------------
+# heading : Miscellaneous
+# description : Support and licensing
+# navigation : 5000 5300
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Swttheme.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Swttheme.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Swttheme.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Swttheme.pm 2020-03-29 01:04:46.000000000 +0400
@@ -1,5 +1,8 @@
package SrvMngr::Controller::Swttheme;
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Useraccounts.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Useraccounts.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Useraccounts.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Useraccounts.pm 2020-03-29 01:13:36.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Useraccounts;
+#----------------------------------------------------------------------
+# heading : Collaboration
+# description : Users
+# navigation : 2000 2100
+#----------------------------------------------------------------------
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
@@ -780,7 +788,7 @@
$adb->create_user_auto_pseudonyms($acctName);
my @old_groups = $adb->user_group_list($acctName);
- my @new_groups = $c->param("groupMemberships");
+ my @new_groups = @{$c->every_param("groupMemberships")};
$c->app->log->info($c->dumper("groups: Old " . @old_groups .' New '. @new_groups));
@@ -819,7 +827,7 @@
or warn "Can't create new account for $acctName (does it already exist?)\n";
$acct->reset_props(%userprops);
$adb->create_user_auto_pseudonyms($acctName);
- my @groups = $c->param("groupMemberships");
+ my @groups = @{$c->every_param("groupMemberships")};
$adb->add_user_to_groups($acctName, @groups);
@@ -849,7 +857,8 @@
my $acctName = $c->param('user');
- my @groups = $c->param('groupMemberships');
+ my @groups = @{$c->every_param("groupMemberships")};
+
$adb->set_user_groups($acctName, @groups);
}
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Viewlogfiles.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Viewlogfiles.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Viewlogfiles.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Viewlogfiles.pm 2020-03-29 01:14:01.000000000 +0400
@@ -1,5 +1,13 @@
package SrvMngr::Controller::Viewlogfiles;
+#----------------------------------------------------------------------
+# heading : Administration
+# description : View log files
+# navigation : 4000 4400
+#
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Wbl.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Wbl.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Wbl.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Wbl.pm 2020-03-30 00:47:35.000000000 +0400
@@ -1,53 +1,87 @@
package SrvMngr::Controller::Wbl;
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : E-mail WBL
+# navigation : 6000 6710
+
+# name : wbl, method : get, url : /wbl, ctlact : wbl#main
+# name : wbldis, method : post, url : /wbl, ctlact : wbl#do_display
+# name : wblupc, method : get, url : /wbl2, ctlact : wbl#do_update
+# name : wblupd, method : post, url : /wbl2, ctlact : wbl#do_update
+#
+# routes : end
+#----------------------------------------------------------------------
+
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
-
use Locale::gettext;
use SrvMngr::I18N;
-use SrvMngr qw(theme_list init_session_cgi);
+use SrvMngr qw( theme_list init_session_cgi );
+
+use Exporter;
+our @EXPORT_OK = qw(
+ get_contrib_desc
+ get_contrib_routes
+ );
-####$locale->{namespace} = 'SrvMngr::I18N::Wbl';
+our $db = esmith::ConfigDB->open() or die "Couldn't open ConfigDB\n";
+our $wdb = esmith::ConfigDB->open('wbl') or die "Couldn't open wbl dbase\n";
+our $sdb = esmith::ConfigDB->open('spamassassin') or die "Couldn't open spamassassin dbase\n";
-#use esmith::FormMagick::Panel::wbl;
-use smeserver::Panel::wblNew;
+
+sub get_contrib_desc {
+ my $c = shift;
+ return { 'heading' => 'Configuration',
+ 'description' => 'E-mail WBL',
+ 'navigation' => '6000/6710' };
+}
+
+
+sub get_contrib_routes {
+ my $c = shift;
+ my @rt = (
+ { 'method' => 'get', 'url' => '/wbl', 'ctlact' => 'wbl#main', 'name' => 'wbl'},
+ { 'method' => 'post', 'url' => '/wbl', 'ctlact' => 'wbl#do_display', 'name' => 'wbldis'},
+ { 'method' => 'get', 'url' => '/wbl2', 'ctlact' => 'wbl#do_update', 'name' => 'wblupc'},
+ { 'method' => 'post', 'url' => '/wbl2', 'ctlact' => 'wbl#do_update', 'name' => 'wblupd'},
+ );
+ return \@rt;
+}
sub main {
+
my $c = shift;
$c->app->log->info($c->log_req);
my %wbl_datas = ();
my $title = $c->l('wbl_FORM_TITLE');
- my $modul = $c->l('wbl_WBL_DESCRIPTION');
$wbl_datas{'trt'} = 'CHOICE';
- my @wblList = ( [$c->l('wbl_RBL_LIST') => 'RBL'], [$c->l('wbl_BLACK_LIST') => 'BLACK'], [$c->l('wbl_WHITE_LIST') => 'WHITE'] );
- $c->stash( list => \@wblList );
- $c->stash( title => $title, modul => $modul, wbl_datas => \%wbl_datas);
- $c->render(template => 'wbl');
+ $c->stash( title => $title, wbl_datas => \%wbl_datas);
+ $c->render_maybe('wbl') or $c->render('wbl');
};
sub do_display {
+
my $c = shift;
+ $c->app->log->info($c->log_req);
- #my $button = $c->param('button');
my $trt = $c->param('list') || 'CHOICE';
my %wbl_datas = ();
my $title = $c->l('wbl_FORM_TITLE');
- my $modul = $c->l('wbl_WBL_DESCRIPTION');
$wbl_datas{'trt'} = $trt;
if ( $trt eq 'RBL' ) {
- # For RBL List
# dnsbl - returns 'enabled/disabled
$wbl_datas{'dnsbl'} = get_dnsbl();
@@ -56,91 +90,483 @@
# uribl - returns 'enabled/disabled
$wbl_datas{'uribl'} = get_uribl();
-
- # For SBLList List
- my @sbllist = get_sbllist();
- $c->stash( sbllist => \@sbllist );
-
- # For RBLList List
- my @rbllist = get_rbllist();
- $c->stash( rbllist => \@rbllist );
-
- # For URLList List
- my @ubllist = get_ubllist();
- $c->stash( ubllist => \@ubllist );
-
}
- if ( $trt eq 'BLACK' ) {
+ if ( $trt eq 'BLACK' ) {
# For Black List
- my @badhelo = get_badhelo();
- $c->stash( badhelo => \@badhelo );
-
- my @badmailfrom = get_badmailfrom();
- $c->stash( badmailfrom => \@badmailfrom );
-
- my @blacklistfrom = get_blacklistfrom();
- $c->stash( blacklistfrom => \@blacklistfrom );
-
}
- if ( $trt eq 'WHITE' ) {
+ if ( $trt eq 'WHITE' ) {
# For WBL List
- my @whitelistsenders = get_whitelistsenders();
- $c->stash( whitelistsenders => \@whitelistsenders );
-
- my @whitelisthelo = get_whitelisthelo();
- $c->stash( whitelisthelo => \@whitelisthelo );
-
- my @whitelisthosts = get_whitelisthosts();
- $c->stash( whitelisthosts => \@whitelisthosts );
-
- my @whitelistfrom = get_whitelistfrom();
- $c->stash( whitelistfrom => \@whitelistfrom );
-
}
if ( $trt eq 'CHOICE' ) {
- my @wblList = ( [$c->l('wbl_RBL_LIST') => 'RBL'], [$c->l('wbl_BLACK_LIST') => 'BLACK'],
- [$c->l('wbl_WHITE_LIST') => 'WHITE'] );
- $c->stash( list => \@wblList );
-
+ #
}
- $c->stash( title => $title, modul => $modul, wbl_datas => \%wbl_datas );
+ $c->stash( title => $title, wbl_datas => \%wbl_datas );
$c->render( template => 'wbl' );
};
sub do_update {
+
my $c = shift;
$c->app->log->info($c->log_req);
- my $result = "";
+ my %wbl_datas = ();
+ my ($res, $result) = "";
+
+ my $title = $c->l('wbl_FORM_TITLE');
my $trt = ($c->param('trt') || '???');
+ $wbl_datas{'trt'} = $trt;
#### $wbl_datas{'dnsbl'} = get_dnsbl(); etc...
if ($trt eq 'RBL') {
- $result .= 'RBL: ' . $c->l('wbl_ERROR_UPDATING') unless create_modify_rbl($c) == 0;
- }
- elsif ($trt eq 'BLACK') {
- $result .= 'BLACK: ' . $c->l('wbl_ERROR_UPDATING') unless create_modify_black($c) == 0;
- } elsif ($trt eq 'WHITE') {
- $result .= 'WHITE: ' . $c->l('wbl_ERROR_UPDATING') unless create_modify_white($c) == 0;
- } else {
- $result .= "Undefined form: $trt." . $c->l('wbl_ERROR_UPDATING');
+
+ # controls, validate
+ #if (xxx) {
+ # $result .= $c->l('XXXXXXX');
+ #}
+
+ ##$result .= ' ** Blocked for testing ** !';
+
+ if ( ! $result ) {
+ $res = $c->create_modify_rbl();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $wbl_datas{trt} = 'SUC';
+ $result = $c->l('SUCCESS').' RBL';
+ }
+ }
}
- my $title = $c->l('wbl_FORM_TITLE');
- if ( $result eq '' ) { $result = $c->l('wbl_SUCCESS') . " but System update NOT done !!!"; }
+ if ($trt eq 'BLACK') {
- $c->stash( title => $title, modul => $result );
- $c->render(template => 'module');
+ # controls, validate
+ #if (xxx) {
+ # $result .= $c->l('XXXXXXX');
+ #}
+
+ ##$result .= ' ** Blocked for testing ** !';
+
+ if ( ! $result ) {
+ $res = $c->create_modify_black();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $wbl_datas{trt} = 'SUC';
+ $result = $c->l('SUCCESS').' BLACK';
+ }
+ }
-};
+ }
+
+
+ if ($trt eq 'WHITE') {
+
+ # controls, validate
+ #if (xxx) {
+ # $result .= $c->l('XXXXXXX');
+ #}
+
+ ##$result .= ' ** Blocked for testing ** !';
+
+ if ( ! $result ) {
+ $res = $c->create_modify_white();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $wbl_datas{trt} = 'SUC';
+ $result = $c->l('SUCCESS').' WHITE';
+ }
+ }
+ }
+
+ # common part
+ $c->stash( title => $title, wbl_datas => \%wbl_datas );
+ if ($wbl_datas{trt} ne 'SUC') {
+ $c->flash(error => $result);
+ $wbl_datas{'trt'} = $trt;
+ return $c->render(template => 'wbl');
+ }
+
+ # successfully terminated
+ my $message = $trt . ' updates DONE';
+ $c->app->log->info($message);
+ $c->flash(success => $result);
+
+ #return to 'wbl' route !!!
+ $c->redirect_to('wbl');
+
+}
+
+
+sub get_dnsbl {
+ return ($db->get_prop('qpsmtpd', 'DNSBL') || 'disabled');
+}
+
+
+sub get_rhsbl {
+ return ($db->get_prop('qpsmtpd', 'RHSBL') || 'disabled');
+}
+
+
+sub get_uribl {
+ return ($db->get_prop('qpsmtpd', 'URIBL') || 'disabled');
+}
+
+
+sub get_sbllist {
+
+ my $sbllistform = $db->get_prop('qpsmtpd', 'SBLList') || '';
+ my @list = (split /,/, $sbllistform);
+ return \@list;
+}
+
+
+sub get_rbllist {
+
+ my $rbllistform = $db->get_prop('qpsmtpd', 'RBLList') || '';
+ my @list = (split /,/, $rbllistform);
+ return \@list;
+}
+
+
+sub get_ubllist {
+
+ my $ubllistform = $db->get_prop('qpsmtpd', 'UBLList') || '';
+ my @list = ($ubllistform);
+ return \@list;
+}
+
+
+sub get_wbllist {
+
+ my $c = shift;
+ return [[$c->l('wbl_RBL_LIST') => 'RBL'],
+ [$c->l('wbl_BLACK_LIST') => 'BLACK'],
+ [$c->l('wbl_WHITE_LIST') => 'WHITE']];
+}
+
+
+sub get_badhelo {
+
+ my %list = $wdb->get('badhelo')->props;
+
+ my @badhelo = ();
+ my ($parameter, $value) = "";
+ while (($parameter,$value) = each(%list)) {
+ next if ($parameter eq "type");
+ push @badhelo, $parameter if ($value eq "Black");
+ }
+ my @badh = sort(@badhelo);
+ return \@badh;
+}
+
+
+sub get_badmailfrom {
+
+ my %list = $wdb->get('badmailfrom')->props;
+
+ my @badmailfrom = ();
+ my ($parameter, $value) = "";
+ while (($parameter,$value) = each(%list)) {
+ next if ($parameter eq "type");
+ push @badmailfrom, $parameter if ($value eq "Black");
+ }
+ my @badmf = sort(@badmailfrom);
+ return \@badmf;
+}
+
+
+sub get_blacklistfrom {
+
+ my %list = $sdb->get('wbl.global')->props;
+
+ my @blacklistfrom = ();
+ my ($parameter, $value) = "";
+
+ while (($parameter,$value) = each(%list)) {
+ next if ($parameter eq "type");
+ push @blacklistfrom, $parameter if ($value eq "Black");
+ }
+ my @blacklf = sort(@blacklistfrom);
+ return \@blacklf;
+}
+
+
+sub get_whitelisthosts {
+
+ my %list = $wdb->get('whitelisthosts')->props;
+
+ my @whitelisthosts = ();
+ my ($parameter, $value) = "";
+
+ while (($parameter,$value) = each(%list)) {
+ next if ($parameter eq "type");
+ push @whitelisthosts, $parameter if ($value eq "White");
+ }
+ my @whitelh = sort(@whitelisthosts);
+ return \@whitelh;
+}
+
+
+sub get_whitelisthelo {
+
+ my %list = $wdb->get('whitelisthelo')->props;
+
+ my @whitelisthelo = ();
+ my ($parameter, $value) = "";
+
+ while (($parameter,$value) = each(%list)) {
+ next if ($parameter eq "type");
+ push @whitelisthelo, $parameter if ($value eq "White");
+ }
+ my @whitelh = sort(@whitelisthelo);
+ return \@whitelh;
+}
+
+
+sub get_whitelistsenders {
+
+ my %list = $wdb->get('whitelistsenders')->props;
+
+ my @whitelistsenders = ();
+ my ($parameter, $value) = "";
+
+ while (($parameter,$value) = each(%list)) {
+ next if ($parameter eq "type");
+ push @whitelistsenders, $parameter if ($value eq "White");
+ }
+ my @whitels = sort(@whitelistsenders);
+ return \@whitels;
+}
+
+
+sub get_whitelistfrom {
+
+ my %list = $sdb->get('wbl.global')->props;
+
+ my @whitelistfrom = ();
+ my ($parameter, $value) = "";
+
+ while (($parameter,$value) = each(%list)) {
+ next if ($parameter eq "type");
+ push @whitelistfrom, $parameter if ($value eq "White");
+ }
+ my @whitels = sort(@whitelistfrom);
+ return \@whitels;
+}
+
+
+sub create_modify_rbl {
+
+ my $c = shift;
+
+ my $dnsbl = $c->param('Dnsbl');
+ $db->set_prop('qpsmtpd', 'DNSBL', "$dnsbl");
+
+ my $rhsbl = $c->param('Rhsbl');
+ $db->set_prop('qpsmtpd', 'RHSBL', "$rhsbl");
+
+
+ my $sbllistcgi = $c->param('Sbllist');
+ my @sbllistcgi = split /\s{2,}/, $sbllistcgi;
+ my $sbllistdb = '';
+ foreach (@sbllistcgi) { $sbllistdb = $sbllistdb . ',' . $_; }
+ $sbllistdb =~ s/^,//;
+
+ $db->set_prop('qpsmtpd', 'SBLList', "$sbllistdb");
+
+ my $rbllistcgi = $c->param('Rbllist');
+ my @rbllistcgi = split /\s{2,}/, $rbllistcgi;
+ my $rbllistdb = '';
+ foreach (@rbllistcgi) { $rbllistdb = $rbllistdb . ',' . $_; }
+ $rbllistdb =~ s/^,//;
+
+ $db->set_prop('qpsmtpd', 'RBLList', "$rbllistdb");
+
+ #Update email settings
+ #unless ( system ("/sbin/e-smith/signal-event", "smeserver-wbl-update") == 0 ){
+ # return 'RBL : ' . $c->l('wbl_ERROR_UPDATING');
+ #}
+
+ return 'OK';
+}
+
+
+sub create_modify_black {
+
+ my $c = shift;
+
+ #-------------------------------
+ # qmail badhelo
+ #-------------------------------
+ my %list = $wdb->get('badhelo')->props;
+ my ($parameter, $value) = '';
+
+ while (($parameter,$value) = each(%list)) {
+ next if ($parameter eq "type");
+ if ($value eq "Black") {
+ $wdb->get_prop_and_delete('badhelo', "$parameter");
+ }
+ }
+
+ my $BadHelo = $c->param("Badhelo");
+ $BadHelo =~ s/\r\n/,/g;
+ my @BadHelo = sort(split /,/, $BadHelo);
+ foreach $BadHelo (@BadHelo) {
+ $wdb->set_prop('badhelo', "$BadHelo", 'Black');
+ }
+
+ #-------------------------------
+ # qmail badmailfrom
+ #-------------------------------
+ my %list_badmailfrom = $wdb->get('badmailfrom')->props;
+ my ($parameter_badmailfrom, $value_badmailfrom) = "";
+
+ while (($parameter_badmailfrom,$value_badmailfrom) = each(%list_badmailfrom)) {
+ next if ($parameter_badmailfrom eq "type");
+ if ($value_badmailfrom eq "Black") {
+ $wdb->get_prop_and_delete('badmailfrom', "$parameter_badmailfrom");
+ }
+ }
+
+ my $BadMailFrom = $c->param("Badmailfrom");
+ $BadMailFrom =~ s/\r\n/,/g;
+ my @BadMailFrom = sort(split /,/, $BadMailFrom);
+ foreach $BadMailFrom (@BadMailFrom){
+ $wdb->set_prop('badmailfrom', "$BadMailFrom", 'Black');
+ }
+ #-------------------------------
+ # spamassassin blacklist_from
+ #-------------------------------
+ my %list_wblglobal = $sdb->get('wbl.global')->props;
+ my ($parameter_wblglobal, $value_wblglobal) = "";
+
+ while (($parameter_wblglobal,$value_wblglobal) = each(%list_wblglobal)) {
+ next if ($parameter_wblglobal eq "type");
+ if ($value_wblglobal eq "Black") {
+ $sdb->get_prop_and_delete('wbl.global', "$parameter_wblglobal");
+ }
+ }
+
+ my $BlacklistFrom = $c->param("Blacklistfrom");
+ $BlacklistFrom =~ s/\r\n/,/g;
+ my @BlacklistFrom = sort(split /,/, $BlacklistFrom);
+ foreach $BlacklistFrom (@BlacklistFrom){
+ $sdb->set_prop('wbl.global', "$BlacklistFrom", 'Black');
+ }
+
+ #Update email settings
+ #unless ( system ("/sbin/e-smith/signal-event", "smeserver-wbl-update") == 0 ) {
+ # return 'BLACK: '. $c->l('wbl_ERROR_UPDATING');
+ #}
+
+ return 'OK';
+}
+
+
+sub create_modify_white {
+
+ my $c = shift;
+
+ #-------------------------------
+ # qpsmtpd whitelisthosts
+ #-------------------------------
+ my %list = $wdb->get('whitelisthosts')->props;
+ my $parameter = "";
+ my $value = "";
+ while (($parameter,$value) = each(%list)) {
+ if ($parameter eq "type") {next;}
+
+ if ($value eq "White") {
+ $wdb->get_prop_and_delete('whitelisthosts', "$parameter");
+ }
+ }
+
+ my $WhitelistHosts = $c->param("Whitelisthosts");
+ $WhitelistHosts =~ s/\r\n/,/g;
+ my @WhitelistHosts = sort(split /,/, $WhitelistHosts);
+ foreach $WhitelistHosts (@WhitelistHosts)
+ {
+ $wdb->set_prop('whitelisthosts', "$WhitelistHosts", 'White');
+ }
+
+ #-------------------------------
+ # qpsmtpd whitelisthelo
+ #-------------------------------
+ my %list_whitelisthelo = $wdb->get('whitelisthelo')->props;
+ my $parameter_whitelisthelo = "";
+ my $value_whitelisthelo = "";
+ while (($parameter_whitelisthelo,$value_whitelisthelo) = each(%list_whitelisthelo)) {
+ if ($parameter_whitelisthelo eq "type") {next;}
+
+ if ($value_whitelisthelo eq "White") {
+ $wdb->get_prop_and_delete('whitelisthelo', "$parameter_whitelisthelo");
+ }
+ }
+
+ my $WhitelistHelo = $c->param("Whitelisthelo");
+ $WhitelistHelo =~ s/\r\n/,/g;
+ my @WhitelistHelo = sort(split /,/, $WhitelistHelo);
+ foreach $WhitelistHelo (@WhitelistHelo)
+ {
+ $wdb->set_prop('whitelisthelo', "$WhitelistHelo", 'White');
+ }
+
+ #-------------------------------
+ # qpsmtpd whitelistsenders
+ #-------------------------------
+ my %list_whitelistsenders = $wdb->get('whitelistsenders')->props;
+ my $parameter_whitelistsenders = "";
+ my $value_whitelistsenders = "";
+ while (($parameter_whitelistsenders,$value_whitelistsenders) = each(%list_whitelistsenders)) {
+ if ($parameter_whitelistsenders eq "type") {next;}
+
+ if ($value_whitelistsenders eq "White") {
+ $wdb->get_prop_and_delete('whitelistsenders', "$parameter_whitelistsenders");
+ }
+ }
+
+ my $WhitelistSenders = $c->param("Whitelistsenders");
+ $WhitelistSenders =~ s/\r\n/,/g;
+ my @WhitelistSenders = sort(split /,/, $WhitelistSenders);
+ foreach $WhitelistSenders (@WhitelistSenders)
+ {
+ $wdb->set_prop('whitelistsenders', "$WhitelistSenders", 'White');
+ }
+
+ #-------------------------------
+ # spamassassin whitelist_from
+ #-------------------------------
+ my %list_wblglobal = $sdb->get('wbl.global')->props;
+ my $parameter_wblglobal = "";
+ my $value_wblglobal = "";
+ while (($parameter_wblglobal,$value_wblglobal) = each(%list_wblglobal)) {
+ if ($parameter_wblglobal eq "type") {next;}
+
+ if ($value_wblglobal eq "White") {
+ $sdb->get_prop_and_delete('wbl.global', "$parameter_wblglobal");
+ }
+ }
+
+ my $WhitelistFrom = $c->param("Whitelistfrom");
+ $WhitelistFrom =~ s/\r\n/,/g;
+ my @WhitelistFrom = sort(split /,/, $WhitelistFrom);
+ foreach $WhitelistFrom (@WhitelistFrom){
+ $sdb->set_prop('wbl.global', "$WhitelistFrom", 'White');
+ }
+
+ #Update email settings
+ #unless ( system ("/sbin/e-smith/signal-event", "smeserver-wbl-update") == 0 ) {
+ # return 'WHITE: '. $c->l('wbl_ERROR_UPDATING');
+ #}
+
+ return 'OK';
+}
1;
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Welcome.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Welcome.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Welcome.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Welcome.pm 2020-03-29 01:05:45.000000000 +0400
@@ -1,5 +1,8 @@
package SrvMngr::Controller::Welcome;
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Workgroup.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Workgroup.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Workgroup.pm 2020-04-08 23:43:15.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Workgroup.pm 2020-03-29 01:14:25.000000000 +0400
@@ -1,5 +1,12 @@
package SrvMngr::Controller::Workgroup;
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : Workgroup
+# navigation : 6000 6200
+#
+# routes : end
+#----------------------------------------------------------------------
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Yum.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Yum.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Yum.pm 1970-01-01 04:00:00.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/Controller/Yum.pm 2020-03-29 01:14:46.000000000 +0400
@@ -0,0 +1,601 @@
+package SrvMngr::Controller::Yum;
+
+#----------------------------------------------------------------------
+# heading : Configuration
+# description : Software installer
+# navigation : 4000 4200
+#
+# routes : end
+#----------------------------------------------------------------------
+use strict;
+use warnings;
+use Mojo::Base 'Mojolicious::Controller';
+
+use Locale::gettext;
+use SrvMngr::I18N;
+
+use SrvMngr qw(theme_list init_session_cgi ip_number_or_blank);
+
+use esmith::ConfigDB;
+use esmith::AccountsDB;
+
+use esmith::util;
+use File::Basename;
+
+our $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
+
+#use CGI::FormMagick::TagMaker;
+#use esmith::cgi;
+#use File::stat;
+
+our %dbs;
+
+for ( qw(available installed updates) )
+{
+ $dbs{$_} = esmith::ConfigDB->open_ro("yum_$_") or
+ die "Couldn't open yum_$_ DB\n";
+}
+
+for ( qw(repositories) )
+{
+ $dbs{$_} = esmith::ConfigDB->open("yum_$_") or
+ die "Couldn't open yum_$_ DB\n";
+}
+
+
+sub main {
+
+ my $c = shift;
+ $c->app->log->info($c->log_req);
+
+ my %yum_datas = ();
+ my $title = $c->l('yum_FORM_TITLE');
+ my $dest = 'yum';
+ my $notif = '';
+
+ $yum_datas{'trt'} = 'STAT';
+
+ if (-e "/var/run/yum.pid") {
+ $yum_datas{'trt'} = 'LOGF';
+ #$dest = 'yumlogfile';
+ $c->stash( title => $title, notif => $notif, yum_datas => \%yum_datas );
+ return $c->redirect_to("/yumd");
+ } elsif ($c->get_prop('yum', 'LogFile')) {
+ $yum_datas{'trt'} = 'PSTU';
+ #$dest = 'yumpostupg';
+ $c->stash( title => $title, notif => $notif, yum_datas => \%yum_datas );
+ return $c->redirect_to("/yumd");
+ } else {
+ # normal other trt
+ }
+
+ $c->stash( title => $title, notif => $notif, yum_datas => \%yum_datas );
+ return $c->render( template => $dest );
+
+}
+
+
+sub do_display {
+
+ my $c = shift;
+
+ my $rt = $c->current_route;
+ my $trt = ($c->param('trt') || 'STAT');
+
+ my %yum_datas = ();
+ my $title = $c->l('yum_FORM_TITLE');
+ my ($notif, $dest) = '';
+
+ $yum_datas{'trt'} = $trt;
+
+ if ( $trt eq 'UPDT' ) {
+ $dest = 'yumupdate';
+ }
+
+ if ( $trt eq 'INST' ) {
+ $dest = 'yuminstall';
+ }
+
+ if ( $trt eq 'REMO' ) {
+ $dest = 'yumremove';
+ }
+
+ if ( $trt eq 'CONF' ) {
+ $dest = 'yumconfig';
+ }
+
+ if ( $trt eq 'LOGF' ) {
+ if (-e "/var/run/yum.pid") {
+ $dest = 'yumlogfile';
+ }
+ }
+
+ if ( $trt eq 'PSTU') {
+ if ($c->get_prop('yum', 'LogFile')) {
+ $dest = 'yumpostupg';
+ }
+ }
+
+ if ( $dest eq '' ) { $dest = 'yum'; }
+
+ $c->stash( title => $title, notif => $notif, yum_datas => \%yum_datas );
+ return $c->render( template => $dest );
+
+};
+
+
+sub do_update {
+
+ my $c = shift;
+ $c->app->log->info($c->log_req);
+
+ my $rt = $c->current_route;
+ my $trt = $c->param('trt');
+
+ my %yum_datas = ();
+ $yum_datas{trt} = $trt;
+
+ my $title = $c->l('yum_FORM_TITLE');
+
+ my ($dest, $res, $result) = '';
+
+ if ( $trt eq 'UPDT' ) {
+
+ $dest = 'yumupdate';
+# $yum_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = xxxxxxx( $c );
+# $result .= $res unless $res eq 'OK';
+
+ #$result .= 'Blocked for testing !';
+
+ if ( ! $result ) {
+ $res = $c->do_yum('update');
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $yum_datas{trt} = 'SUC';
+ $result = $c->l('yum_SUCCESS');
+ }
+ }
+ }
+
+ if ( $trt eq 'INST' ) {
+
+ $dest = 'yuminstall';
+# $yum_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = zzzzzz( $c );
+# $result .= $res unless $res eq 'OK';
+
+ #$result .= 'Blocked for testing !';
+
+ if ( ! $result ) {
+ $res = $c->do_yum('install');
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $yum_datas{trt} = 'SUC';
+ $result = $c->l('yum_SUCCESS');
+ }
+ }
+ }
+
+ if ( $trt eq 'REMO' ) {
+
+ $dest = 'yumremove';
+# $yum_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = yyyyyyyyy( $c );
+# $result .= $res unless $res eq 'OK';
+
+ #$result .= 'Blocked for testing !';
+
+ if ( ! $result ) {
+ $res = $c->do_yum('config');
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $yum_datas{trt} = 'SUC';
+ $result = $c->l('yum_SUCCESS');
+ }
+ }
+ }
+
+ if ( $trt eq 'CONF' ) {
+
+ $dest = 'yumconfig';
+# $yum_datas{xxx} = $c->param('XXX');
+
+ # controls
+# $res = $c->zzzz( $c->param('ZZZZ') );
+# $result .= $res . ' DMS ' unless $res eq 'OK';
+
+# $result .= 'Blocked for testing !';
+
+ if ( ! $result ) {
+ $res = $c->change_settings();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $yum_datas{trt} = 'SUC';
+ $result = $c->l('yum_SUCCESS');
+ }
+ }
+ }
+
+
+ if ( $trt eq 'PSTU') {
+
+ $dest = 'yumpostupg';
+ $res = $c->post_upgrade_reboot();
+ $result .= $res unless $res eq 'OK';
+ if ( ! $result ) {
+ $yum_datas{trt} = 'SUC';
+ $result = $c->l('yum_SYSTEM_BEING_RECONFIGURE');
+ }
+ }
+
+
+ if ( $trt eq 'LOGF' ) {
+
+ $dest = 'yumlogfile';
+ if ( ! -e "/var/run/yum.pid") {
+ $yum_datas{trt} = 'SUC';
+ }
+ }
+
+
+
+ $c->stash( title => $title, notif => $result, yum_datas => \%yum_datas );
+ if ($yum_datas{trt} ne 'SUC') {
+ return $c->render(template => $dest);
+ }
+ $c->redirect_to("/yum");
+
+};
+
+
+sub get_prop {
+ my ($c, $item, $prop, $default) = @_;
+ warn "You must specify a record key" unless $item;
+ warn "You must specify a property name" unless $prop;
+ my $record = $cdb->get($item) or warn "Couldn't get record for $item";
+ my $value = $record ? $record->prop($prop) : undef;
+ return defined $value ? $value : $default;
+}
+
+
+sub get_value {
+ my ($c,$item,$default) = @_;
+ my $record = $cdb->get($item) or warn "Couldn't get record for $item";
+ my $value = $record ? $record->value() : undef;
+ return defined $value ? $value : $default;
+}
+
+
+sub is_empty {
+
+ my ($c, $yumdb) = @_;
+
+ my $groups = $dbs{$yumdb}->get_all_by_prop(type => 'group') || 'none';
+ my $packages = $dbs{$yumdb}->get_all_by_prop(type => 'package') || 'none';
+
+ #Show no updates if both = none
+ return 1 if ($packages eq $groups);
+
+ #else return here
+ return;
+}
+
+
+sub non_empty {
+
+ my ($c, $yumdb, $type) = @_;
+
+ $type ||= 'both';
+
+ return 0 unless (exists $dbs{$yumdb});
+
+ my $groups = scalar $dbs{$yumdb}->get_all_by_prop(type => 'group');
+ return $groups if ($type eq 'group');
+
+ my $packages = scalar $dbs{$yumdb}->get_all_by_prop(type => 'package');
+ if ($type eq 'package')
+ {
+ return $c->package_functions_enabled ? $packages : 0;
+ }
+
+ return ($c->package_functions_enabled or $yumdb eq 'updates') ?
+ ($groups || $packages) : $groups;
+}
+
+
+sub package_functions_enabled {
+
+ my ($c) = @_;
+
+ return ($cdb->get_prop("yum", "PackageFunctions") eq "enabled");
+
+}
+
+
+sub get_status {
+
+ my ($c, $prop, $localise) = @_;
+
+ my $status = $cdb->get_prop("yum", $prop) || 'disabled';
+
+ return $status unless $localise;
+
+ return $c->l($status eq 'enabled' ? 'ENABLED' : 'DISABLED');
+}
+
+
+sub get_options {
+
+ my ($c, $yumdb, $type) = @_;
+
+ my %options;
+
+ for ($dbs{$yumdb}->get_all_by_prop(type => $type))
+ {
+ $options{$_->key} = $_->key . " " . $_->prop("Version") . " - " .
+ $_->prop("Repo");
+ }
+
+ return \%options;
+}
+
+
+sub get_options2 {
+
+ my ($c, $yumdb, $type) = @_;
+
+ my @options;
+
+ for ($dbs{$yumdb}->get_all_by_prop(type => $type))
+ {
+ push @options, [ $_->key . " " . $_->prop("Version") . " - " .
+ $_->prop("Repo") => $_->key ];
+ }
+
+ return \@options;
+}
+
+
+sub get_names {
+
+ return [ keys %{get_options(@_)} ];
+}
+
+
+sub get_names2 {
+
+ my ($c, $yumdb, $type) = @_;
+ my @selected;
+
+ for ($dbs{$yumdb}->get_all_by_prop(type => $type)) {
+ push @selected, $_->key;
+ }
+
+ return \@selected;
+# return [ values @{get_options2(@_)} ];
+}
+
+
+sub get_repository_options2 {
+
+ my $c = shift;
+
+ my @options;
+
+ foreach my $repos (
+ $dbs{repositories}->get_all_by_prop(type => "repository") )
+ {
+ next unless ($repos->prop('Visible') eq 'yes'
+ or $repos->prop('status') eq 'enabled');
+
+ push @options, [ $repos->prop('Name') => $repos->key ];
+ }
+
+ my @opts = sort { $a->[0] cmp $b->[0] } @options;
+
+ return \@opts;
+}
+
+
+sub get_repository_current_options
+{
+ my $c = shift;
+
+ my @selected;
+
+ foreach my $repos (
+ $dbs{repositories}->get_all_by_prop( type => "repository" ) )
+ {
+ next unless ($repos->prop('Visible') eq 'yes'
+ or $repos->prop('status') eq 'enabled');
+
+ push @selected, $repos->key if ($repos->prop('status') eq 'enabled');
+ }
+
+ return \@selected;
+}
+
+
+sub get_avail2 {
+
+ my ($c, $yumdb, $type) = @_;
+
+ return $c->get_options2("available", "package");
+}
+
+
+sub get_check_freq_opt {
+
+ my ($c) = @_;
+
+ return [[ $c->l('DISABLED') => 'disabled'],
+ [ $c->l('yum_1DAILY') => 'daily'],
+ [ $c->l('yum_2WEEKLY') => 'weekly'],
+ [ $c->l('yum_3MONTHLY') => 'monthly']];
+}
+
+
+sub print_skip_header {
+
+ my ($c) = shift;
+
+ return "\n";
+}
+
+
+sub change_settings {
+
+ my ($c) = @_;
+
+ for my $param ( qw(
+ PackageFunctions
+ ) )
+ {
+ $cdb->set_prop('yum', $param, $c->param("yum_$param"));
+ }
+
+ my $check4updates = $c->param("yum_check4updates");
+ my $status = 'disabled';
+
+ if ($check4updates ne 'disabled') { $status = 'enabled'; }
+
+ $cdb->set_prop('yum', 'check4updates', $check4updates);
+
+ my $deltarpm = $c->param("yum_DeltaRpmProcess");
+ $cdb->set_prop('yum', 'DeltaRpmProcess', $deltarpm);
+
+ my $downloadonly = $c->param("yum_DownloadOnly");
+ if ($downloadonly ne 'disabled') { $status = 'enabled'; }
+
+ $cdb->set_prop('yum', 'DownloadOnly', $downloadonly);
+
+ my $AutoInstallUpdates = $c->param("yum_AutoInstallUpdates");
+ if ($AutoInstallUpdates ne 'disabled') { $status = 'enabled'; }
+
+ $cdb->set_prop('yum', 'AutoInstallUpdates', $AutoInstallUpdates);
+ $cdb->set_prop('yum', 'status', $status);
+
+ my %selected = map {$_ => 1} @{$c->every_param('SelectedRepositories')};
+
+ foreach my $repos (
+ $dbs{repositories}->get_all_by_prop(type => "repository") )
+ {
+ $repos->set_prop("status",
+ exists $selected{$repos->key} ? 'enabled' : 'disabled');
+
+ }
+
+ $dbs{repositories}->reload;
+
+ unless ( system( "/sbin/e-smith/signal-event", "yum-modify" ) == 0 )
+ {
+ return $c->l('yum_ERROR_UPDATING_CONFIGURATION');
+ }
+
+ return 'OK';
+}
+
+
+sub do_yum {
+
+ my ($c, $function) = @_;
+
+ for ( qw(SelectedGroups SelectedPackages) )
+ {
+ $cdb->set_prop("yum", $_, join(',', (@{$c->every_param($_)} )));
+ }
+
+ esmith::util::backgroundCommand(0,
+ "/sbin/e-smith/signal-event", "yum-$function");
+
+ $cdb->reload;
+
+ return 'OK';
+}
+
+
+sub get_yum_status_page {
+
+ my ($c) = @_;
+
+ my $yum_status;
+
+ open(YUM_STATUS, ";
+ close(YUM_STATUS);
+
+ return $yum_status;
+
+}
+
+
+sub show_file_page {
+
+ my ($c, $filepage) = @_;
+
+ return '' unless ( $filepage and ( -e "$filepage" ) );
+
+ my $out .= sprintf "";
+
+ open (FILE, "$filepage");
+ while (
";
+
+ return $out;
+}
+
+
+sub format_yum_log {
+
+ my ($c) = @_;
+
+ my $yum_log = $cdb->get_prop('yum', 'LogFile');
+
+ return $c->show_file_page($yum_log);
+
+}
+
+
+sub post_upgrade_reboot {
+
+ my $c = shift;
+
+ $cdb->get_prop_and_delete('yum', 'LogFile');
+ $cdb->reload;
+
+ if (fork == 0) {
+ exec "/sbin/e-smith/signal-event post-upgrade; /sbin/e-smith/signal-event reboot";
+ die "Exec failed";
+ }
+
+ return 'OK'
+}
+
+
+sub show_yum_log {
+
+ my $c = shift;
+
+ my $out = $c->format_yum_log();
+
+ my $yum_log = $cdb->get_prop_and_delete('yum', 'LogFile');
+
+ return $out;
+}
+
+
+1;
+
+
+__END__
diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/en.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/en.pm
--- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/en.pm 2020-04-08 23:43:19.000000000 +0400
+++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/en.pm 2020-04-11 12:54:11.001000000 +0400
@@ -144,6 +144,7 @@
'FM_MAC_ADDRESS2' => 'The MAC address you provided was not valid.',
'FM_ERR_UNEXPECTED_DESC' => 'Error: unexpected or missing characters in description',
+
initial_FORM_TITLE => 'Welcome to the server manager',
initial_FRAMES_BODY => '
To create a simple web page for your company, fill in the fields below and click on Create. -
-+
You can leave any field blank if you do not need it. -
-+
The text that you enter below will be line wrapped for a nicer appearance in your web page. Leave a blank line whenever you want to start a new paragraph. If you need @@ -234,13 +238,11 @@ the four-character sequence
<BR>where you would like each line break. - -
+
Do not use this option if you have already customized your web site, since it will overwrite the "index.htm" file in your web site directory. -
-', +', 'sws_LABEL_COMPANYNAME' => 'Company name', 'sws_DESC_HEADER1' => 'First header, typically used for short phrases such as "Leader in the field of textile manufacturing"', @@ -256,6 +258,7 @@Do you wish to proceed?
', 'sws_Create starter web site' => 'Create starter web site', + 'clm_FORM_TITLE' => 'Antivirus settings', 'clm_LABEL_FILESYSTEM_SCAN_PERIOD' => 'Scan filesystem', 'clm_DESC_FILESYSTEM_SCAN_PERIOD' => 'Analysing the mail system log files can aid both in understanding how your system is performing and in @@ -595,6 +608,7 @@ 'qma_END_OF_REPORT' => 'End of Report', 'qma_Mail log file analysis' => 'Mail log file analysis', + 'quo_FORM_TITLE' => 'Create, modify, or remove user account quotas', 'quo_UNABLE_TO_OPEN_ACCOUNTS' => 'Unable to open accounts db', 'quo_QUOTA_DESC' => '
You can set filesystem quotas for users on your system by clicking @@ -634,6 +648,7 @@ 'quo_SUCCESSFULLY_MODIFIED' => 'Successfully modified quota for user account: ', 'quo_Quotas' => 'Quotas', + 'grp_FORM_TITLE' => 'Create, modify, or remove user groups', 'grp_GROUP_TOO_LONG' => 'Error: group name is too long. The maximum is [_1] characters.', 'grp_ACCOUNT_CONFLICT' => 'Error: the group "[_1]" can\'t be created because there is @@ -665,6 +680,7 @@ 'grp_CURRENT_LIST' => 'Current list of User Groups', 'grp_DELETE_DESCRIPTION' => 'You are about to remove the user group "[_1]."', + 'rbo_FORM_TITLE' => 'Shutdown or reboot', 'rbo_REBOOT' => 'Reboot', 'rbo_REBOOT_SUCCEEDED' => 'Reboot request initiated successfully.', @@ -683,6 +699,7 @@ When you click perform the operation will be initiated immediately, so be ready!', 'rbo_Reboot or shutdown' => 'Reboot or shutdown', + 'iba_FORM_TITLE' => 'Create, modify, or remove i-bays', 'iba_ADD_IBAY' => 'Add ibay', 'iba_FIRSTPAGE_DESC' => 'You can remove any information bay or reset its password by @@ -709,12 +726,9 @@ 'iba_ALLOW_DYNAMIC_CONTENT' => 'Execution of dynamic content (CGI, PHP, SSI)', 'iba_HTTPS_Only' => 'Force secure connections', 'iba_REMOVE_TITLE' => 'Remove information bay', -'iba_REMOVE_DESC' => '
-You are about to remove the information bay [_1] ([_2]). -
-All files belonging to this information bay will be deleted. -
-Are you sure you wish to remove this information bay? +'iba_REMOVE_DESC' => '
You are about to remove the information bay [_1] ([_2]). +
All files belonging to this information bay will be deleted. +
Are you sure you wish to remove this information bay?
', 'iba_ERROR_WHILE_CREATING_IBAY' => 'An error occurred while creating the i-bay.', 'iba_SUCCESSFULLY_CREATED_IBAY' => 'Successfully created i-bay.', @@ -757,8 +771,10 @@[_1] is a pseudonym for [_2].
', 'iba_ACCOUNT_EXISTS' => 'The account "[_1]" is an existing [_2] account.', + 'swt_THEME' => 'Theme', + 'pse_NO_PSEUDONYMS' => ' There are no pseudonyms in the system. ', 'pse_REMOVE_PSEUDONYM' => 'Remove pseudonym', 'pse_ABOUT_TO_REMOVE' => 'You are about to remove the pseudonym: [_1]The first method creates a copy of your server configuration and user data files, and downloads it to your local desktop via your web browser. Currently your configuration and data files total approximately -$tarsize. The backup file will be somewhat less than this, +[_1]. The backup file will be somewhat less than this, depending on how compressible the data are. The \"Verify desktop backup file\" option can be used to check the integrity of a desktop backup file.
-The tape backup method uses a software package called $module +
The tape backup method uses a software package called [_2] to back up your entire hard disk to tape every night. This requires a supported tape drive and a tape that is not write-protected. The backup is performed automatically at the selected time every night (with a reminder automatically e-mailed to the administrator during the day). -Currently your hard disk contains $dumpsize of data.
+Currently your hard disk contains [_3] of data.Both restore methods allow you to restore your configuration and user data files. Ideally, the restore should be performed on a freshly installed server.
', 'bac_BACKUP_DESC_DAR' => 'Three ways are provided to back up and restore your server: using a tape drive, using a network share or a local removable disk, or using your local desktop.
-Tape Backup. This method uses a software package called $module +
Tape Backup. This method uses a software package called [_1] to back up your entire hard disk to tape every night. This requires a supported tape drive and a tape that is not write-protected. The backup is performed automatically at the selected time every night (with a reminder automatically e-mailed to the administrator during the day). -Currently your hard disk contains $dumpsize of data.
+Currently your hard disk contains [_2] of data.Workstation backup. This method uses a software package called dar to back up your server configuration and data files to a network share or a local removable disk such as a USB disk. You can manage how many rotating sets of backups are kept, and how many incremental backups to have in each set. The backup is performed automatically at the selected time every day. Currently -configuration and data files total approximately $tarsize uncompressed. +configuration and data files total approximately [_3] uncompressed. Twice the compressed data size must be available on the backup share.
Backup to Desktop. This method creates a copy of your server configuration and user data files, and downloads it to your local desktop via your web browser. Currently your configuration and data files total approximately -$tarsize. The backup file will be somewhat less than this, +[_3]. The backup file will be somewhat less than this, depending on how much the data can be compressed. This file can be used to restore the server from the console if you copy it to a local removable disk such as a USB disk.
@@ -1052,10 +1071,9 @@ data files. Workstation backup provides individual file restore. Ideally, full restore should be performed on a freshly installed server.', 'bac_BACKUP_CONFIG_STATUS' => 'Backup configuration and status', -'bac_TAPE_BACKUPS_ENABLED' => 'Tape backups are currently enabled.', 'bac_BACKUPS_RUN_AT' => 'Regular tape backups will run at: ', 'bac_REMINDER_MESSAGE_AT' => 'Reminder messages will be sent at: ', -'bac_TAPE_BACKUPS_DISABLED' => 'Tape backups are disabled', +'bac_TAPE_BACKUPS' => 'Tape backups are ', 'bac_DESKTOP_BACKUP' => 'Backup to desktop', 'bac_DESKTOP_RESTORE' => 'Restore from desktop', 'bac_DESKTOP_VERIFY' => 'Verify desktop backup file', @@ -1077,8 +1095,8 @@ 'bac_ERR_POST_BACKUP' => 'Error occurred during post-backup actions.', 'bac_RESTORE_SERVER_CONFIG' => 'Restore server configuration', 'bac_DESKTOP_RESTORE_DESC' => 'This process will upload a server backup file from your local desktop to your server and restore the configuration and user data files. The restore should be performed on a freshly installed server.', -'bac_FREE_SPACE' => 'You have approximately $tmpfree free space on the server. -Check that desktop backup file is less than $halffree before +'bac_FREE_SPACE' => 'You have approximately [_1] free space on the server. +Check that desktop backup file is less than [_2] before commencing the restore.', 'bac_MUST_REBOOT_AFTER_RESTORE' => 'After the restore completes you must reboot the server.', 'bac_FILE_TO_RESTORE' => 'Backup file to restore from', @@ -1093,8 +1111,7 @@ 'bac_ANOTHER_RESTORE_IN_PROGRESS' => 'Another restore is in progress. Please try again later.', 'bac_RESTORE_IN_PROGRESS' => 'Restore in progress', 'bac_RESTORE_IN_PROGRESS_DESC' => 'After the restore completes you must reboot the server. Your restore is -complete when the words "Restore complete" appear at the bottom of your screen. -', +complete when the words "Restore complete" appear at the bottom of your screen.', 'bac_FILES_HAVE_BEEN_RESTORED' => 'The following files and directories have been restored:', 'bac_RESTORE_FAILED_MSG' => 'Restore failed! There was an error in reading the backup file.', 'bac_RESTORE_COMPLETE' => 'Restore complete', @@ -1150,14 +1167,11 @@ 'bac_SERVER_REBOOT' => 'Server reboot', 'bac_SERVER_WILL_REBOOT' => 'Your server will now reboot.', 'bac_NO_UID_FOR_NAME' => 'Could not get uid for user named: ', -'bac_PAGE_REFRESH_IN' => 'This page will refresh to the status display in {$sec} seconds, or +'bac_PAGE_REFRESH_IN' => 'This page will refresh to the status display in [_1] seconds, or click here.', 'bac_Backup or restore' => 'Backup or restore', -'bac_BACKUP_DESKTOP_TOO_BIG' => 'You can modify, lock or remove any account or reset the @@ -1709,8 +1712,7 @@ as configured. The account may be activated in the future by setting a new password. The current password will not be retained. -
-+
Are you sure you wish to lock this account?', 'usr_REMOVE_ACCOUNT_TITLE' => 'Remove user account', 'usr_REMOVE_DESC' => 'You are about to remove the user account "[_1]" ([_2])', @@ -1752,15 +1754,14 @@ 'usr_LABEL_IPSECRW_DOWNLOAD' => 'Download digital certificate to IPSec client', 'usr_ERR_OCCURRED_DELETING' => 'An error occurred while trying to delete the user.', + 'ln_LOCAL NETWORKS' => 'Local networks', -'ln_FIRSTPAGE_DESC' => ' - For security reasons, several services on your server are +'ln_FIRSTPAGE_DESC' => 'For security reasons, several services on your server are available only to your local network. However you can grant these local access privileges to additional networks by listing them below. Most installations should leave this list empty.', 'ln_ADD_TITLE' => 'Add a local network ', -'ln_ADD_DESC' =>' - Each parameter must be in the form #.#.#.# (each # is a number +'ln_ADD_DESC' =>'Each parameter must be in the form #.#.#.# (each # is a number from 0 to 255). The server software will zero out the ending (host identifier) part of the network address according to the subnet mask, to ensure that the network address is valid.
@@ -1783,8 +1784,7 @@ is already considered local. Did not add new network. ', 'ln_NETWORK_ALREADY_ADDED' => 'Error: network {$network} (derived from network {$networkAddress} and subnet mask {$networkMask}) - has already been added. Did not add new network. -', + has already been added. Did not add new network.', 'ln_ERROR_CREATING_NETWORK' => 'Error occurred while creating network.', 'ln_SUCCESS' =>'Successfully added network {$network}/{$networkMask} via router {$networkRouter}.', 'ln_SUCCESS_SINGLE_ADDRESS' =>'Successfully added network {$network}/{$networkMask} via router {$networkRouter}. Your server will grant local access privileges to the single IP address {$network}. ', @@ -1802,131 +1802,73 @@ after this network is removed. ', 'ln_REMOVE_HOSTS_LABEL' => 'Remove hosts on network', 'ln-extra' => '{$network}/{$networkMask} via router $networkRouter}.', - -'ln_SUCCESS_NONSTANDARD_RANGE' =>' -
+'ln_SUCCESS_NONSTANDARD_RANGE' =>'
Successfully added network {$network}/{$networkMask} via router {$networkRouter}. -
-+
Your server will grant local access privileges to {$totalHosts} IP addresses in the range {$firstAddr} to {$lastAddr}. -
-+
Warning: the ProFTPd FTP server cannot handle this nonstandard subnet mask. The simpler specification - {$simpleMask} will be used instead. -
', - - 'pf_FORM_TITLE' => - 'Configure Port Forwarding', - 'pf_FIRST_PAGE_DESCRIPTION' => - '+ {$simpleMask} will be used instead.
', +'pf_FORM_TITLE' => 'Configure Port Forwarding', +'pf_FIRST_PAGE_DESCRIPTION' => 'You can use this panel to modify your firewall rules so as to open a specific port on this server and forward it to another port on another host. Doing so will permit incoming traffic to directly access a private host on your LAN. -
-+
WARNING: Misuse of this feature can seriously compromise the security of your network. Do not use this feature lightly, or without fully understanding the implications of your actions. -
- ', - 'pf_CREATE_RULE' => - 'Create portforwarding rule', - 'pf_SUMMARY_ADD_DESC' => - 'The following summarizes the port-forwarding rule + ', +'pf_CREATE_RULE' => 'Create portforwarding rule', +'pf_SUMMARY_ADD_DESC' => 'The following summarizes the port-forwarding rule that you are about to add. If you are satisfied with the rule, - click the "Add" button. If you are not, click the - "Cancel" button. - ', - 'pf_SUMMARY_REMOVE_DESC' => - 'The following summarizes the port-forwarding rule + click the \'Add\' button.', +'pf_SUMMARY_REMOVE_DESC' => 'The following summarizes the port-forwarding rule that you are about to remove. If you are sure you want to - remove the rule, click the "Remove" button. If not, - click the "Cancel" button. - ', - 'pf_SHOW_FORWARDS' => - ' - Below you will find a table summarizing the current + remove the rule, click the \'Remove\' button.', +'pf_SHOW_FORWARDS' => 'Below you will find a table summarizing the current port-forwarding rules installed on this server. Click on the - "Remove" link to remove the corresponding rule. - ', - 'pf_NO_FORWARDS' => - 'There are currently no forwarded ports on the system.', - 'pf_CREATE_PAGE_DESCRIPTION' => - 'Select the protocol, the port you wish to forward, the + \'Remove\' link to remove the corresponding rule.', +'pf_NO_FORWARDS' => 'There are currently no forwarded ports on the system.', +'pf_CREATE_PAGE_DESCRIPTION' => 'Select the protocol, the port you wish to forward, the destination host, and the port on the destination host that you wish to forward to. If you wish to specify a port range, enter the lower and upper boundaries separated by a hyphen. The destination port may be left blank, which will instruct the firewall to leave the source port - unaltered.
- ]]> - ', - 'pf_LABEL_SOURCE_PORT' => - 'Source Port(s)', - 'pf_LABEL_PROTOCOL' => - 'Protocol', - 'pf_LABEL_DESTINATION_PORT' => - 'Destination Port(s)', - 'pf_LABEL_DESTINATION_HOST' => - 'Destination Host IP Address', - 'pf_LABEL_RULE_COMMENT' => - 'Rule Comment', - 'pf_LABEL_ALLOW_HOSTS' => - 'Allow Hosts', - 'pf_Port forwarding' => - 'Port forwarding', - 'pf_SUCCESS' => - 'Your change to the port forwarding rules has been - successfully saved. - ', - 'pf_RULE_COMMENT' => - 'Rule Comment', - 'pf_ALLOW_HOSTS' => - 'Allow Hosts', - 'pf_ERR_NO_MASQ_RECORD' => - 'Cannot retrieve masq record from the configuration - database.', - 'pf_ERR_UNSUPPORTED_MODE' => - 'Unsupported mode.', - 'pf_ERR_CANNOT_REMOVE_NORULE' => - 'Cannot remove non-existant rule.', - 'pf_ERR_NONZERO_RETURN_EVENT' => - 'Event returned a non-zero return value.', - 'pf_ERR_BADPORT' => - 'The ports must be a positive integer less than - 65536.', - 'pf_ERR_BADIP' => - 'This does not appear to be an IP address. You must use + unaltered.', +'pf_LABEL_SOURCE_PORT' => 'Source Port(s)', +'pf_LABEL_PROTOCOL' => 'Protocol', +'pf_LABEL_DESTINATION_PORT' => 'Destination Port(s)', +'pf_LABEL_DESTINATION_HOST' => 'Destination Host IP Address', +'pf_LABEL_RULE_COMMENT' => 'Rule Comment', +'pf_LABEL_ALLOW_HOSTS' => 'Allow Hosts', +'pf_Port forwarding' => 'Port forwarding', +'pf_SUCCESS' => 'Your change to the port forwarding rules has been successfully saved.', +'pf_RULE_COMMENT' => 'Rule Comment', +'pf_ALLOW_HOSTS' => 'Allow Hosts', +'pf_ERR_NO_MASQ_RECORD' => 'Cannot retrieve masq record from the configuration database.', +'pf_ERR_UNSUPPORTED_MODE' => 'Unsupported mode.', +'pf_ERR_CANNOT_REMOVE_NORULE' => 'Cannot remove non-existant rule.', +'pf_ERR_NONZERO_RETURN_EVENT' => 'Event returned a non-zero return value.', +'pf_ERR_BADPORT' => 'The ports must be a positive integer less than 65536.', +'pf_ERR_BADIP' => 'This does not appear to be an IP address. You must use dotted-quad notation, and each of the four numbers should be less than 256. ie: 192.168.0.5', - 'pf_ERR_DUPRULE' => - 'This rule has already been added, it cannot be added - twice.', - 'pf_ERR_PORT_COLLISION' => - ' - ERROR: This port or port range conflicts with an existing - rule. Please modify this new rule, or remove the old rule. - ', - 'pf_ERR_BADAHOST' => - ' - This does not appear to be a valid IP address list. - ie: 192.168.0.1,192.168.1.1/24 - ', - 'pf_IN_SERVERONLY' => - ' - This server is currently in serveronly mode and portforwarding - is possible only to localhost. - ', - - +'pf_ERR_DUPRULE' => 'This rule has already been added, it cannot be added twice.', +'pf_ERR_PORT_COLLISION' => 'ERROR: This port or port range conflicts with an existing + rule. Please modify this new rule, or remove the old rule.', +'pf_ERR_BADAHOST' => 'This does not appear to be a valid IP address list. + ie: 192.168.0.1,192.168.1.1/24', +'pf_IN_SERVERONLY' => 'This server is currently in serveronly mode and portforwarding + is possible only to localhost.', ); diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Wbl/fr.pm smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Wbl/fr.pm --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Wbl/fr.pm 2020-04-08 23:43:08.000000000 +0400 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Wbl/fr.pm 1970-01-01 04:00:00.000000000 +0400 @@ -1,49 +0,0 @@ -package SrvMngr::I18N::Wbl::fr; - -use utf8; -use Mojo::Base 'SrvMngr::I18N'; - -my %general = (); -my %wbl = ( -'wbl_SAVE' => 'Sauvegarder', -'wbl_PERFORM' => 'Exécuter', -'wbl_FORM_TITLE' => 'WBL courriel', -'wbl_OPERATION_STATUS_REPORT' => 'Rapport d\'état de l\'opération', -'wbl_WBL_DESCRIPTION' => 'Le trafic courriel est scanné et peut être bloqué en raison des différentes méthodes de dépistage activées. Vous pouvez utiliser ce panneau pour définir les listes blanches / noires de courriels.', -'wbl_RBL_LIST_DESCRIPTION' => 'La liste RBL est utilisée pour ajuster DNSBL et RHSBL.', -'wbl_RBL_LIST' => 'Liste RBL', -'wbl_BLACK_LIST_DESCRIPTION' => 'Les listes noires sont utilisées pour refuser le trafic de courriels.', -'wbl_BLACK_LIST' => 'Liste noire', -'wbl_WHITE_LIST_DESCRIPTION' => 'Les listes blanches sont utilisées pour accepter le trafic de courriels.', -'wbl_WHITE_LIST' => 'Liste blanche', -'wbl_BLACK_TITLE' => 'Ce serveur inclus un support intégré permettant à l\'administrateur de définir des listes noires, badhelo et badmailfrom.', -'wbl_DNSBL_DESCRIPTION' => 'DNSBL est une abréviation Anglaise pour "Liste noire DNS".', -'wbl_DNSBL_LABEL' => 'Statut DNSBL', -'wbl_RHSBL_DESCRIPTION' => 'RHSBL est une abréviation pour "Right Hand Side Blacklist".', -'wbl_RHSBL_LABEL' => 'Rapport d\'état de RHSBL', -'wbl_BADHELO_DESCRIPTION' => 'Vérifie un message HELO livré par un hôte se connectant. Ceci refuse tout ceux qui apparaissent dans badhelo au moment de la phase \'helo\'.', -'wbl_BADHELO_LABEL' => 'qpsmtpd badhelo', -'wbl_BADMAILFROM_DESCRIPTION' => 'Vérifie l\'adresse de l\'expéditeur. Refuse tout ce qui apparaît (@hôte ou utilisateur@hôte) dans\'badmailfrom\' pendant la phase \'mail\'', -'wbl_BADMAILFROM_LABEL' => 'qmail \'badmailfrom\'', -'wbl_WHITE_TITLE' => 'Utilisez cette page pour modifier les paramètres de liste blanche de de votre serveur. Toutes les entrées seront activées par default', -'wbl_RRFH_LABEL' => 'État des listes blanches', -'wbl_WHITELISTHOSTS_DESCRIPTION' => 'Toute IP présente dans whitelisthosts sera exemptée de toutes validations supplémentaires pendant la phase \'connexion\'', -'wbl_WHITELISTHOSTS_LABEL' => 'Qpsmtpd whitelisthosts', -'wbl_WHITELISTHELO_DESCRIPTION' => 'Tout hôte qui émet un HELO correspondant à une entrée dans whitelisthelo sera exempté de toute autre validation pendant la phase \'helo\'', -'wbl_WHITELISTHELO_LABEL' => 'qpsmtpd whitelisthelo', -'wbl_WHITELISTSENDERS_DESCRIPTION' => 'Tout expéditeur d\'un courriel (hôte.domaine ou utilisateur@hôte.domaine) correspondant à une entrée dans la liste blanche des expéditeurs (whitelistsenders) sera exempté de toutes validations supplémentaires durant la phase \'mail\'.', -'wbl_WHITELISTSENDERS_LABEL' => 'qpsmtpd whitelistsenders', -'wbl_WHITELISTFROM_DESCRIPTION' => 'Tout expéditeur d\'un courriel (*@hôte ou utilisateur@hôte) correspondant à une entrée dans whitelist_from sera exempté d\'un rejet par spamassassin.', -'wbl_WHITELISTFROM_LABEL' => 'spamassassin whitelist_from', -'wbl_BLACKLISTFROM_LABEL' => 'spamassassin blacklist_from', -'wbl_BLACKLISTFROM_DESCRIPTION' => 'Tout expéditeur d\'un courriel (*@hôte ou utilisateur@hôte) correspondant à une entrée dans blacklist_from sera rejeté par spamassassin.', -'wbl_SBLLIST_LABEL' => 'RHSBL (qpsmtpd SBLList)', -'wbl_SBLLIST_DESCRIPTION' => 'Liste de blocage RHS - (Right Hand Side) des expéditeurs hôte / domaine sera vérifié contre les serveurs suivants', -'wbl_RBLLIST_LABEL' => 'DNSBL Zones (qpsmtpd RBLList)', -'wbl_RBLLIST_DESCRIPTION' => 'Liste de bloquage DNS -L\'adresse IP des expéditeurs sera vérifiée à partir des serveurs suivants.', - 'wbl_RBL_TITLE' => 'Les listes noires en temps réel sont désactivés par défaut. Pour aider à réduire le spam vous pouvez activer les RBLs ici.', -); - -our %Lexicon = ( %general, %wbl); - -1; \ Pas de fin de ligne à la fin du fichier diff -aurN smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Wbl/general.fr smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Wbl/general.fr --- smeserver-manager-0.1.0.old/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Wbl/general.fr 2020-04-08 23:43:08.000000000 +0400 +++ smeserver-manager-0.1.0/root/etc/e-smith/web/panels/manager2/cgi-bin/srvmngr/lib/SrvMngr/I18N/Wbl/general.fr 1970-01-01 04:00:00.000000000 +0400 @@ -1,268 +0,0 @@ -our %Lexicon = ( -_AUTO => 1, - -YES => 'Oui', -NO => 'Non', -edit => 'Modifier', -del => 'Effacer', -exit => 'Quitter', -cancel => 'Annuler', -hello => 'salut', -'All rights reserved' => 'Tous droits réservés', - -'Collaboration' => -'Collaboration', -'Administration' => -'Administration', -'Security' => -'Sécurité', -'Configuration' => -'Configuration', -'Miscellaneous' => -'Divers', -'Your Settings' => -'Vos paramètres', -'SAVE' => -'Enregistrer', -'CANCEL' => -'Annuler', -'ENABLED' => -'Activé', -'DISABLED' => -'Désactivé', -'NO' => -'Non', -'YES' => -'Oui', -'ADD' => -'Ajouter', -'CREATE' => -'Créer', -'MODIFY' => -'Modifier', -'REMOVE' => -'Supprimer', -'COMMENT' => -'Commentaire', -'NEXT' => -'Suivant', -'SELF' => -'Ce serveur', -'REMOTE' => -'Distant', -'LOCAL' => -'Local', -'ACTION' => -'Action', -'NETWORK' => -'Réseau', -'ROUTER' => -'Routeur', -'OPERATION_STATUS_REPORT' => -'Rapport d\'état de l\'opération', -'ACCOUNT' => -'Compte', -'GROUP' => -'Groupe', -'DESC_SECTIONBAR' => -'