Compare commits

...

113 Commits

Author SHA1 Message Date
29f8de63fd Fix error on json5 lint fail and add AdminLTE theme generated templates 2025-09-06 08:23:59 +01:00
c3fba3a7d5 Update mailstats.pm and default htyml xml 2025-08-30 14:08:46 +01:00
80140ff5ec Add in chameleon templates for AdminLTE mojo templates 2025-08-30 14:05:36 +01:00
2f468205bd Fix up menu code, add comment on front 2025-07-19 14:47:24 +01:00
c3192df075 Force lex scan to skip intial panel etc, also check in copylex for missing dir in output 2025-07-17 09:47:09 +01:00
032c544c53 Latest lex_scan, script to copy to SME11, program to count references 2025-07-16 14:45:21 +01:00
8c3a0529a3 Update controller and custom to use our for db handles 2025-07-14 09:03:38 +01:00
a54c9f1c12 All panels and lex files updating now 2025-07-08 09:49:14 +01:00
2eb8c32e30 All but backup, yum and bugreport ok now 2025-07-07 11:32:45 +01:00
be348b0b0d Panels and general just about working 2025-07-05 13:05:58 +01:00
7612dac6b3 Working for lex string extract and re-create .lex file 2025-07-04 14:03:15 +01:00
4050d94608 llm first shot at lex audit code 2025-07-04 09:59:16 +01:00
c700add2a6 Email settings files plus lex string audit program spec 2025-07-04 09:05:08 +01:00
dfa582e6cb Rationalise the use of SAVE as the button title in params panel 2025-06-17 14:49:20 +01:00
85d274d585 Remove <p> from error and success messages 2025-06-16 11:23:41 +01:00
3fb91ab1f4 Add in missing return on validation/db write failure 2025-06-16 10:52:38 +01:00
7f02b4f109 Add in UTF8 changes 2025-06-15 12:54:11 +01:00
ae2ba92597 Make sure all plain string constants are in single quotes 2025-06-15 06:07:49 +01:00
40e83a4bee Correct init of hash in selected function 2025-06-13 16:14:32 +01:00
2d30d8b124 Make generated table col name use underscore not hyphen 2025-05-21 17:30:59 +01:00
588081417b Add in shares contrib also fix comment out script in partial add fix json5 python 2025-05-21 11:06:32 +01:00
b6a31f89df Comment out SelectInput call on top of partial 2025-05-19 15:11:38 +01:00
4e7e8f8ed3 Add comment in partial relating to setting Selected undef 2025-05-19 13:05:34 +01:00
f785f16234 update to remoteuseracces, declare DB handles in Custom 2025-05-19 13:03:05 +01:00
386e602958 Slight mod to custom template and add remoteuseraccess files 2025-05-15 12:52:41 +01:00
8977d629e7 Fix in controller and update in partial 2025-05-09 13:15:00 +01:00
10c7def564 Typo in textarea htm l controls 2025-05-07 18:09:21 +01:00
7b0f9edb91 Add in Mailsorting project and also corrections to templates 2025-05-04 13:01:38 +01:00
8b54f7f61c Correct access to sharted data in perform and valid routines 2025-04-24 15:56:56 +01:00
6e45347ba3 Add comment on top about unique routes 2025-04-24 09:59:49 +01:00
93ef6c22c4 Add in userpanewl and fix up table sub in template 2025-04-23 13:44:45 +01:00
a5272319f2 Add in mailstats generated code amd add html object to html controls 2025-04-06 07:58:24 +01:00
9f154c586d A few fixups in ptyhon, plus mailstats panel json 1st pass 2025-04-04 18:02:23 +01:00
9fe0a050cf Remove headfings in Error and status and sort out non global opening of DBs 2025-03-31 19:03:54 +01:00
a5205ea14c Add space in status messages 2025-03-01 10:52:42 +00:00
75aaf42204 Setup to extract device types for dropdown 2025-02-14 20:02:08 +00:00
8ff23b4775 Fix config change and add js to copySM2 2025-02-14 19:37:39 +00:00
2378308576 Make copySM2 a bit more generic 2025-02-14 18:57:07 +00:00
865a945233 Update template to access config file through plugin 2025-01-22 12:03:57 +00:00
20175cf5cf Add title to tags with pattern regex 2025-01-21 12:11:07 +00:00
ba982816c0 Make autocomplete=off in password fields 2025-01-20 19:55:29 +00:00
e717237726 Get config panel working for nutups 2025-01-20 18:06:41 +00:00
51a59b9696 Update nutups and js file into generated mix 2025-01-20 16:27:26 +00:00
c7dc45ccb5 Typo in xml for expansion of helper plugins. Update to latest letsencryp and add nutups panel 2025-01-20 12:04:42 +00:00
076b604722 Add in Filename logged for css file 2024-12-09 17:26:50 +00:00
a3c77fe766 letencrypt - Change issue field to text_area 2024-12-09 17:21:42 +00:00
b0393cfe8a Add in check domains, and highlight any files created .new in red 2024-12-01 15:29:08 +00:00
918f49eaf2 Read and write to DB from form finally workinggit status 2024-12-01 13:49:42 +00:00
bae566758c Fix overwrete logic for files based on modified date. Rationalise perform logic routines 2024-12-01 11:05:35 +00:00
ce91fbab45 Up to date letsencrypt files and fix up validate template in custom 2024-11-29 16:15:55 +00:00
171bd5a141 Merge branch 'main' of http://gitea.bjsystems.co.uk/brianr/SM2Gen 2024-11-29 15:37:04 +00:00
9e996a49ff Minor format re-arrangements! 2024-11-29 15:30:13 +00:00
2b6e43b810 add 'my' to newly moved Db opening code! 2024-11-29 15:19:48 +00:00
47514f6f28 Refactor controller so that it only uses do_display to display panels 2024-11-29 13:02:13 +00:00
9567e6e327 Add extra comment to head of DB open block 2024-11-27 20:13:20 +00:00
1676739b17 mopve opening DBs into routines so that caching is avoided 2024-11-27 20:11:31 +00:00
1c275912e3 Update letsencrypt and take out spurious chars in html cxontrols 2024-11-27 16:18:56 +00:00
edb245df07 Get success message working after save 2024-11-22 15:09:21 +00:00
b9b939223b Fix error return from params screen 2024-11-22 14:00:54 +00:00
9e0b42a266 Updated letsencrypt custom file 2024-11-17 14:46:05 +00:00
b33af4042e Skip template expansion when html control does not have any chameleon tokens 2024-11-17 14:28:59 +00:00
f4fc0394f7 Add in journal log of service and ip, or failure 2024-11-16 19:23:32 +00:00
6d91ce0a87 Add in getmyip bash script - rotate through 14 services 2024-11-16 16:21:54 +00:00
c8b109378c Refine and re-write table data interface to contain the custom code in one place 2024-11-16 16:18:26 +00:00
5205daf7ed Add use esmith::util::network into controler files 2024-11-15 17:28:13 +00:00
c00230a998 Finally got Table column names in comment for table control custom procedure 2024-11-15 17:23:49 +00:00
a52983cc13 Switch to python logging library 2024-11-13 17:09:18 +00:00
1a78388e95 Finally crack the routing problem - html entities not allowed in mojo routing 2024-11-13 16:45:14 +00:00
ece4f2f6f5 Get case right in xml tags 2024-11-06 15:20:42 +00:00
e49bea28c5 Letsencrypt - Add in email field in params 2024-11-06 15:16:27 +00:00
d0a84da130 Add in one domain check and create specific back entry 2024-11-06 10:54:10 +00:00
96a8ae336d Sort out quotes round true ahd false in template 2024-11-05 20:01:05 +00:00
8f7f24dbec Make form module name in partials lowercase - part of routing problem 2024-11-05 18:56:37 +00:00
9e9817e007 Clean up partial template, add debug condition for shared data dump 2024-11-05 18:37:19 +00:00
6870aff511 Update custom generation for select, checkbox, textare, and expand Xml templates for other input types 2024-11-05 18:31:24 +00:00
7d7e4f1c5c Make links into buttons with css 2024-11-05 15:08:48 +00:00
031c1414ec Add in spell check for lex file and more format for LIST panel 2024-11-05 14:32:00 +00:00
a531307464 Updated generated files with preserved (manually) changed ones 2024-11-05 11:57:35 +00:00
26b98192e0 Update generated files plus LIST partial with table column contents 2024-11-05 11:54:07 +00:00
4fdc86ecec More changes to Custom for letsencrypt 2024-11-04 20:52:06 +00:00
3577f5aad0 Add in custom changes for letsencrypt 2024-11-04 18:42:10 +00:00
f238fcfa70 Add list of singleton pamraeters to custom, refine letsencrypt json 2024-11-04 17:08:38 +00:00
d5a771f6f3 Add in checking panels, add in readonly to textarea 2024-10-19 20:06:46 +01:00
0f5c4f948c Sort out selection options 2024-10-19 18:58:55 +01:00
964771d876 Update letsencrypt, plus typos in template files 2024-10-18 19:01:59 +01:00
d83a74100e Add in letsencrypt SM2 module data 2024-10-18 15:34:35 +01:00
0ed0d09811 Update html controls with classnames, add in packagename-panel class to css 2024-09-22 11:57:14 +01:00
53d10a96fa Add empty relevant css classes to css file 2024-09-20 17:31:09 +01:00
6e29aebd82 Sort out parameters to sm2gen 2024-09-19 10:00:50 +01:00
a551ee928c Add empty css file for each panel 2024-09-18 15:54:05 +01:00
c7f22b54f8 Add in bash script to run everything 2024-09-18 11:48:41 +01:00
b4a6be435c check file changed and generate as .new if changed after creation 2024-09-18 11:46:26 +01:00
1811a52dec Add in def to check if an existing file modified and then generatename plus new 2024-09-16 18:32:22 +01:00
5fc9f9b763 More fixing paragraph text quotes etc 2024-09-16 14:01:17 +01:00
265901414c Fix capitalisation of fields 2024-09-15 16:01:09 +01:00
4d7cc1f076 Add in entries for other mojo input tags 2024-09-15 12:06:34 +01:00
3b6e1930a0 Add in original html - play with sanitising paragraphs 2024-09-14 18:08:48 +01:00
3813f55f68 Move to python venv so that upto date chameleon avaiable 2024-09-14 11:39:26 +01:00
20d5828803 Maily debugging info to find reason nfsshare works but diskusage fails 2024-09-13 16:36:57 +01:00
436bc6d2f2 First run for DiskUsage 2024-09-12 19:48:08 +01:00
2200c50029 First rnun of SM1-2-json created json5 2024-09-12 19:37:27 +01:00
2ee6bd3bb6 Add in preformat and sm1 html to json5 extractor program 2024-09-12 18:54:38 +01:00
5c5a3bfba2 Another missing 2024-09-03 13:58:08 +01:00
1b41987aa7 In Controller call sub through 2024-09-03 12:01:17 +01:00
822fe8d26f use ruff to reformat 2024-08-26 14:25:11 +01:00
07f7954a5a Fix up lex files to show in generated app 2024-06-20 17:29:00 +01:00
2d310967e1 Fix case of package name in render call in pm file 2024-06-20 09:52:29 +01:00
d1ab8b4256 Add code to use OpenAI API to do transalations 2024-06-13 16:38:25 +01:00
a5f8e153a2 More fixes to lexical scan 2024-05-06 10:05:43 +01:00
228a42ed60 Sort formatting for english lex and add localise to tables columns 2024-05-05 09:31:10 +01:00
145c45f483 Add in generate Stringnames for lex entities and play back into templates 2024-05-03 18:08:44 +01:00
26e9889061 More sort routes 2024-04-28 12:03:06 +01:00
b96239639c Added version to all files, create .new Custom file if already there 2024-04-26 09:26:38 +01:00
217 changed files with 32006 additions and 1112 deletions

6
.gitignore vendored Executable file
View File

@@ -0,0 +1,6 @@
bin/
lib/
lib64
pyvenv.cfg
*.new
*.sav

117
LICENSE
View File

@@ -1,117 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice

View File

@@ -1,3 +0,0 @@
# SM2Gen
Python program to take a JSON5 description of an SM2 panel and spit out the perl controller, Mojo templates and I18 localise file for English.

40
SM2GenAll.sh Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
# Check for two parameters
if [ $# -ne 2 ]; then
echo "Error: requires two parameters."
echo "Usage: SM2GenAll.sh <prefix> <packagename>"
exit 1
fi
# Navigate to the appropriate directory
cd /home/brianr/clients/SM2/SM2Gen/venv || { echo "Error: Failed to change directory."; exit 1; }
source /home/brianr/clients/SM2/SM2Gen/venv/bin/activate
# Check if the HTML file exists
if [ ! -f "html/$2.html" ]; then
echo "Warning: html/$2.html does not exist. Skipping the first program."
else
# Run the first program
python3 sm1-html-2-json5.py -f "$2.html"
if [ $? -ne 0 ]; then
echo "Error: sm1-html-2-json5.py failed."
exit 1
fi
fi
# Run the second program
python3 sm2gen.py -f json5/"$2.json5" --force --noLang
if [ $? -ne 0 ]; then
echo "Error: sm2gen.py failed."
exit 1
fi
# Run the copySM2 script
copySM2.sh SME11 "$1" "$2"
if [ $? -ne 0 ]; then
echo "Error: copySM2.sh failed."
exit 1
fi
echo "All steps completed successfully."

View File

@@ -0,0 +1,140 @@
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-15 12:45:47
#
#
# Routines to be edited by the developer to provide content and validation for parameters
# and provison of the control data for table(s)
#
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB::UTF8;
use esmith::AccountsDB;
use esmith::NetworksDB::UTF8;
use esmith::HostsDB;
use esmith::DomainsDB::UTF8:
use constant FALSE => 0;
use constant TRUE => 1;
#The most common ones - open DB when required.
my $cdb;
my $adb;
my $ndb;
my $hdb;
my $ddb;
#The most common ones - you might want to use these if you need to make sure that the DB is refreshed.
#$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
#$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
#$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
#$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
#$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
# Validation routines - parameters for each panel
sub validate_PARAMS {
my $c = shift;
my $dat_data = shift; #Data hash as parameter
# Validation for each field
my $ret = '';
if (! TRUE) #validate $c->param('time_mode')
{$ret .= 'Validation for time_mode failed';}
if (! TRUE) #validate $c->param('ntpserver')
{$ret .= 'Validation for ntpserver failed';}
if (! TRUE) #validate $c->param('year')
{$ret .= 'Validation for year failed';}
if (! TRUE) #validate $c->param('month')
{$ret .= 'Validation for month failed';}
if (! TRUE) #validate $c->param('day')
{$ret .= 'Validation for day failed';}
if (! TRUE) #validate $c->param('hour')
{$ret .= 'Validation for hour failed';}
if (! TRUE) #validate $c->param('minute')
{$ret .= 'Validation for minute failed';}
if (! TRUE) #validate $c->param('second')
{$ret .= 'Validation for second failed';}
if ($ret eq '') {$ret = 'ok';}
return $ret;
}
# Get singleton data for each panel
sub get_data_for_panel_PARAMS {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1'=>'Data for PARAMS', #Example
# fields from Inputs in PARAMS $fields['PARAMS']
'time_mode'=>'time_mode contents',
'ntpserver'=>'ntpserver contents',
'year'=>'year contents',
'month'=>'month contents',
'day'=>'day contents',
'hour'=>'hour contents',
'minute'=>'minute contents',
'second'=>'second contents',
);
return %ret;
}
# Get control data for table(s)
# Return hash with values from row in which link clicked on table
sub get_selected_PARAMS {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = ();
#gather the values here
return %ret;
}
#after sucessful modify or create or whatever and submit then perfom (if the params validate)
sub perform_PARAMS {
my $c = shift;
my $dat_data = shift; #Data hash as parameter
my $ret = '';
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
if (! TRUE) #copy or perform with value: time_mode e.g. $db->set_prop($dbkey,'time_mode',$c->param('time_mode'),type=>'service'))
{$ret .= 'Perform/save failed for time_mode';}
if (! TRUE) #copy or perform with value: ntpserver e.g. $db->set_prop($dbkey,'ntpserver',$c->param('ntpserver'),type=>'service'))
{$ret .= 'Perform/save failed for ntpserver';}
if (! TRUE) #copy or perform with value: year e.g. $db->set_prop($dbkey,'year',$c->param('year'),type=>'service'))
{$ret .= 'Perform/save failed for year';}
if (! TRUE) #copy or perform with value: month e.g. $db->set_prop($dbkey,'month',$c->param('month'),type=>'service'))
{$ret .= 'Perform/save failed for month';}
if (! TRUE) #copy or perform with value: day e.g. $db->set_prop($dbkey,'day',$c->param('day'),type=>'service'))
{$ret .= 'Perform/save failed for day';}
if (! TRUE) #copy or perform with value: hour e.g. $db->set_prop($dbkey,'hour',$c->param('hour'),type=>'service'))
{$ret .= 'Perform/save failed for hour';}
if (! TRUE) #copy or perform with value: minute e.g. $db->set_prop($dbkey,'minute',$c->param('minute'),type=>'service'))
{$ret .= 'Perform/save failed for minute';}
if (! TRUE) #copy or perform with value: second e.g. $db->set_prop($dbkey,'second',$c->param('second'),type=>'service'))
{$ret .= 'Perform/save failed for second';}
if ($ret eq '') {$ret = 'ok';}
return $ret;
}
sub create_link{
# WIP
my ($c,$route, $panel, $index) = @_;
my $link = "$route?trt=$panel&Selected=$index";
return $link;
}
1;

View File

@@ -0,0 +1,279 @@
package SrvMngr::Controller::Datetime;
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-15 12:45:47
# Remember that each route must be unique (else they just overwrite each other).
# you cannot have get and post on the same name and url.
#
#----------------------------------------------------------------------
# heading : System
# description : Date and time
# navigation : 4000 300
#
# name : datetime, method : get, url : /datetime, ctlact : Datetime#main
# name : datetimeu, method : post, url : /datetimeu, ctlact : Datetime#do_update
# name : datetimed, method : get, url : /datetimed, ctlact : Datetime#do_display
#
# routes : end
#
# Documentation: https://wiki.contribs.org/Datetime
#----------------------------------------------------------------------
#
# Scheme of things:
#
# TBA!!
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use constant FALSE => 0;
use constant TRUE => 1;
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB::UTF8;
use esmith::AccountsDB;
use esmith::NetworksDB::UTF8;
use esmith::HostsDB;
use esmith::DomainsDB::UTF8:
my $cdb;
my $adb;
my $ndb;
my $hdb;
my $ddb;
my %dat_data;
require '/usr/share/smanager/lib/SrvMngr/Controller/Datetime-Custom.pm'; #The code that is to be added by the developer
sub main {
#
# Initial entry - route is "/<whatever>"
#
#set initial panel
#for initial panel:
#Specifiy panel to enter
#load up _data hash with DB fields
#load up stash with pointer(s) to control fields hash(= get-))
#and a pointer to the prefix_data hash
#render initial panel
my $c = shift;
$c->app->log->info( $c->log_req );
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
%dat_data = ();
my $title = $c->l('dat_Date_and_time');
my $modul = '';
$dat_data{'trt'} = 'PARAMS';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
my $db = $cdb; #pickup local or global db or Default to config
$c->do_display($dat_data{'trt'});
}
# Post request with params - submit from the form
sub do_update {
#
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
# parameters in the params hash.
#
#load up all params into prefix_data hash:
#By panel (series of if statements - only one executed):
#call validate-PANEL() - return ret = ok or error message
#if validation not ok:
#render back to current panel with error message in stash
#otherwise:
#By panel (series of if statements - only one executed):
#do whatever is required: call perform-PANEL() - return 'ok' or Error Message
#call signal-event for any global actions specified (check it exists - error and continue?)
#if action smeserver-<whatever>-update exists
#signal_event smeserver-<whatever>-update
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
#set success in stash
#if no "nextpanel" entry:
#set firstpanel
#else
#set nextpanel
#call render
my $c = shift;
$c->app->log->info($c->log_req);
my $modul = '';
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
my $title = $c->l('dat_Date_and_time');
# Accessing all POST/GET parameters
my $params = $c->req->params->to_hash;
# Get number of POST parameters
#my $num_params = keys scaler %$params;
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $dat_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'PARAMS'; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
my $thispanel;
if ($trt eq 'PARAMS'){
#Validate form parameters for panel PARAMS
$ret = $c->validate_PARAMS(\%dat_data);
$thispanel = 'PARAMS';
}
if ($ret ne 'ok'){
$c->stash(error => $c->l($ret));
$c->do_display($thispanel);
} else {
#Do whatever is needed, including writing values to the DB
if ($trt eq 'PARAMS'){
#do whatever is required ...
$ret = $c->perform_PARAMS(\%dat_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
dat_data => \%dat_data
);
$c->render(template => "datetime");
} else {
$c->stash( success => $c->l('dat_PARAMS_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
# and call any signal-events needed
#TBD
# Setup shared data and call panel
if ('none' eq 'none') {
$dat_data{'trt'} = 'PARAMS';
} else {
$dat_data{'trt'} = 'none';
}
$c->do_display($dat_data{'trt'});
}
}
sub do_display {
#
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
#
# OR it maybe a post from the main panel to add a new record
#
#load up all supplied params into prefix_data hash
#call get-selected-PANEL() - returns hash of all relevent parameters
#load up returned hash into prefix_data
#render - to called panel
my ($c,$trt) = @_;
$c->app->log->info($c->log_req);
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
my $title = $c->l('dat_Date_and_time');
my $modul = '';
# Accessing all parameters
my $params = $c->req->params->to_hash;
# Get number of parameters
my $num_params = keys %$params;
#Tag as Post or Get (ie. create new entry or edit existing one
my $is_new_record = ($c->req->method() eq 'POST');
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $dat_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
if (! $trt){
$trt = $c->param('trt') || 'PARAMS'; #Indicates where to go now
}
# Now add in the params from the selected row from the table
my %selectedrow;
if ($trt eq 'PARAMS'){
#Validate Get selected row (if applicable) PARAMS
%selectedrow = $c->get_selected_PARAMS($dat_data{'Selected'},$is_new_record);
}
#Copy in the selected row params to the prefix_data hash to pass to the panel
while (my ($key, $value) = each %selectedrow){
$dat_data{$key} = $value;
}
# Where to go now
$dat_data{'trt'} = $trt;
# Set up other shared data according to the panel to go to
if ($trt eq 'PARAMS'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_PARAMS();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$dat_data{$key} = $value;
}
}
# and table control fields
# Data for panel
$c->stash(
title => $title,
modul => $modul,
dat_data => \%dat_data
);
$c->render(template => "datetime");
}
1;

View File

@@ -0,0 +1,102 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-15 12:45:47
%#
<div id="Datetime-PARAMS" class="partial Datetime-PARAMS">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $dat_data
</pre>
% }
% my $btn = l('dat_APPLY');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "datetimeu" => (method => 'POST') => begin
% param 'trt' => $dat_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $dat_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('Date_and_time_configuration')%></h1>
<h2 class='subh'><%=l('dat_Time_Configuration')%></h2>
<p><span class=label>
%=l('dat_Time_Setting_Mode:')
</span><span class=data>
% my @time_mode_options = [['NTP server' => 'dat_ntp_server'], ['Set manually' => 'dat_manually_set']];
% param 'time_mode' => $dat_data->{time_mode} unless param 'time_mode';
%= select_field 'time_mode' => @time_mode_options, class => 'input', id => 'time_mode_select'
<br></span> </p>
<p class='paragraph para1'>
%=l('dat_The_server_is_periodically_synchronizing')
</p>
<p><span class=label>
%=l('dat_Set_Date_and_Time:')
</span><span class=data>
% param 'ntpserver' => $dat_data->{ntpserver} unless param 'ntpserver';
%= text_field 'ntpserver', size => '50', class => 'textinput ntpserver' , pattern=>'.*' , placeholder=>'ntpserver', title =>'Pattern regex mismatch', id => 'ntpserver_text'
<br></span></p>
<p class='paragraph para2'>
%=l('dat_Choose_this_option_to_stop')
</p>
<p><span class=label>
%=l('dat_Year:')
</span><span class=data>
% my @year_options = [['2025' => '2025'], ['2026' => '2026'], ['2027' => '2027'], ['2028' => '2028'], ['2029' => '2029'], ['2030' => '2030'], ['2031' => '2031'], ['2032' => '2032'], ['2033' => '2033'], ['2034' => '2034'], ['2035' => '2035'], ['2036' => '2036'], ['2037' => '2037'], ['2038' => '2038'], ['2039' => '2039'], ['2040' => '2040'], ['2041' => '2041'], ['2042' => '2042'], ['2043' => '2043'], ['2044' => '2044'], ['2045' => '2045'], ['2046' => '2046'], ['2047' => '2047'], ['2048' => '2048'], ['2049' => '2049'], ['2050' => '2050'], ['2051' => '2051'], ['2052' => '2052'], ['2053' => '2053'], ['2054' => '2054'], ['2055' => '2055']];
% param 'year' => $dat_data->{year} unless param 'year';
%= select_field 'year' => @year_options, class => 'input', id => 'year_select'
<br></span> </p>
<p><span class=label>
%=l('dat_Month:')
</span><span class=data>
% my @month_options = [['01' => '01'], ['02' => '02'], ['03' => '03'], ['04' => '04'], ['05' => '05'], ['06' => '06'], ['07' => '07'], ['08' => '08'], ['09' => '09'], ['10' => '10'], ['11' => '11'], ['12' => '12']];
% param 'month' => $dat_data->{month} unless param 'month';
%= select_field 'month' => @month_options, class => 'input', id => 'month_select'
<br></span> </p>
<p><span class=label>
%=l('dat_Hour:')
</span><span class=data>
% param 'day' => $dat_data->{day} unless param 'day';
%= text_field 'day', size => '50', class => 'textinput day' , pattern=>'.*' , placeholder=>'day', title =>'Pattern regex mismatch', id => 'day_text'
<br></span></p>
<p><span class=label>
%=l('dat_Hour:')
</span><span class=data>
% my @hour_options = [['00' => '00'], ['01' => '01'], ['02' => '02'], ['03' => '03'], ['04' => '04'], ['05' => '05'], ['06' => '06'], ['07' => '07'], ['08' => '08'], ['09' => '09'], ['10' => '10'], ['11' => '11'], ['12' => '12'], ['13' => '13'], ['14' => '14'], ['15' => '15'], ['16' => '16'], ['17' => '17'], ['18' => '18'], ['19' => '19'], ['20' => '20'], ['21' => '21'], ['22' => '22'], ['23' => '23']];
% param 'hour' => $dat_data->{hour} unless param 'hour';
%= select_field 'hour' => @hour_options, class => 'input', id => 'hour_select'
<br></span> </p>
<p><span class=label>
%=l('dat_Second:')
</span><span class=data>
% param 'minute' => $dat_data->{minute} unless param 'minute';
%= text_field 'minute', size => '50', class => 'textinput minute' , pattern=>'.*' , placeholder=>'minute', title =>'Pattern regex mismatch', id => 'minute_text'
<br></span></p>
<p><span class=label>
%=l('dat_second')
</span><span class=data>
% param 'second' => $dat_data->{second} unless param 'second';
%= text_field 'second', size => '50', class => 'textinput second' , pattern=>'.*' , placeholder=>'second', title =>'Pattern regex mismatch', id => 'second_text'
<br></span></p>
<span class='data'>
%= submit_button l('dat_Save'), class => 'action subm9'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,19 @@
/*
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-15 12:45:47
*/
.Datetime-panel {}
.name {}
.rout {}
.head {}
.subh {}
.sele1 {}
.para1 {}
.text2 {}
.para2 {}
.sele3 {}
.sele4 {}
.text5 {}
.sele6 {}
.text7 {}
.text8 {}
.subm9 {}

View File

@@ -0,0 +1,56 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-15 12:45:47
%#
% layout 'default', title => "Sme server 2 - Date and time", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/datetime.css'
%= javascript '/js/datetime.js'
<div id="module" class="module Datetime-panel">
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $dat_data->{trt}
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><p>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</p>
%} elsif ($c->stash('success')) {
<div class='success '>
<p>
%= $c->l($c->stash('success'));
</p>
</div>
<br />
%} elsif ($c->stash('error')) {
<div class='sme-error'>
<p>
%= $c->l($c->stash('error'));
</p>
</div>
<br />
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($dat_data->{trt} eq "PARAMS") {
%= include 'partials/_dat_PARAMS'
%}
</div>
%end

View File

@@ -0,0 +1,5 @@
//
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-15 12:45:47
//
$(document).ready(function() {
});

View File

@@ -0,0 +1,18 @@
#
# Generated by SM2Gen version: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-15 12:45:47
#
'dat_second' => 'Second',
'dat_Year:' => 'years',
'dat_Hour:' => 'hours',
'dat_Date_and_time' => 'Date and time',
'dat_Choose_this_option_to_stop' => 'Choose this option to stop synchronizing the system clock to the NTP server When the NTP service is disabled You can set the system date and time manually from this page',
'dat_Month:' => 'months',
'dat_Set_Date_and_Time:' => 'Set Date and time',
'dat_Save' => 'Save',
'dat_Second:' => 'second',
'dat_Time_Setting_Mode:' => 'Time Setting model',
'dat_Time_Configuration' => 'Time Configuration',
'dat_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful',
'dat_The_server_is_periodically_synchronizing' => 'The server is periodically synchronizing the system clock to the network time protocol (NTP) server specified below To synchronize to a different NTP server Enter a different hostage or IP address in the field below',
'Date_and_time_configuration' => 'And time configuration',
'dat_APPLY' => 'Apply',

View File

@@ -0,0 +1,87 @@
#
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-23 09:05:54
#
#
# Routines to be edited by the developer to provide validation for parameters
# and provison of the control data for table(s)
#
use esmith::util;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
#The most common ones
our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
# Validation routines - parameters for each panel
sub validate_PARAMS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = 'ok';
return $ret;
}
# Get control data for tables(s)
sub get_Table1 {
# Return an array of hashes of the contents for each row and column for Table1
# default is a single row of strings "col1header-1, col2header-1, col3Header-1 etc"
my $c = shift;
my $control_data = $self->stash('Table1');
my @ret = {}
# foreach my $colHead (@$control_data) {
# my ret{$colHead} = "$colhead-1"
# };
return \@ret
}
sub get_Table2 {
# Return an array of hashes of the contents for each row and column for Table2
# default is a single row of strings "col1header-1, col2header-1, col3Header-1 etc"
my $c = shift;
my $control_data = $self->stash('Table2');
my @ret = {}
# foreach my $colHead (@$control_data) {
# my ret{$colHead} = "$colhead-1"
# };
return \@ret
}
# Return hash with values from row in which link clicked on table
sub get_selected_PARAMS {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return $ret;
}
#after sucessful modify or create or whatever and submit then perfom (if the params validate)
sub perform_PARAMS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = 'ok';
return $ret;
}
sub create_link{
# WIP
my ($c,$route, $panel, $index) = shift;
my $link = "$route?trt=$panel&Selected=$index";
return $link;
}
1;

245
Targets/Diskusage/Diskusage.pm Executable file
View File

@@ -0,0 +1,245 @@
package SrvMngr::Controller::Diskusage;
#
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-23 09:05:54
#
#----------------------------------------------------------------------
# heading : Miscellaneous
# description : Diskusage
# navigation : 2000 400
#
# name : diskusage, method : get, url : /diskusage, ctlact : Diskusage#main
# name : diskusageu, method : post, url : /diskusageu, ctlact : Diskusage#do_update
# name : diskusaged, method : get, url : /diskusaged, ctlact : Diskusage#do_display
#
# routes : end
#
# Documentation: https://wiki.contribs.org/Diskusage
#----------------------------------------------------------------------
#
# Scheme of things:
#
# TBA!!
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use constant FALSE => 0;
use constant TRUE => 1;
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
#The most common ones
our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
require '/usr/share/smanager/lib/SrvMngr/Controller/Diskusage-Custom.pm'; #The code that is to be added by the developer
sub main {
#
# Initial entry - route is "/<whatever>"
#
#set initial panel
#for initial panel:
#Specifiy panel to enter
#load up _data hash with DB fields
#load up stash with pointer(s) to control fields hash(= get-))
#and a pointer to the prefix_data hash
#render initial panel
my $c = shift;
$c->app->log->info( $c->log_req );
my %d_data = ();
my $title = $c->l('d_Diskusage');
my $modul = '';
$d_data{'trt'} = 'PARAMS';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
my $db = $cdb; #pickup local or global db or Default to config
# and table control fields
$c->stash(Table1=>$c->get_Table1());
$c->stash(Table2=>$c->get_Table2());
$c->stash(
title => $title,
modul => $modul,
d_data => \%d_data
);
$c->render( template => "diskusage" );
}
# Post request with params - submit from the form
sub do_update {
#
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
# parameters in the params hash.
#
#load up all params into prefix_data hash:
#By panel (series of if statements - only one executed):
#call validate-PANEL() - return ret = ok or error message
#if validation not ok:
#render back to current panel with error message in stash
#otherwise:
#By panel (series of if statements - only one executed):
#do whatever is required: call perform-PANEL() - return "ok" or Error Message
#call signal-event for any global actions specified (check it exists - error and continue?)
#if action smeserver-<whatever>-update exists
#signal_event smeserver-<whatever>-update
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
#set success in stash
#if no "nextpanel" entry:
#set firstpanel
#else
#set nextpanel
#call render
my $c = shift;
$c->app->log->info($c->log_req);
my %d_data = ();
my $title = $c->l('d_Diskusage');
# Accessing all POST parameters
my %params = $c->req->params->to_hash;
# Get number of POST parameters
my $num_params = keys %params;
#Params are available in the hash "params" - copy to the prefix_data hash
while (my ($key, $value) = each %{$c->req->params->to_hash}) {
$d_data{$key} = $value;
}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'PARAMS'; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
my $thispanel;
if ($trt eq 'PARAMS'){
#Validate form parameters for panel PARAMS
$ret = $c->validate_PARAMS(\%d_data);
$thispanel = 'PARAMS';
}
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("diskusage");
} else {
#Do whatever is needed, including writing values to the DB
if ($trt eq 'PARAMS'){
#do whatever is required ...
$ret = $c->perform_PARAMS(\%d_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("diskusage");
} else {
$c->stash( success => $c->l('d_PARAMS_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
# and call any signal-events needed
# Setup shared data and call panel
$c->stash(
title => $title,
d_data => \%d_data
);
if ('none' eq 'none') {
$d_data{'trt'} = 'PARAMS';
} else {
$d_data{'trt'} = 'none';
}
$c->render("diskusage");
}
}
sub do_display {
#
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
#
# OR it maybe a post from the main panel to add a new record
#
#load up all supplied params into prefix_data hash
#call get-selected-PANEL() - returns hash of all relevent parameters
#load up returned hash into prefix_data
#render - to called panel
my $c = shift;
$c->app->log->info($c->log_req);
my %d_data = ();
my $title = $c->l('d_Diskusage');
# Accessing all parameters
my %params = $c->req->params->to_hash;
# Get number of parameters
my $num_params = keys %params;
#Tag as Post or Get (ie. create new entry or edit existing one
my $is_new_record = ($c->req->method() eq 'POST');
#Params are available in the hash "params" - copy to the prefix_data hash
while (my ($key, $value) = each %{$c->req->params->to_hash}) {
$d_data{$key} = $value;
}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'PARAMS'; #Indicates where to go now
# Now add in the params from the selected row from the table
my %selectedrow;
if ($trt eq 'PARAMS'){
#Validate form parameters for panel PARAMS
%selectedrow = $c->get_selected_PARAMS($d_data{'Selected'},$is_new_record);
}
#Copy in the selected row params to the prefix_data hash to pass to the panel
while (my ($key, $value) = each %selectedrow){
$d_data{$key} = $value;
}
# Where to go now
$d_data{'trt'} = $trt;
# Data for panel
$c->stash(
title => $title,
d_data => \%d_data
);
$c->render("diskusage");
}
1;

View File

@@ -0,0 +1,83 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-23 09:05:54
%#
<div id="Diskusage-PARAMS" class="partial Diskusage-PARAMS">
<script>
window.onload = function() {
SelectInput();
};
</script>
<h2>
%= l('d_Hello_PARAMS');
</h2>
% my $btn = l('d_APPLY');
%= form_for "Diskusaged" => (method => 'POST') => begin
% param 'trt' => $d_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $d_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('Disk_usage')%></h1>
<h2 class='subh'><%=l('d_Manage_Diskusage_settings:')%></h2>
<p class='paragraph para1'>
%=l('d_Wed_Sep_11_19:01:00_BST')
</p>
<pre class='preformatted pref1'>
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/main-root 29G 4.8G 24G 17% /
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 12K 2.0G 1% /dev/shm
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs 2.0G 648K 2.0G 1% /run
/dev/sda1 497M 111M 386M 23% /boot'
</pre>
<br /><table class="sme-border TableSort sme-table tabl1 ">
<thead class='tabl1'>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-I-bays '><%=l('d_I-bays')%></th>
<th class='sme-border table-head-col table-head-col-Usage '><%=l('d_Usage')%></th>
<th class='sme-border table-head-col table-head-col-Path '><%=l('d_Path')%></th>
</tr>
</thead>
<tbody class='tabl1'>
% my $control_data = $self->stash('Table1');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Table1-I-bays'><%=$c->render_to_string(inline=>$row->{'Table1-I-bays'})%></td>
<td class='sme-border table-col table-col-Table1-Usage'><%=$c->render_to_string(inline=>$row->{'Table1-Usage'})%></td>
<td class='sme-border table-col table-col-Table1-Path'><%=$c->render_to_string(inline=>$row->{'Table1-Path'})%></td>
</tr>
%}
</tbody>
</table>
<br /><table class="sme-border TableSort sme-table tabl2 ">
<thead class='tabl2'>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Users '><%=l('d_Users')%></th>
<th class='sme-border table-head-col table-head-col-Usage '><%=l('d_Usage')%></th>
<th class='sme-border table-head-col table-head-col-Path '><%=l('d_Path')%></th>
</tr>
</thead>
<tbody class='tabl2'>
% my $control_data = $self->stash('Table2');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Table2-Users'><%=$c->render_to_string(inline=>$row->{'Table2-Users'})%></td>
<td class='sme-border table-col table-col-Table2-Usage'><%=$c->render_to_string(inline=>$row->{'Table2-Usage'})%></td>
<td class='sme-border table-col table-col-Table2-Path'><%=$c->render_to_string(inline=>$row->{'Table2-Path'})%></td>
</tr>
%}
</tbody>
</table>
%# Probably finally by a submit.
%end
</div>

16
Targets/Diskusage/diskusage.css Executable file
View File

@@ -0,0 +1,16 @@
/*
Generated by SM2Gen version: SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-23 09:05:54
*/
.Diskusage-panel {}
.name {}
.rout {}
.head {}
.subh {}
.para1 {}
.pref1 {}
.tabl1 {}
thead .tabl1 {}
tbody .tabl1 {}
.tabl2 {}
thead .tabl2 {}
tbody .tabl2 {}

View File

@@ -0,0 +1,52 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-23 09:05:54
%#
% layout 'default', title => "Sme server 2 - Diskusage", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/diskusage.css'
<div id="module" class="module Diskusage-panel">
% if ($config->{debug} == 1) {
<p>
%= dumper $c->current_route
</p>
% }
<h1><%=$title%></h1>
% if ( stash('modul') ) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($d_data->{first}) {
<br><p>
%=$c->render_to_string(inline =>$c->l($d_data->{first}))
</p>
%} elsif ($d_data->{success}) {
<div class='sme-border'>
<h2> Operation Status Report</h2><p>
%= $c->l($d_data->{success});
</p>
</div>
%} elsif ($d_data->{error}) {
<div class='sme-error'>
<h2> Operation Status Report - error</h2><p>
%= $c->l($d_data->{error});
</p>
</div>
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($d_data->{trt} eq "PARAMS") {
%= include 'partials/_d_PARAMS'
%}
</div>
%end

View File

@@ -0,0 +1,14 @@
#
# Generated by SM2Gen version: SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-23 09:05:54
#
'd_Users' => 'Users',
'd_Hello_PARAMS' => 'Hello PARAMS',
'd_I-bays' => 'I-bays',
'd_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful',
'd_APPLY' => 'Apply',
'd_Wed_Sep_11_19:01:00_BST' => 'Wed Sep 11 19:01:00 BST 2024',
'd_Path' => 'Path',
'd_Manage_Diskusage_settings:' => 'Manage Diskusage settings:',
'd_Usage' => 'Usage',
'Disk_usage' => 'Sk usage',
'd_Diskusage' => 'Diskusage',

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,440 @@
package SrvMngr::Controller::Emailsettings;
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
# Remember that each route must be unique (else they just overwrite each other).
# you cannot have get and post on the same name and url.
#
#----------------------------------------------------------------------
# heading : System
# description : E-Mail
# navigation : 4000 400
#
# name : emailsettings, method : get, url : /emailsettings, ctlact : Emailsettings#main
# name : emailsettingsu, method : post, url : /emailsettingsu, ctlact : Emailsettings#do_update
# name : emailsettingsd, method : get, url : /emailsettingsd, ctlact : Emailsettings#do_display
#
# routes : end
#
# Documentation: https://wiki.contribs.org/Emailsettings
#----------------------------------------------------------------------
#
# Scheme of things:
#
# TBA!!
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use constant FALSE => 0;
use constant TRUE => 1;
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB::UTF8;
use esmith::AccountsDB;
use esmith::NetworksDB::UTF8;
use esmith::HostsDB;
use esmith::DomainsDB::UTF8;
my $cdb;
my $adb;
my $ndb;
my $hdb;
my $ddb;
my %mai_data;
require '/usr/share/smanager/lib/SrvMngr/Controller/Emailsettings-Custom.pm'; #The code that is to be added by the developer
sub main {
#
# Initial entry - route is "/<whatever>"
#
#set initial panel
#for initial panel:
#Specifiy panel to enter
#load up _data hash with DB fields
#load up stash with pointer(s) to control fields hash(= get-))
#and a pointer to the prefix_data hash
#render initial panel
my $c = shift;
$c->app->log->info( $c->log_req );
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
%mai_data = ();
my $title = $c->l('mai_E-Mail');
my $modul = '';
$mai_data{'trt'} = 'FRONT';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
my $db = $cdb; #pickup local or global db or Default to config
$c->do_display($mai_data{'trt'});
}
# Post request with params - submit from the form
sub do_update {
#
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
# parameters in the params hash.
#
#load up all params into prefix_data hash:
#By panel (series of if statements - only one executed):
#call validate-PANEL() - return ret = ok or error message
#if validation not ok:
#render back to current panel with error message in stash
#otherwise:
#By panel (series of if statements - only one executed):
#do whatever is required: call perform-PANEL() - return 'ok' or Error Message
#call signal-event for any global actions specified (check it exists - error and continue?)
#if action smeserver-<whatever>-update exists
#signal_event smeserver-<whatever>-update
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
#set success in stash
#if no "nextpanel" entry:
#set firstpanel
#else
#set nextpanel
#call render
my $c = shift;
$c->app->log->info($c->log_req);
my $modul = '';
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
my $title = $c->l('mai_E-Mail');
# Accessing all POST/GET parameters
my $params = $c->req->params->to_hash;
# Get number of POST parameters
#my $num_params = keys scaler %$params;
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $mai_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'FRONT'; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
my $thispanel;
if ($trt eq 'FRONT'){
#Validate form parameters for panel FRONT
$ret = $c->validate_FRONT(\%mai_data);
$thispanel = 'FRONT';
}
if ($trt eq 'ACC'){
#Validate form parameters for panel ACC
$ret = $c->validate_ACC(\%mai_data);
$thispanel = 'ACC';
}
if ($trt eq 'FIL'){
#Validate form parameters for panel FIL
$ret = $c->validate_FIL(\%mai_data);
$thispanel = 'FIL';
}
if ($trt eq 'REC'){
#Validate form parameters for panel REC
$ret = $c->validate_REC(\%mai_data);
$thispanel = 'REC';
}
if ($trt eq 'DEL'){
#Validate form parameters for panel DEL
$ret = $c->validate_DEL(\%mai_data);
$thispanel = 'DEL';
}
if ($ret ne 'ok'){
$c->stash(error => $c->l($ret));
$c->do_display($thispanel);
} else {
#Do whatever is needed, including writing values to the DB
if ($trt eq 'FRONT'){
#do whatever is required ...
$ret = $c->perform_FRONT(\%mai_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
return
} else {
$c->stash( success => $c->l('mai_FRONT_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'ACC'){
#do whatever is required ...
$ret = $c->perform_ACC(\%mai_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
return
} else {
$c->stash( success => $c->l('mai_ACC_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'FIL'){
#do whatever is required ...
$ret = $c->perform_FIL(\%mai_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
return
} else {
$c->stash( success => $c->l('mai_FIL_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'REC'){
#do whatever is required ...
$ret = $c->perform_REC(\%mai_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
return
} else {
$c->stash( success => $c->l('mai_REC_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'DEL'){
#do whatever is required ...
$ret = $c->perform_DEL(\%mai_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
return
} else {
$c->stash( success => $c->l('mai_DEL_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
# and call any signal-events needed
#TBD
# Setup shared data and call panel
if ('none' eq 'none') {
$mai_data{'trt'} = 'FRONT';
} else {
$mai_data{'trt'} = 'none';
}
$c->do_display($mai_data{'trt'});
}
}
sub do_display {
#
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
#
# OR it maybe a post from the main panel to add a new record
#
#load up all supplied params into prefix_data hash
#call get-selected-PANEL() - returns hash of all relevent parameters
#load up returned hash into prefix_data
#render - to called panel
my ($c,$trt) = @_;
$c->app->log->info($c->log_req);
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
my $title = $c->l('mai_E-Mail');
my $modul = '';
# Accessing all parameters
my $params = $c->req->params->to_hash;
# Get number of parameters
my $num_params = keys %$params;
#Tag as Post or Get (ie. create new entry or edit existing one
my $is_new_record = ($c->req->method() eq 'POST');
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $mai_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
if (! $trt){
$trt = $c->param('trt') || 'FRONT'; #Indicates where to go now
}
# Now add in the params from the selected row from the table
my %selectedrow;
if ($trt eq 'FRONT'){
#Validate Get selected row (if applicable) FRONT
%selectedrow = $c->get_selected_FRONT($mai_data{'Selected'},$is_new_record);
}
if ($trt eq 'ACC'){
#Validate Get selected row (if applicable) ACC
%selectedrow = $c->get_selected_ACC($mai_data{'Selected'},$is_new_record);
}
if ($trt eq 'FIL'){
#Validate Get selected row (if applicable) FIL
%selectedrow = $c->get_selected_FIL($mai_data{'Selected'},$is_new_record);
}
if ($trt eq 'REC'){
#Validate Get selected row (if applicable) REC
%selectedrow = $c->get_selected_REC($mai_data{'Selected'},$is_new_record);
}
if ($trt eq 'DEL'){
#Validate Get selected row (if applicable) DEL
%selectedrow = $c->get_selected_DEL($mai_data{'Selected'},$is_new_record);
}
#Copy in the selected row params to the prefix_data hash to pass to the panel
while (my ($key, $value) = each %selectedrow){
$mai_data{$key} = $value;
}
# Where to go now
$mai_data{'trt'} = $trt;
# Set up other shared data according to the panel to go to
if ($trt eq 'FRONT'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_FRONT();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mai_data{$key} = $value;
}
}
if ($trt eq 'ACC'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_ACC();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mai_data{$key} = $value;
}
}
if ($trt eq 'FIL'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_FIL();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mai_data{$key} = $value;
}
}
if ($trt eq 'REC'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_REC();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mai_data{$key} = $value;
}
}
if ($trt eq 'DEL'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_DEL();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mai_data{$key} = $value;
}
}
# and table control fields
# Data for panel
$c->stash(
title => $title,
modul => $modul,
mai_data => \%mai_data
);
$c->render(template => "emailsettings");
}
1;

View File

@@ -0,0 +1,56 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
<div id="Emailsettings-ACC" class="partial Emailsettings-ACC">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mai_data
</pre>
% }
% my $btn = l('mai_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "emailsettingsu" => (method => 'POST') => begin
% param 'trt' => $mai_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $mai_data->{trt}
%# Inputs etc in here.
%=l 'mai_DESC_POP_ACCESS_CONTROL'
<p><span class=label>
%=l 'mai_LABEL_POP_ACCESS_CONTROL'
</span><span class=input>
% param 'POPAccess' => $c->get_current_pop3_access() unless param 'POPAccess';
%= select_field 'POPAccess' => $c->get_pop_opt(), class => 'input'
</span></p>
%=l 'mai_DESC_IMAP_ACCESS_CONTROL'
<p><span class=label>
%=l 'mai_LABEL_IMAP_ACCESS_CONTROL'
</span><span class=input>
% param 'IMAPAccess' => $c->get_current_imap_access() unless param 'IMAPAccess';
%= select_field 'IMAPAccess' => $c->get_imap_opt(), class => 'input'
</span></p>
%=l 'mai_DESC_WEBMAIL'
<p><span class=label>
%=l 'mai_LABEL_WEBMAIL'
</span><span class=input>
% param 'WebMail' => $c->get_current_webmail_status() unless param 'WebMail';
%= select_field 'WebMail' => $c->get_webmail_opt(), class => 'input'
</span></p>
% my $btn = l('SAVE');
%= submit_button "$btn", class => 'action'
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
</div>

View File

@@ -0,0 +1,89 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
<div id="Emailsettings-DEL" class="partial Emailsettings-DEL">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mai_data
</pre>
% }
% my $btn = l('mai_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "emailsettingsu" => (method => 'POST') => begin
% param 'trt' => $mai_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $mai_data->{trt}
%# Inputs etc in here.
<h2>
%=l 'mai_TITLE_UNKNOWN'
</h2>
%=l 'mai_DESC_UNKNOWN'
<p><span class=label>
%=l 'mai_LABEL_UNKNOWN'
</span><span class=input>
% param 'EmailUnknownUser' => $mai_datas->{emailunknownuser} unless param 'EmailUnknownUser';
%= select_field 'EmailUnknownUser' => $c->get_emailunknownuser_opt(), class => 'input'
</span></p>
<!--<hr class='menubar' />-->
<h2>
%=l 'mai_TITLE_DELEGATE'
</h2>
%=l 'mai_DESC_DELEGATE'
<p><span class=label>
%=l 'mai_LABEL_DELEGATE'
</span><span class=input>
% param 'DelegateMailServer' => $mai_datas->{delegatemailserver} unless param 'DelegateMailServer';
%= text_field 'DelegateMailServer', class => 'input'
</span></p>
<!--<hr class='sectionbar' />-->
<h2>
%=l 'mai_TITLE_SMARTHOST'
</h2>
%=l 'mai_DESC_SMARTHOST'
<p><span class=label>
%=l 'mai_LABEL_SMARTHOST'
</span><span class=input>
% param 'SMTPSmartHost' => $mai_datas->{smtpsmarthost} unless param 'SMTPSmartHost';
%= text_field 'SMTPSmartHost', class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS'
</span><span class=input>
% param 'SMTPAUTHPROXY_status' => $mai_datas->{smtpauthproxystatus} unless param 'SMTPAUTHPROXY_status';
%= select_field 'SMTPAUTHPROXY_status' => [[(l 'DISABLED') => 'disabled'], [(l 'ENABLED') => 'enabled']], class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_USERID'
</span><span class=input>
% param 'SMTPAUTHPROXY_Userid' => $mai_datas->{smtpauthproxyuserid} unless param 'SMTPAUTHPROXY_Userid';
%= text_field 'SMTPAUTHPROXY_Userid', class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_PASSWD'
</span><span class=input>
% param 'SMTPAUTHPROXY_Passwd' => $mai_datas->{smtpauthproxypassword} unless param 'SMTPAUTHPROXY_Passwd';
%= password_field 'SMTPAUTHPROXY_Passwd', class => 'input'
</span></p>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
</div>

View File

@@ -0,0 +1,97 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
<div id="Emailsettings-FIL" class="partial Emailsettings-FIL">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mai_data
</pre>
% }
% my $btn = l('mai_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "emailsettingsu" => (method => 'POST') => begin
% param 'trt' => $mai_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $mai_data->{trt}
%# Inputs etc in here.
%=l 'mai_DESC_VIRUS_SCAN'
<p><span class=label>
%=l 'mai_LABEL_VIRUS_SCAN'
</span><span class=input>
% param 'VirusStatus' => $mai_datas->{virusstatus} unless param 'VirusStatus';
%= select_field 'VirusStatus' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
</span><br></p>
%=l 'mai_DESC_SPAM_SCAN'
<p><span class=label>
%=l 'mai_LABEL_SPAM_SCAN'
</span><span class=input>
% param 'Spamstatus' => $mai_datas->{spamstatus} unless param 'Spamstatus';
%= select_field 'Spamstatus' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SPAM_SENSITIVITY'
</span><span class=input>
% param 'SpamSensitivity' => $mai_datas->{spamsensitivity} unless param 'SpamSensitivity';
%= select_field 'SpamSensitivity' => $c->get_spam_sensitivity_opt(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SPAM_TAGLEVEL'
</span><span class=input>
% param 'SpamTagLevel' => $mai_datas->{spamtaglevel} unless param 'SpamTagLevel';
%= select_field 'SpamTagLevel' => $c->get_spam_level_options(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SPAM_REJECTLEVEL'
</span><span class=input>
% param 'SpamRejectLevel' => $mai_datas->{spamrejectlevel} unless param 'SpamRejectLevel';
%= select_field 'SpamRejectLevel' => $c->get_spam_level_options(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SORTSPAM'
</span><span class=input>
% param 'SpamSortSpam' => $mai_datas->{spamsortspam} unless param 'SpamSortSpam';
%= select_field 'SpamSortSpam' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
</span></p>
%=l 'mai_DESC_SPAM_SUBJECT'
<p><span class=label>
%=l 'mai_LABEL_SPAM_SUBJECTTAG'
</span><span class=input>
% param 'SpamSubjectTag' => $mai_datas->{spamsubjecttag} unless param 'SpamSubjectTag';
%= select_field 'SpamSubjectTag' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SPAM_SUBJECT'
</span><span class=input>
% param 'SpamSubject' => $mai_datas->{spamsubject} unless param 'SpamSubject';
%= text_field 'SpamSubject' => class => 'input'
</span></p>
%=l 'mai_DESC_BLOCK_EXECUTABLE_CONTENT'
<p><span class=label>
%=l 'mai_LABEL_CONTENT_TO_BLOCK'
</span><span class=input>
% param 'BlockExecutableContent' => $c->get_patterns_current_opt() unless param 'BlockExecutableContent';
%= select_field 'BlockExecutableContent' => $c->get_patterns_opt(), class => 'input', multiple => "1"
</span></p>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
</div>

View File

@@ -0,0 +1,155 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
<div id="Emailsettings-FRONT" class="partial Emailsettings-FRONT">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mai_data
</pre>
% }
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
<h1><%= $title%></h1>
<br>
<br>
% my $btn = l('Modify');
<fieldset title='fred'>
<legend><%= $c->l('mai_DESC_STATE_ACCESS_BUTTON') %></legend>
%= form_for 'emailsettings' => (method => 'POST') => begin
<p><span class=label>
%=l 'mai_LABEL_POP_ACCESS_CONTROL'
</span><span class=data2>
%= $c->get_current_pop3_access( TRUE )
</span></p>
<p><span class=label>
%=l 'mai_LABEL_IMAP_ACCESS_CONTROL'
</span><span class=data2>
%= $c->get_current_imap_access( TRUE )
</span></p>
<p><span class=label>
%=l 'mai_LABEL_WEBMAIL'
</span><span class=data2>
%= $c->get_current_webmail_status( TRUE )
</span></p>
<br>
<div class='center'>
%= submit_button "$btn", class => 'action'
</div>
%= hidden_field 'trt' => 'ACC'
% end
</fieldset>
<br>
<fieldset>
<legend><%= $c->l('mai_DESC_STATE_FILTERING_BUTTON') %></legend>
%= form_for 'emailsettings' => (method => 'POST') => begin
<p><span class=label>
%=l 'mai_LABEL_VIRUS_SCAN'
</span><span class=data2>
%= $c->get_virus_status(TRUE)
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SPAM_SCAN'
</span><span class=data2>
%= $c->get_spam_status(TRUE)
</span></p>
<p><span class=label>
%=l 'mai_LABEL_BLOCK_EXECUTABLE_CONTENT'
</span><span class=data2>
%= $c->get_patterns_status(TRUE)
</span></p>
<br>
<div class='center'>
%= submit_button "$btn", class => 'action'
</div>
%= hidden_field 'trt' => 'FIL'
% end
</fieldset>
<br>
<fieldset>
<legend><%= $c->l('mai_DESC_STATE_RECEPTION_BUTTON') %></legend>
%= form_for 'emailsettings' => (method => 'POST') => begin
<p><span class=label>
%=l 'mai_LABEL_MODE'
</span><span class=data2>
%= $mai_datas->{fetchmailmethod}
</span></p>
% my $smtp_mesg;
% $smtp_mesg=l('SMTP port %u allow client to authenticate:');
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25));
</span><span class=data2>
%= $c->get_current_smtp_auth( TRUE )
</span></p>
% $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:');
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465));
</span><span class=data2>
%= $c->get_current_smtp_ssl_auth( TRUE, 's', FALSE )
</span></p>
% $smtp_mesg=l 'Submission port %u status:';
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587));
</span><span class=data2>
%= $c->get_current_smtp_ssl_auth( TRUE,'u', FALSE )
</span></p>
<br />
<div class='center'>
%= submit_button "$btn", class => 'action'
</div>
%= hidden_field 'trt' => 'REC'
% end
</fieldset>
<br>
<fieldset>
<legend><%= $c->l('mai_DESC_STATE_DELIVERY_BUTTON') %></legend>
%= form_for 'emailsettings' => (method => 'POST') => begin
<p><span class=label>
%=l 'mai_LABEL_UNKNOWN'
</span><span class=data2>
%= $c->get_emailunknownuser_status( TRUE )
</span></p>
<p><span class=label>
%=l 'mai_LABEL_DELEGATE'
</span><span class=data2>
%= $c->get_value('DelegateMailServer')
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SMARTHOST'
</span><span class=data2>
%= $c->get_value('SMTPSmartHost')
</span></p>
<br>
<div class='center'>
%= submit_button "$btn", class => 'action'
</div>
%= hidden_field 'trt' => 'DEL'
% end
</fieldset>
</div>

View File

@@ -0,0 +1,158 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
<div id="Emailsettings-REC" class="partial Emailsettings-REC">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mai_data
</pre>
% }
% my $btn = l('mai_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "emailsettingsu" => (method => 'POST') => begin
% param 'trt' => $mai_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $mai_data->{trt}
%# Inputs etc in here.
%=l 'mai_DESC_MODE'
<p><span class=label>
%=l 'mai_LABEL_MODE'
</span><span class=input>
% param 'FetchmailMethod' => $mai_datas->{fetchmailmethod} unless param 'FetchmailMethod';
<!--
<pre>
%= dumper $mai_datas->{fetchmailmethod}
%= dumper $c->get_retrieval_opt()
%= param 'FetchmailMethod'
</pre>
-->
%= select_field 'FetchmailMethod' => $c->get_retrieval_opt(), class => 'input'
</span></p>
%#=l 'mai_DESC_SMTP_AUTH_CONTROL'
<br />
%= l "SMTP port (25) main purpose is to receive emails from another server, STARTTLS is always offered, but auth if offered is only if STARTTLS is also used by client."
<br />
%= l "SMTPS port (465) will require implicit SSL/TLS then authenticate to send."
<br />
%= l "SMTP Submission port (587) will require STARTTLS, then authenticate to send."
<br />
% my $smtp_mesg=l('SMTP port %u allow client to authenticate:');
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25));
</span><span class=input>
% param 'SMTPAuth' => $c->get_current_smtp_auth( FALSE ) unless param 'SMTPAuth';
<!--
<pre>
%= dumper $c->get_smtp_auth_opt()
%= dumper $c->get_current_smtp_auth(FALSE)
%= dumper $c->get_db_prop("qpsmtpd","Authentication")
%= param 'SMTPAuth'
</pre>
-->
%= select_field 'SMTPAuth' => $c->get_smtp_auth_opt(), class => 'input'
</span></p>
% my $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:');
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465));
</span><span class=input>
% param 'sSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'s', TRUE) unless param 'sSMTPAuth';
%= select_field 'sSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => 'input'
</span></p>
%my $smtp_mesg=l('Submission port %u status:');
<p><span class=label>
%= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587));
</span><span class=input>
% param 'uSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'u', TRUE) unless param 'uSMTPAuth';
<!--
<pre>
%= dumper $c->get_smtp_ssl_auth_opt()
%= dumper $c->get_current_smtp_ssl_auth(FALSE,'s', TRUE)
%= dumper $c->get_current_smtp_ssl_auth(FALSE,'u', TRUE)
%= dumper $c->get_db_prop("uqpsmtpd","access")
%= param 'uSMTPAuth'
</pre>
-->
%= select_field 'uSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => 'input'
</span></p>
<!--<hr class="sectionbar" />-->
<h2>
%=l 'mai_TITLE_SECONDARY'
</h2>
%=l 'mai_DESC_SECONDARY'
<p><span class=label>
%=l 'mai_LABEL_SECONDARY'
</span><span class=input>
% param 'SecondaryMailServer' => $mai_datas->{secondarymailserver} unless param 'SecondaryMailServer';
%= text_field 'SecondaryMailServer', class => 'input'
</span></p>
%=l 'mai_DESC_FETCH_PERIOD'
<p><span class=label>
%=l 'mai_LABEL_FETCH_PERIOD'
</span><span class=input>
% param 'FreqOffice' => $mai_datas->{freqoffice} unless param 'FreqOffice';
%= select_field 'FreqOffice' => $c->fetchmail_freq(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_FETCH_PERIOD_NIGHTS'
</span><span class=input>
% param 'FreqOutside' => $mai_datas->{freqoutside} unless param 'FreqOutside';
%= select_field 'FreqOutside' => $c->fetchmail_freq(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_FETCH_PERIOD_WEEKENDS'
</span><span class=input>
% param 'FreqWeekend' => $mai_datas->{freqweekend} unless param 'FreqWeekend';
%= select_field 'FreqWeekend' => $c->fetchmail_freq(), class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_POP_ACCOUNT'
</span><span class=input>
% param 'SecondaryMailAccount' => $mai_datas->{secondarymailaccount} unless param 'SecondaryMailAccount';
%= text_field 'SecondaryMailAccount', class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_POP_PASS'
</span><span class=input>
% param 'SecondaryMailPassword' => $mai_datas->{secondarymailpassword} unless param 'SecondaryMailPassword';
%= password_field 'SecondaryMailPassword', class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SORT_METHOD'
</span><span class=input>
% param 'SpecifyHeader' => $mai_datas->{specifyheader} unless param 'SpecifyHeader';
%= select_field 'SpecifyHeader' => [[(l 'mai_DEFAULT') => 'off'], [(l 'mai_SPECIFY_BELOW') => 'on']], class => 'input'
</span></p>
<p><span class=label>
%=l 'mai_LABEL_SORT_HEADER'
</span><span class=input>
% param 'SecondaryMailEnvelope' => $mai_datas->{secondarymailenvelope} unless param 'SecondaryMailEnvelope';
%= text_field 'SecondaryMailEnvelope', class => 'input'
</span></p>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
</div>

View File

@@ -0,0 +1,14 @@
/*
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
*/
.Emailsettings-panel {}
.name {}
.rout {}
.name {}
.rout {}
.name {}
.rout {}
.name {}
.rout {}
.name {}
.rout {}

View File

@@ -0,0 +1,68 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
%#
% layout 'default', title => "Sme server 2 - E-Mail", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/emailsettings.css'
%= javascript '/js/emailsettings.js'
<div id="module" class="module Emailsettings-panel">
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $mai_data->{trt}
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><p>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</p>
%} elsif ($c->stash('success')) {
<div class='success '>
%= $c->l($c->stash('success'));
</div>
<br />
%} elsif ($c->stash('error')) {
<div class='sme-error'>
%= $c->l($c->stash('error'));
</div>
<br />
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($mai_data->{trt} eq "FRONT") {
%= include 'partials/_mai_FRONT'
%}
% if ($mai_data->{trt} eq "ACC") {
%= include 'partials/_mai_ACC'
%}
% if ($mai_data->{trt} eq "FIL") {
%= include 'partials/_mai_FIL'
%}
% if ($mai_data->{trt} eq "REC") {
%= include 'partials/_mai_REC'
%}
% if ($mai_data->{trt} eq "DEL") {
%= include 'partials/_mai_DEL'
%}
</div>
%end

View File

@@ -0,0 +1,5 @@
//
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
//
$(document).ready(function() {
});

View File

@@ -0,0 +1,152 @@
'mai_FORM_TITLE' => 'E-mail settings',
'E-mail' => 'E-mail',
'mai_SUCCESS' => 'The new e-mail settings have been saved.',
'mai_NEVER' => 'not at all',
'mai_EVERY5MIN' => 'Every 5 minutes',
'mai_EVERY15MIN' => 'Every 15 minutes',
'mai_EVERY30MIN' => 'Every 30 minutes',
'mai_EVERYHOUR' => 'Every hour',
'mai_EVERY2HRS' => 'Every 2 hours',
'mai_STANDARD' => 'Standard (SMTP)',
'mai_ETRN' => 'ETRN (SMTP with client request)',
'mai_DEFAULT' => 'Default',
'mai_SPECIFY_BELOW' => 'Specify below',
'mai_MULTIDROP' => 'multi-drop',
'mai_LABEL_MODE' => 'E-mail retrieval mode',
'mai_DESC_MODE' => 'The e-mail retrieval mode can be set to
standard (for dedicated Internet connections), ETRN (recommended
for dialup connections), or multi-drop (for dialup connections if
ETRN is not supported by your Internet provider). Note that
multi-drop mode is the only option available when the server is
configured in private server and gateway mode.',
'mai_LABEL_DELEGATE' => 'Address of internal mail server',
'mai_TITLE_DELEGATE' => 'Delegate mail servers',
'mai_DESC_DELEGATE' => 'Your server includes a complete, full-featured e-mail server. However,
if for some reason you wish to delegate e-mail processing to
another system, specify the IP address of the delegate system
here. For normal operation, leave this field blank.',
'mai_LABEL_SECONDARY' => 'Secondary mail server',
'mai_TITLE_SECONDARY' => 'ETRN or multi-drop settings',
'mai_DESC_SECONDARY' => 'For ETRN or multi-drop, specify the hostname or IP address of your
secondary mail server. (If using the standard e-mail setup, this
field can be left blank.)',
'mai_DESC_FETCH_PERIOD' => 'For ETRN or multi-drop, you can control how frequently this server
contacts your secondary e-mail server to fetch e-mail. More
frequent connections mean that you receive your e-mail more
quickly, but also cause Internet requests to be sent more often,
possibly increasing your phone and Internet charges.',
'mai_LABEL_FETCH_PERIOD' => 'During office hours (8:00 AM to 6:00 PM) on weekdays',
'mai_LABEL_FETCH_PERIOD_NIGHTS' => 'Outside office hours (6:00 PM to 8:00 AM) on weekdays',
'mai_LABEL_FETCH_PERIOD_WEEKENDS' => 'During the weekend',
'mai_DESC_POP_ACCOUNT' => 'For multi-drop e-mail, specify the POP user account and password.
(If using standard or ETRN e-mail, these fields can be blank.)
Also, for multi-drop, you can either use the default mail sorting
method, or you can specify a particular message header to use for
mail sorting.',
'mai_LABEL_POP_PASS' => 'POP user password (for multi-drop)',
'mai_LABEL_POP_ACCOUNT' => 'POP user account (for multi-drop)',
'mai_LABEL_SORT_METHOD' => 'Select sort method (for multi-drop)',
'mai_LABEL_SORT_HEADER' => 'Select sort header (for multi-drop)',
'mai_LABEL_FETCH_PROTO' => 'Protocol (for multi-drop)',
'mai_LABEL_FETCH_SECURE' => 'Tunnel over SSL (for multi-drop)',
'mai_AUTO' => 'Automatic',
'mai_ENABLED_BOTH' => 'Allow both HTTP and HTTPS',
'mai_ENABLED_SECURE_ONLY' => 'Allow HTTPS (secure)',
'mai_ONLY_LOCAL_NETWORK_SSL' => 'Allow HTTPS (secure) from local networks',
'mai_INSECURE_POP3' => 'Allow both POP3 and POP3S',
'mai_ALLOW_PRIVATE' => 'Allow private',
'mai_SECURE_POP3' => 'Allow private and public (secure POP3S)',
'mai_INSECURE_IMAP' => 'Allow both IMAP and IMAPS',
'mai_SECURE_IMAP' => 'Allow private and public (secure IMAPS)',
'mai_INSECURE_SMTP' => 'Allow both SMTP and SSMTP',
'mai_SECURE_SMTP' => 'Allow SSMTP (secure)',
'mai_LABEL_POP_ACCESS_CONTROL' => 'POP3 server access',
'mai_LABEL_IMAP_ACCESS_CONTROL' => 'IMAP server access',
'mai_LABEL_SMTP_AUTH_CONTROL' => 'SMTP authentication',
'mai_FORWARD_TO_ADMIN' => 'Send to administrator',
'mai_FORWARD_TO' => 'Send to',
'mai_RETURN_TO_SENDER' => 'Reject',
'mai_LABEL_UNKNOWN' => 'E-mail to unknown users',
'mai_TITLE_UNKNOWN' => 'Unknown Users',
'mai_DESC_UNKNOWN' => 'Selecting Reject (recommended setting) will configure the server to only
accept mail for valid email addresses (for example users, groups, pseudonyms).
Mail for other addresses will be rejected.',
'mai_LABEL_SMARTHOST' => 'Address of Internet provider\'s mail server',
'mai_TITLE_SMARTHOST' => 'SMTP server',
'mai_DESC_SMARTHOST' => 'The server can deliver outgoing messages directly to their
destination (recommended in most cases) or can deliver them via
your Internet provider\'s SMTP server (recommended if you have an
unreliable Internet connection or are using a residential Internet
service). If using your Internet provider\'s SMTP server, specify
its hostname or IP address below. Otherwise leave this field blank.',
'mai_INVALID_SMARTHOST' => 'The smarthost name you entered is not a valid internet domain name and is not blank',
'mai_INVALID_DELEGATE' => 'The delegate host name you entered is not a valid internet domain name and is not blank',
'mai_DESC_POP_ACCESS_CONTROL' => 'You can control POP3 server access. The setting \'Allow access
only from local networks\' allows POP3 access only from your
local network(s). The POP3S setting can be used to provide
encrypted external access to your POP3 server. We recommend
leaving this setting \'Allow access only from local networks\'
unless you have a specific reason to do otherwise.',
'mai_DESC_IMAP_ACCESS_CONTROL' => 'You can control IMAP server access. The setting \'Allow access
only from local networks\' allows IMAP access only from your
local network(s). The IMAPS setting can be used to provide
encrypted external access to your IMAP server. We recommend
leaving this setting \'Allow access only from local networks\'
unless you have a specific reason to do otherwise.',
'mai_DESC_SMTP_AUTH_CONTROL' => 'You can provide authenticated access to your SMTP server, or
set it to Disabled.
The SSMTP setting requires <b>all</b> users to use SSL/TLS
authentication. The SMTP and SSMTP option additionally allows
STARTTLS to be used to ensure secure authentication.',
'mai_DESC_WEBMAIL' => 'You can enable or disable webmail on this system. Webmail allows
users to access their mail through a regular web browser by
pointing the browser to https://[_1]/webmail,and
logging in to their account.',
'mai_LABEL_WEBMAIL' => 'Webmail access',
'mai_LABEL_BLOCK_EXECUTABLE_CONTENT' => 'Executable content blocking',
'mai_LABEL_CONTENT_TO_BLOCK' => 'Content to block',
'mai_DESC_BLOCK_EXECUTABLE_CONTENT' => 'You can block executable content in e-mail attachments
by highlighting the executable attachment types you wish to
block. E-mail containing these attachment types will
be automatically returned to the sender.',
'mai_UNACCEPTABLE_CHARS' => 'This field requires a valid e-mail address, which must include
the @ symbol and a domain name.',
'mai_DESC_STATE_ACCESS' => 'E-mail access',
'mai_DESC_STATE_ACCESS_BUTTON' => 'Change e-mail access settings',
'mai_DESC_STATE_RECEPTION' => 'E-mail reception',
'mai_DESC_STATE_RECEPTION_BUTTON' => 'Change e-mail reception settings',
'mai_DESC_STATE_DELIVERY' => 'E-mail delivery',
'mai_DESC_STATE_DELIVERY_BUTTON' => 'Change e-mail delivery settings',
'mai_DESC_STATE_FILTERING_BUTTON' => 'Change e-mail filtering settings',
'mai_LABEL_VIRUS_SCAN' => 'Virus scanning',
'mai_DESC_VIRUS_SCAN' => 'You can scan incoming and outgoing e-mail for viruses. If scanning is enabled and a virus is detected, the e-mail will be rejected and returned to the
sender.',
'mai_LABEL_SPAM_SCAN' => 'Spam filtering',
'mai_DESC_SPAM_SCAN' => 'You can scan e-mail for spam. If Spam filtering is
enabled, an X-Spam-Status: header is added to each
message, which can be used for filtering spam.
You can adjust the sensitivity of the Spam detection
process from the default of medium. For fine-grained
control, you can set the Spam sensitivity to Custom
and then choose a custom tagging level, and
optionally a level at which to reject the message.',
'mai_LABEL_SPAM_SUBJECT' => 'SPAM subject prefix',
'mai_DESC_SPAM_SUBJECT' => 'You can enable to add a tag to the subject of each
message that is classified as SPAM.
The value for this tag can be defined below.',
'mai_LABEL_SPAM_SENSITIVITY' => 'Spam sensitivity',
'mai_LABEL_SPAM_TAGLEVEL' => 'Custom spam tagging level',
'mai_LABEL_SPAM_REJECTLEVEL' => 'Custom spam rejection level',
'mai_LABEL_SPAM_SUBJECTTAG' => 'Modify subject of spam messages',
'mai_LABEL_SORTSPAM' => 'Sort spam into junkmail folder',
'mai_VERYHIGH' => 'Very high',
'mai_HIGH' => 'High',
'mai_MEDIUM' => 'Medium',
'mai_LOW' => 'Low',
'mai_VERYLOW' => 'Very low',
'mai_CUSTOM' => 'Custom',
'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS' => 'SMTP Authentication for Internet provider',
'mai_LABEL_SMARTHOST_SMTPAUTH_USERID' => 'Mail server user id',
'mai_LABEL_SMARTHOST_SMTPAUTH_PASSWD' => 'Mail server password',
'mai_VALIDATION_SMTPAUTH_NONBLANK' => 'This field cannot be left blank if SMTP Authentication is
enabled.',

View File

@@ -0,0 +1,53 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
%#
%# Specific for AdminLTE theme
%#
<div id="Example1-PARAMS" class="partial Example1-PARAMS">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $ex1_data
</pre>
% }
% my $btn = l('ex1_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "example1u" => (method => 'POST') => begin
% param 'trt' => $ex1_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $ex1_data->{trt}
%# Inputs etc in here.
<div class="row g-3 align-items-center">
<h1 class='head'><%=l('ex1_Example_Contrib')%></h1></div><br>
<div class="row g-3 align-items-center">
<h2 class='subh'><%=l('ex1_Manage_Ibay_settings:')%></h2></div><br>
<div class="row g-3 align-items-center">
<p class='paragraph para1'>
%=l('ex1_These_parameters_will_be_effective')
</div><br><div class="row g-3 align-items-center">
<div class="col-md-1">
%=l('ex1_Information_Bay_name')
</div><div class="col-auto">
% param 'IbayName' => $ex1_data->{IbayName} unless param 'IbayName';
%= text_field 'IbayName', size => '50', class => 'textinput IbayName' , pattern=>'.*' , placeholder=>'IbayName', title =>'Pattern regex mismatch', id => 'IbayName_text'
</div>
</div><br><div class="row g-3 align-items-center">
<div class="col-md-1">
%=l('ex1_Share_owner_Group')
</div><div class="col-auto">
% my @ShareOwnerGrp_options = [['Write = admin, Read = group' => 'All'], ['Write = group, Read = everyone' => 'Read:All-Write:Grp']];
% param 'ShareOwnerGrp' => $ex1_data->{ShareOwnerGrp} unless param 'ShareOwnerGrp';
%= select_field 'ShareOwnerGrp' => @ShareOwnerGrp_options, class => 'input', id => 'ShareOwnerGrp_select'
</div>
</div><br>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
<br>
</div>

View File

@@ -0,0 +1,57 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
%#
%# Specific for AdminLTE theme
%#
<div id="Example1-TABLE" class="partial Example1-TABLE">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $ex1_data
</pre>
% }
% my $btn = l('ex1_SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "example1u" => (method => 'POST') => begin
% param 'trt' => $ex1_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $ex1_data->{trt}
%# Inputs etc in here.
<div class="row g-3 align-items-center">
<h1 class='head'><%=l('ex1_NFS_Share_Contrib')%></h1></div><br>
<div class="row g-3 align-items-center">
<h2 class='subh'><%=l('ex1_Manage_NFS_Ibay_settings:')%></h2></div><br>
<div class="row g-3 align-items-center">
<br /><table class="sme-border TableSort sme-table tabl1 ">
<thead class='tabl1'>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Name '><%=l('ex1_Name')%></th>
<th class='sme-border table-head-col table-head-col-Description '><%=l('ex1_Description')%></th>
<th class='sme-border table-head-col table-head-col-Status '><%=l('ex1_Status')%></th>
<th class='sme-border table-head-col table-head-col-Action '><%=l('ex1_Action')%></th>
</tr>
</thead>
<tbody class='tabl1'>
% my $control_data = $c->stash('ibays');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Name'><%=$c->render_to_string(inline=>$row->{'Name'})%></td>
<td class='sme-border table-col table-col-Description'><%=$c->render_to_string(inline=>$row->{'Description'})%></td>
<td class='sme-border table-col table-col-flag'><%=$c->render_to_string(inline=>$row->{'flag'})%></td>
<td class='sme-border table-col table-col-Modify'><%=$c->render_to_string(inline=>$row->{'Modify'})%></td>
</tr>
%}
</tbody>
</table>
</div><br>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
<br>
</div>

View File

@@ -0,0 +1,20 @@
/*
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
*/
.Example1-panel {}
.name {}
.rout {}
.head {}
.subh {}
.para1 {}
.text1 {}
.sele2 {}
.name {}
.rout {}
.head {}
.subh {}
.next {}
.tabl1 {}
thead .tabl1 {}
tbody .tabl1 {}
.next {}

View File

@@ -0,0 +1,58 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
%#
%# AdminLTE specific layout
%#
% layout 'default', title => "Sme server 2 - Example 1", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/example1.css'
%= javascript '/js/example1.js'
<div id="module" class="card-body module Example1-panel">
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $ex1_data->{trt}
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><div>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</div>
%} elsif ($c->stash('success')) {
<div class='text-success'>
%= $c->l($c->stash('success'));
</div>
%} elsif ($c->stash('error')) {
<div class='text-danger'>
%= $c->l($c->stash('error'));
</div>
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
<br>
% if ($ex1_data->{trt} eq "PARAMS") {
%= include 'partials/_ex1_PARAMS'
%}
<br>
% if ($ex1_data->{trt} eq "TABLE") {
%= include 'partials/_ex1_TABLE'
%}
<br>
</div>
%end

View File

@@ -0,0 +1,5 @@
//
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
//
$(document).ready(function() {
});

View File

@@ -0,0 +1,192 @@
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
#
#
# Routines to be edited by the developer to provide content and validation for parameters
# and provison of the control data for table(s)
#
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB::UTF8;
use esmith::AccountsDB;
use esmith::NetworksDB::UTF8;
use esmith::HostsDB;
use esmith::DomainsDB::UTF8;
use constant FALSE => 0;
use constant TRUE => 1;
#The most common ones - open DB when required.
#my $cdb;
#my $adb;
#my $ndb;
#my $hdb;
#my $ddb;
#The most common ones - you might want to use these if you need to make sure that the DB is refreshed.
#$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
#$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
#$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
#$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
#$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
# Validation routines - parameters for each panel
sub validate_PARAMS {
my $c = shift;
my $ex1_data = shift; #Data hash as parameter
# Validation for each field
my $ret = '';
if (! TRUE) #validate $c->param('IbayName')
{$ret .= 'Validation for IbayName failed';}
if (! TRUE) #validate $c->param('ShareOwnerGrp')
{$ret .= 'Validation for ShareOwnerGrp failed';}
if ($ret eq '') {$ret = 'ok';}
return $ret;
}
sub validate_TABLE {
my $c = shift;
my $ex1_data = shift; #Data hash as parameter
# Validation for each field
my $ret = '';
if ($ret eq '') {$ret = 'ok';}
return $ret;
}
# Get singleton data for each panel
sub get_data_for_panel_PARAMS {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1'=>'Data for PARAMS', #Example
# fields from Inputs in PARAMS $fields['PARAMS']
'IbayName'=>'IbayName contents',
'ShareOwnerGrp'=>'ShareOwnerGrp contents',
);
return %ret;
}
sub get_data_for_panel_TABLE {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1'=>'Data for TABLE', #Example
# fields from Inputs in TABLE $fields['TABLE']
);
return %ret;
}
# Get control data for table(s)
# Define a constant hash for field name mapping
use constant ibays_FIELD_MAPPING => (
'Name' => 'Source-for-Name',
'Description' => 'Source-for-Description',
'flag' => 'Source-for-flag',
'Modify' => 'Source-for-Modify'
#'target_field2' => 'source_field2',
# Add more mappings as needed
);
sub actual_ibays {
my $c = shift;
my @ret = ();
# Actual code for extracting ibays
return @ret;
}
sub get_ibays {
# Return an array of hashes of the contents for each row and column for ibays
my $c = shift;
my @source_records = $c->actual_ibays();
my @transformed_records;
my %Field_Mapping = ibays_FIELD_MAPPING();
# Iterate over each record in the source array
for my $source_record (@source_records) {
my %transformed_record;
# Iterate over each key-value pair in the $Field_Mapping constant
while (my ($target, $source) = each %Field_Mapping) {
# Check if the source field exists in the source record
if (exists $source_record->{$source}) {
# Assign the source field value to the target field in the transformed record
$transformed_record{$target} = $source_record->{$source};
}
}
# Add transformed record to the array if it's not empty
push @transformed_records, \%transformed_record if %transformed_record;
}
return \@transformed_records;
}
# Return hash with values from row in which link clicked on table
sub get_selected_PARAMS {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = ();
#gather the values here
return %ret;
}
sub get_selected_TABLE {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = ();
#gather the values here
return %ret;
}
#after sucessful modify or create or whatever and submit then perfom (if the params validate)
sub perform_PARAMS {
my $c = shift;
my $ex1_data = shift; #Data hash as parameter
my $ret = '';
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
if (! TRUE) #copy or perform with value: IbayName e.g. $db->set_prop($dbkey,'IbayName',$c->param('IbayName'),type=>'service'))
{$ret .= 'Perform/save failed for IbayName';}
if (! TRUE) #copy or perform with value: ShareOwnerGrp e.g. $db->set_prop($dbkey,'ShareOwnerGrp',$c->param('ShareOwnerGrp'),type=>'service'))
{$ret .= 'Perform/save failed for ShareOwnerGrp';}
if ($ret eq '') {$ret = 'ok';}
return $ret;
}
sub perform_TABLE {
my $c = shift;
my $ex1_data = shift; #Data hash as parameter
my $ret = '';
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
if ($ret eq '') {$ret = 'ok';}
return $ret;
}
sub create_link{
# WIP
my ($c,$route, $panel, $index) = @_;
my $link = "$route?trt=$panel&Selected=$index";
return $link;
}
1;

View File

@@ -0,0 +1,321 @@
package SrvMngr::Controller::Example1;
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
# Remember that each route must be unique (else they just overwrite each other).
# you cannot have get and post on the same name and url.
#
#----------------------------------------------------------------------
# heading : Network
# description : Example 1
# navigation : 2000 400
#
# name : example1, method : get, url : /example1, ctlact : Example1#main
# name : example1u, method : post, url : /example1u, ctlact : Example1#do_update
# name : example1d, method : get, url : /example1d, ctlact : Example1#do_display
#
# routes : end
#
# Documentation: https://wiki.contribs.org/Example1
#----------------------------------------------------------------------
#
# Scheme of things:
#
# TBA!!
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use constant FALSE => 0;
use constant TRUE => 1;
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB::UTF8;
use esmith::AccountsDB;
use esmith::NetworksDB::UTF8;
use esmith::HostsDB;
use esmith::DomainsDB::UTF8;
our $cdb;
our $adb;
our $ndb;
our $hdb;
our $ddb;
our %ex1_data;
require '/usr/share/smanager/lib/SrvMngr/Controller/Example1-Custom.pm'; #The code that is to be added by the developer
sub main {
#
# Initial entry - route is "/<whatever>"
#
#set initial panel
#for initial panel:
#Specifiy panel to enter
#load up _data hash with DB fields
#load up stash with pointer(s) to control fields hash(= get-))
#and a pointer to the prefix_data hash
#render initial panel
my $c = shift;
$c->app->log->info( $c->log_req );
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
%ex1_data = ();
my $title = $c->l('ex1_Example_1');
my $modul = '';
$ex1_data{'trt'} = 'TABLE';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
my $db = $cdb; #pickup local or global db or Default to config
$c->do_display($ex1_data{'trt'});
}
# Post request with params - submit from the form
sub do_update {
#
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
# parameters in the params hash.
#
#load up all params into prefix_data hash:
#By panel (series of if statements - only one executed):
#call validate-PANEL() - return ret = ok or error message
#if validation not ok:
#render back to current panel with error message in stash
#otherwise:
#By panel (series of if statements - only one executed):
#do whatever is required: call perform-PANEL() - return 'ok' or Error Message
#call signal-event for any global actions specified (check it exists - error and continue?)
#if action smeserver-<whatever>-update exists
#signal_event smeserver-<whatever>-update
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
#set success in stash
#if no "nextpanel" entry:
#set firstpanel
#else
#set nextpanel
#call render
my $c = shift;
$c->app->log->info($c->log_req);
my $modul = '';
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
my $title = $c->l('ex1_Example_1');
# Accessing all POST/GET parameters
my $params = $c->req->params->to_hash;
# Get number of POST parameters
#my $num_params = keys scaler %$params;
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $ex1_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'TABLE'; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
my $thispanel;
if ($trt eq 'PARAMS'){
#Validate form parameters for panel PARAMS
$ret = $c->validate_PARAMS(\%ex1_data);
$thispanel = 'PARAMS';
}
if ($trt eq 'TABLE'){
#Validate form parameters for panel TABLE
$ret = $c->validate_TABLE(\%ex1_data);
$thispanel = 'TABLE';
}
if ($ret ne 'ok'){
$c->stash(error => $c->l($ret));
$c->do_display($thispanel);
} else {
#Do whatever is needed, including writing values to the DB
if ($trt eq 'PARAMS'){
#do whatever is required ...
$ret = $c->perform_PARAMS(\%ex1_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
ex1_data => \%ex1_data
);
$c->render(template => "example1");
return
} else {
$c->stash( success => $c->l('ex1_PARAMS_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'TABLE'){
#do whatever is required ...
$ret = $c->perform_TABLE(\%ex1_data);
if ($ret ne 'ok') {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
ex1_data => \%ex1_data
);
$c->render(template => "example1");
return
} else {
$c->stash( success => $c->l('ex1_TABLE_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
# and call any signal-events needed
#TBD
# Setup shared data and call panel
if ('none' eq 'none') {
$ex1_data{'trt'} = 'TABLE';
} else {
$ex1_data{'trt'} = 'none';
}
$c->do_display($ex1_data{'trt'});
}
}
sub do_display {
#
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
#
# OR it maybe a post from the main panel to add a new record
#
#load up all supplied params into prefix_data hash
#call get-selected-PANEL() - returns hash of all relevent parameters
#load up returned hash into prefix_data
#render - to called panel
my ($c,$trt) = @_;
$c->app->log->info($c->log_req);
#The most common ones - you might want to delete some of these if they are not used.
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
my $title = $c->l('ex1_Example_1');
my $modul = '';
# Accessing all parameters
my $params = $c->req->params->to_hash;
# Get number of parameters
my $num_params = keys %$params;
#Tag as Post or Get (ie. create new entry or edit existing one
my $is_new_record = ($c->req->method() eq 'POST');
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $ex1_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
if (! $trt){
$trt = $c->param('trt') || 'TABLE'; #Indicates where to go now
}
# Now add in the params from the selected row from the table
my %selectedrow;
if ($trt eq 'PARAMS'){
#Validate Get selected row (if applicable) PARAMS
%selectedrow = $c->get_selected_PARAMS($ex1_data{'Selected'},$is_new_record);
}
if ($trt eq 'TABLE'){
#Validate Get selected row (if applicable) TABLE
%selectedrow = $c->get_selected_TABLE($ex1_data{'Selected'},$is_new_record);
}
#Copy in the selected row params to the prefix_data hash to pass to the panel
while (my ($key, $value) = each %selectedrow){
$ex1_data{$key} = $value;
}
# Where to go now
$ex1_data{'trt'} = $trt;
# Set up other shared data according to the panel to go to
if ($trt eq 'PARAMS'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_PARAMS();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$ex1_data{$key} = $value;
}
}
if ($trt eq 'TABLE'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_TABLE();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$ex1_data{$key} = $value;
}
}
# and table control fields
$c->stash(ibays=>$c->get_ibays());
# Data for panel
$c->stash(
title => $title,
modul => $modul,
ex1_data => \%ex1_data
);
$c->render(template => "example1");
}
1;

View File

@@ -0,0 +1,50 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
%#
<div id="Example1-PARAMS" class="partial Example1-PARAMS">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $ex1_data
</pre>
% }
% my $btn = l('SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "example1u" => (method => 'POST') => begin
% param 'trt' => $ex1_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $ex1_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('Example Contrib')%></h1>
<h2 class='subh'><%=l('Manage Ibay settings:')%></h2>
<p class='paragraph para1'>
%=l('These parameters will be effective only if the share is enabled. The share is in /home/e-smith/files/ibays//files')
</p>
<p><span class=label>
%=l('ex1_Information Bay name')
</span><span class=data>
% param 'IbayName' => $ex1_data->{IbayName} unless param 'IbayName';
%= text_field 'IbayName', size => '50', class => 'textinput IbayName' , pattern=>'.*' , placeholder=>'IbayName', title =>'Pattern regex mismatch', id => 'IbayName_text'
<br></span></p>
<p><span class=label>
%=l('ex1_Share owner Group')
</span><span class=data>
% my @ShareOwnerGrp_options = [['Write = admin, Read = group' => 'All'], ['Write = group, Read = everyone' => 'Read:All-Write:Grp']];
% param 'ShareOwnerGrp' => $ex1_data->{ShareOwnerGrp} unless param 'ShareOwnerGrp';
%= select_field 'ShareOwnerGrp' => @ShareOwnerGrp_options, class => 'input', id => 'ShareOwnerGrp_select'
<br></span> </p>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
</div>

View File

@@ -0,0 +1,54 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
%#
<div id="Example1-TABLE" class="partial Example1-TABLE">
%# <script>
%# window.onload = function() {
%# SelectInput();
%# };
%# </script>
% if (config->{debug} == 1) {
<pre>
%= dumper $ex1_data
</pre>
% }
% my $btn = l('SAVE');
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
%= form_for "example1u" => (method => 'POST') => begin
% param 'trt' => $ex1_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $ex1_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('NFS Share Contrib')%></h1>
<h2 class='subh'><%=l('Manage NFS Ibay settings:')%></h2>
<br /><table class="sme-border TableSort sme-table tabl1 ">
<thead class='tabl1'>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Name '><%=l('Name')%></th>
<th class='sme-border table-head-col table-head-col-Description '><%=l('Description')%></th>
<th class='sme-border table-head-col table-head-col-Status '><%=l('Status')%></th>
<th class='sme-border table-head-col table-head-col-Action '><%=l('Action')%></th>
</tr>
</thead>
<tbody class='tabl1'>
% my $control_data = $c->stash('ibays');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Name'><%=$c->render_to_string(inline=>$row->{'Name'})%></td>
<td class='sme-border table-col table-col-Description'><%=$c->render_to_string(inline=>$row->{'Description'})%></td>
<td class='sme-border table-col table-col-flag'><%=$c->render_to_string(inline=>$row->{'flag'})%></td>
<td class='sme-border table-col table-col-Modify'><%=$c->render_to_string(inline=>$row->{'Modify'})%></td>
</tr>
%}
</tbody>
</table>
%# ....
%# Probably finally by a submit.
%= submit_button $btn, class => 'action'
%end
</div>

View File

@@ -0,0 +1,20 @@
/*
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
*/
.Example1-panel {}
.name {}
.rout {}
.head {}
.subh {}
.para1 {}
.text1 {}
.sele2 {}
.name {}
.rout {}
.head {}
.subh {}
.next {}
.tabl1 {}
thead .tabl1 {}
tbody .tabl1 {}
.next {}

View File

@@ -0,0 +1,56 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
%#
% layout 'default', title => "Sme server 2 - Example 1", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/example1.css'
%= javascript '/js/example1.js'
<div id="module" class="module Example1-panel">
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $ex1_data->{trt}
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><p>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</p>
%} elsif ($c->stash('success')) {
<div class='success '>
%= $c->l($c->stash('success'));
</div>
<br />
%} elsif ($c->stash('error')) {
<div class='sme-error'>
%= $c->l($c->stash('error'));
</div>
<br />
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($ex1_data->{trt} eq "PARAMS") {
%= include 'partials/_ex1_PARAMS'
%}
% if ($ex1_data->{trt} eq "TABLE") {
%= include 'partials/_ex1_TABLE'
%}
</div>
%end

View File

@@ -0,0 +1,5 @@
//
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
//
$(document).ready(function() {
});

View File

@@ -0,0 +1,18 @@
#
# Generated by SM2Gen version: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-09-06 06:03:54
#
'ex1_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful',
'ex1_Example_1' => 'Example 1',
'ex1_Description' => 'Description',
'ex1_Status' => 'Status',
'ex1_Action' => 'Action',
'ex1_Name' => 'Name',
'ex1_Information_Bay_name' => 'Information Bay name',
'ex1_Example_Contrib' => 'Example control',
'ex1_NFS_Share_Contrib' => 'NFS Share control',
'ex1_These_parameters_will_be_effective' => 'These parameters will be effective only if the share is enabled The share is in /home/e-smith/files/ibays//files',
'ex1_Manage_NFS_Ibay_settings:' => 'Manage NFS bay settings',
'ex1_Share_owner_Group' => 'Share owner Group',
'ex1_SAVE' => 'Save',
'ex1_TABLE_panel_action_was_successful' => 'TABLE panel action was successful',
'ex1_Manage_Ibay_settings:' => 'Manage bay settings',

View File

@@ -0,0 +1,566 @@
#
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-11-16 10:30:16
#
#
# Routines to be edited by the developer to provide content and validation for parameters
# and provison of the control data for table(s)
#
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::DomainsDB;
use constant FALSE => 0;
use constant TRUE => 1;
#The most common ones
our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
# Validation routines - parameters for each panel
sub validate_LIST {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (!TRUE) #validate $c->param('InternalIP')
{
$ret .= 'Validation for InternalIP failed';
}
if (!TRUE) #validate $c->param('ExternalIP')
{
$ret .= 'Validation for ExternalIP failed';
}
if (!TRUE) #validate $c->param('InternetIP')
{
$ret .= 'Validation for InternetIP failed';
}
if (!TRUE) #validate $c->param('Issuer')
{
$ret .= 'Validation for Issuer failed';
}
if (!TRUE) #validate $c->param('Expiry')
{
$ret .= 'Validation for Expiry failed';
}
if (!TRUE) #validate $c->param('NotBefore')
{
$ret .= 'Validation for NotBefore failed';
}
if ($ret eq "") { $ret = 'ok'; }
return $ret;
} ## end sub validate_LIST
sub validate_PARAMS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (!TRUE) #validate $c->param('status')
{
$ret .= 'Validation for status failed';
}
if (!TRUE) #validate $c->param('hookScript')
{
$ret .= 'Validation for hookScript failed';
}
if (!TRUE) #validate $c->param('hostOverride')
{
$ret .= 'Validation for hostOverride failed';
}
if (!TRUE) #validate $c->param('ACCEPT_TERMS')
{
$ret .= 'Validation for ACCEPT_TERMS failed';
}
if (!TRUE) #validate $c->param('API')
{
$ret .= 'Validation for API failed';
}
if (!TRUE) #validate $c->param('keysize')
{
$ret .= 'Validation for keysize failed';
}
if (!TRUE) #validate $c->param('configure')
{
$ret .= 'Validation for configure failed';
}
if (!TRUE) #validate $c->param('Email')
{
$ret .= 'Validation for Email failed';
}
if ($ret eq "") { $ret = 'ok'; }
return $ret;
} ## end sub validate_PARAMS
sub validate_CHECKALLDOMAINS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (!TRUE) #validate $c->param('AllDomainsCheck')
{
$ret .= 'Validation for AllDomainsCheck failed';
}
if ($ret eq "") { $ret = 'ok'; }
return $ret;
} ## end sub validate_CHECKALLDOMAINS
sub validate_CHECKALLENABLEDDOMAINS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (!TRUE) #validate $c->param('EnabledDomainsCheck')
{
$ret .= 'Validation for EnabledDomainsCheck failed';
}
if ($ret eq "") { $ret = 'ok'; }
return $ret;
} ## end sub validate_CHECKALLENABLEDDOMAINS
sub validate_CHECKONEDOMAIN {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (!TRUE) #validate $c->param('OneDomainToCheck')
{
$ret .= 'Validation for OneDomainToCheck failed';
}
if (!TRUE) #validate $c->param('OneDomainsCheck')
{
$ret .= 'Validation for OneDomainsCheck failed';
}
if ($ret eq "") { $ret = 'ok'; }
return $ret;
} ## end sub validate_CHECKONEDOMAIN
# Get singleton data for each panel
sub get_data_for_panel_LIST {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
# my ($reply, $err, $server_cert) = Net::SSLeay::sslcat('localhost', 443, '/');
# my $issuer = Net::SSLeay::X509_NAME_oneline(Net::SSLeay::X509_get_issuer_name($server_cert));
# my $before = Net::SSLeay::P_ASN1_TIME_get_isotime(Net::SSLeay::X509_get_notBefore($server_cert));
# my $expiry = Net::SSLeay::P_ASN1_TIME_get_isotime(Net::SSLeay::X509_get_notAfter($server_cert));
my %ret = (
'Data1' => 'Data for LIST', #Example
# fields from Inputs in LIST $fields['LIST']
'InternalIP' => $cdb->get_prop('InternalInterface', 'IPAddress'),
'ExternalIP' => $cdb->get_prop('ExternalInterface', 'IPAddress'),
'InternetIP' => $c->get_my_ip(),
'Issuer' => '$issuer',
'Expiry' => '$expiry',
'NotBefore' => '$before',
);
return %ret;
} ## end sub get_data_for_panel_LIST
sub get_data_for_panel_PARAMS {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1' => 'Data for PARAMS', #Example
# fields from Inputs in PARAMS $fields['PARAMS']
'status' => $cdb->get_prop('letsencrypt', 'status', 'disabled'),
'hookScript' => $cdb->get_prop('letsencrypt', 'hookScript', 'disabled'),
'hostOverride' => $cdb->get_prop('letsencrypt', 'hostOverride', 'disabled'),
'ACCEPT_TERMS' => $cdb->get_prop('letsencrypt', 'ACCEPT_TERMS', ''),
'API' => $cdb->get_prop('letsencrypt', 'API', '2'),
'keysize' => $cdb->get_prop('letsencrypt', 'keysize', '4096'),
'configure' => $cdb->get_prop('letsencrypt', 'configure', 'none'),
'email' => $cdb->get_prop('letsencrypt', 'email')
);
return %ret;
} ## end sub get_data_for_panel_PARAMS
sub get_data_for_panel_CHECKALLDOMAINS {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1' => 'Data for CHECKALLDOMAINS', #Example
# fields from Inputs in CHECKALLDOMAINS $fields['CHECKALLDOMAINS']
'AllDomainsCheck' => $c->update_all_domains(),
);
return %ret;
} ## end sub get_data_for_panel_CHECKALLDOMAINS
sub get_data_for_panel_CHECKALLENABLEDDOMAINS {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1' => 'Data for CHECKALLENABLEDDOMAINS', #Example
# fields from Inputs in CHECKALLENABLEDDOMAINS $fields['CHECKALLENABLEDDOMAINS']
'EnabledDomainsCheck' => $c->update_enabled_domains(),
);
return %ret;
} ## end sub get_data_for_panel_CHECKALLENABLEDDOMAINS
sub get_data_for_panel_CHECKONEDOMAIN {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1' => 'Data for CHECKONEDOMAIN', #Example
# fields from Inputs in CHECKONEDOMAIN $fields['CHECKONEDOMAIN']
'OneDomainToCheck' => $c->param("CHECKONEDOMAIN"),
'OneDomainsCheck' => $c->update_one_domain($c->param("CHECKONEDOMAIN"))
);
return %ret;
} ## end sub get_data_for_panel_CHECKONEDOMAIN
# Get control data for table(s)
# Define a constant hash for field name mapping
use constant DomainList_FIELD_MAPPING => (
'Table1-Domain name / HOSTNAME' => 'Domain',
'Table1-Brief description' => 'Description',
'Table1-Content' => 'Content',
'Table1-LABEL_NAMESERVERS' => 'Nameservers',
'Table1-LABEL_POINT' => 'Source-for-Table1-LABEL_POINT',
'Table1-LABEL_LECERT' => 'letsencryptSSLcert',
'Table1-IS_IN_CERT' => 'isincert',
'Table1-CHECK' => 'Check'
#'target_field2' => 'source_field2',
# Add more mappings as needed
);
use constant TEST_DOMAIN_LIST => (
{ "domain" => "Domain1", "fred" => "fred1", "description" => "Description1" },
{ "domain" => "Domain2", "fred" => "fred2", "description" => "Description2" },
{ "domain" => "Domain3", "fred" => "fred3", "description" => "Description3" },
# Add more test entries as needed
);
sub actual_DomainList {
my $c = shift;
# Actual code for extracting DomainList
my @list = ();
# my @rv = Net::SSLeay::X509_get_subjectAltNames($server_cert);
# foreach my $element (@rv) {
# next if $element =~ /^\d+$/; ;
# #print $element . "\n";
# push @list, $element;
# }
my @data = ();
my $check = $c->l('Check Domain');
for ($ddb->domains) {
my $ns = $_->prop('Nameservers') || 'internet';
my $le = $_->prop('letsencryptSSLcert') || 'disabled'; #letsencrypt configure all
my $dname = $_->key;
my $isincert = "N";
my $link = $c->create_link("letsencryptd", "CHECKONEDOMAIN", "");
my $checklink = "<a href='" . $link . "&CHECKONEDOMAIN=" . $_->key . "'>" . $check . "</a>";
#my $checklink = "<a href=''>check</a>";
$isincert = "Y" if ($dname ~~ @list);
# domain
push @data,
{
Domain => $_->key,
$_->props,
letsencryptSSLcert => $le,
isincert => $isincert,
Check => $checklink,
Nameservers => $ns,
};
#and hosts
for my $h ($hdb->get_hosts_by_domain($dname)) {
next if $ddb->get($h->key);
next unless ($h->prop('HostType') eq "Self" || $h->prop('HostType') eq "Local");
$le = $h->prop('letsencryptSSLcert') || 'disabled'; #letsencrypt configure all
$isincert = "N";
$isincert = "Y" if ($h->key ~~ @list);
push @data, {
Domain => "--> " . $h->key,
$h->props,
Description => $h->prop('ExternalIP') || $h->prop('InternalIP') || "",
Content => $h->prop('HostType'),
isincert => $isincert,
Check => "", #$checklink
Nameservers => $c->l($ns),
};
} ## end for my $h ($hdb->get_hosts_by_domain...)
} ## end for ($ddb->domains)
return @data;
} ## end sub actual_DomainList
sub get_DomainList {
# Return an array of hashes of the contents for each row and column for DomainList
my $c = shift;
my @source_records
= $c->actual_DomainList(); #TEST_DOMAIN_LIST #Replace by code or call to produce contents of table;
my @transformed_records;
my %Field_Mapping = DomainList_FIELD_MAPPING;
# Iterate over each record in the source array
for my $source_record (@source_records) {
my %transformed_record;
# Iterate over each key-value pair in the $Field_Mapping constant
while (my ($target, $source) = each %Field_Mapping) {
# Check if the source field exists in the source record
if (exists $source_record->{$source}) {
# Assign the source field value to the target field in the transformed record
$transformed_record{$target} = $source_record->{$source};
}
} ## end while (my ($target, $source...))
# Add transformed record to the array if it's not empty
push @transformed_records, \%transformed_record if %transformed_record;
} ## end for my $source_record (...)
return \@transformed_records;
} ## end sub get_DomainList
# Return hash with values from row in which link clicked on table
sub get_selected_LIST {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
} ## end sub get_selected_LIST
sub get_selected_PARAMS {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
} ## end sub get_selected_PARAMS
sub get_selected_CHECKALLDOMAINS {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
} ## end sub get_selected_CHECKALLDOMAINS
sub get_selected_CHECKALLENABLEDDOMAINS {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
} ## end sub get_selected_CHECKALLENABLEDDOMAINS
sub get_selected_CHECKONEDOMAIN {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
} ## end sub get_selected_CHECKONEDOMAIN
#after sucessful modify or create or whatever and submit then perfom (if the params validate)
sub perform_LIST {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = "";
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
if (!TRUE
) #copy or perform with value: InternalIP e.g. $db->set_prop($dbkey,'InternalIP',$c->param('InternalIP'),type=>'service'))
{
$ret .= 'Perform/save failed for InternalIP';
} ## end if (!TRUE)
if (!TRUE
) #copy or perform with value: ExternalIP e.g. $db->set_prop($dbkey,'ExternalIP',$c->param('ExternalIP'),type=>'service'))
{
$ret .= 'Perform/save failed for ExternalIP';
} ## end if (!TRUE)
if (!TRUE
) #copy or perform with value: InternetIP e.g. $db->set_prop($dbkey,'InternetIP',$c->param('InternetIP'),type=>'service'))
{
$ret .= 'Perform/save failed for InternetIP';
} ## end if (!TRUE)
if (!TRUE
) #copy or perform with value: Issuer e.g. $db->set_prop($dbkey,'Issuer',$c->param('Issuer'),type=>'service'))
{
$ret .= 'Perform/save failed for Issuer';
} ## end if (!TRUE)
if (!TRUE
) #copy or perform with value: Expiry e.g. $db->set_prop($dbkey,'Expiry',$c->param('Expiry'),type=>'service'))
{
$ret .= 'Perform/save failed for Expiry';
} ## end if (!TRUE)
if (!TRUE
) #copy or perform with value: NotBefore e.g. $db->set_prop($dbkey,'NotBefore',$c->param('NotBefore'),type=>'service'))
{
$ret .= 'Perform/save failed for NotBefore';
} ## end if (!TRUE)
if ($ret eq "") { $ret = 'ok'; }
return $ret;
} ## end sub perform_LIST
sub perform_PARAMS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = "";
my $db = $cdb; #maybe one of the others
my $dbkey = 'letsencrypt';
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
if (!$db->set_prop($dbkey, 'status', $c->param('status'), type => 'service')) {
$ret .= 'Perform/save failed for status';
}
if (!$db->set_prop($dbkey, 'hookScript', $c->param('hookScript'), type => 'service')) {
$ret .= 'Perform/save failed for hookScript';
}
if (!$db->set_prop($dbkey, 'hostOverride', $c->param('hostOverride'), type => 'service')) {
$ret .= 'Perform/save failed for hostOverride';
}
if (!$db->set_prop($dbkey, 'ACCEPT_TERMS', $c->param('ACCEPT_TERMS'), type => 'service')) {
$ret .= 'Perform/save failed for ACCEPT_TERMS';
}
if (!$db->set_prop($dbkey, 'API', $c->param('API'), type => 'service')) { $ret .= 'Perform/save failed for API'; }
if (!$db->set_prop($dbkey, 'keysize', $c->param('keysize'), type => 'service')) {
$ret .= 'Perform/save failed for keysize';
}
if (!$db->set_prop($dbkey, 'configure', $c->param('configure'), type => 'service')) {
$ret .= 'Perform/save failed for configure';
}
if (!$db->set_prop($dbkey, 'email', $c->param('email'), type => 'service')) {
$ret .= 'Perform/save failed for email';
}
if ($ret eq "") { $ret = 'ok'; }
return $ret;
} ## end sub perform_PARAMS
sub perform_CHECKALLDOMAINS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = "";
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
if (!TRUE
) #copy or perform with value: AllDomainsCheck e.g. $db->set_prop($dbkey,'AllDomainsCheck',$c->param('AllDomainsCheck'),type=>'service'))
{
$ret .= 'Perform/save failed for AllDomainsCheck';
} ## end if (!TRUE)
if ($ret eq "") { $ret = 'ok'; }
return $ret;
} ## end sub perform_CHECKALLDOMAINS
sub perform_CHECKALLENABLEDDOMAINS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = "";
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
if (!TRUE
) #copy or perform with value: EnabledDomainsCheck e.g. $db->set_prop($dbkey,'EnabledDomainsCheck',$c->param('EnabledDomainsCheck'),type=>'service'))
{
$ret .= 'Perform/save failed for EnabledDomainsCheck';
} ## end if (!TRUE)
if ($ret eq "") { $ret = 'ok'; }
return $ret;
} ## end sub perform_CHECKALLENABLEDDOMAINS
sub perform_CHECKONEDOMAIN {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = "";
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
if (!TRUE
) #copy or perform with value: OneDomainToCheck e.g. $db->set_prop($dbkey,'OneDomainToCheck',$c->param('OneDomainToCheck'),type=>'service'))
{
$ret .= 'Perform/save failed for OneDomainToCheck';
} ## end if (!TRUE)
if (!TRUE
) #copy or perform with value: OneDomainsCheck e.g. $db->set_prop($dbkey,'OneDomainsCheck',$c->param('OneDomainsCheck'),type=>'service'))
{
$ret .= 'Perform/save failed for OneDomainsCheck';
} ## end if (!TRUE)
if ($ret eq "") { $ret = 'ok'; }
return $ret;
} ## end sub perform_CHECKONEDOMAIN
sub create_link {
# WIP
my ($c, $route, $panel, $index) = @_;
my $link = "$route?trt=$panel&Selected=$index";
return $link;
} ## end sub create_link
sub get_my_ip {
my ($self, $item, $prop, $default) = @_;
my $output = `/usr/sbin/e-smith/getmyip`;
return $output || "IP";
} ## end sub get_my_ip
sub update_one_domain {
my ($self, $domain) = @_;
return "$domain not domain" unless ($ddb->get($domain) || $hdb->get($domain));
($domain) = ($domain =~ /([\w\p{L}.]+)/);
my $output = `/etc/e-smith/events/actions/letsencrypt-setdomains " " $domain `;
return $output || "-empty-";
} ## end sub update_one_domain
sub update_all_domains {
my $self = shift;
my $output = `/etc/e-smith/events/actions/letsencrypt-setdomains "" "" all `;
return $output || "-empty-";
} ## end sub update_all_domains
sub update_enabled_domains {
my $self = shift;
my $output = `/etc/e-smith/events/actions/letsencrypt-setdomains "" "" enabled `;
return $output || "-empty-";
} ## end sub update_enabled_domains
1;

View File

@@ -0,0 +1,448 @@
package SrvMngr::Controller::Letsencrypt;
#
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-01 15:22:43
#
#----------------------------------------------------------------------
# heading : Network
# description : Letsencrypt certificate
# navigation : 6000 6600
#
# name : letsencrypt, method : get, url : /letsencrypt, ctlact : Letsencrypt#main
# name : letsencryptu, method : post, url : /letsencryptu, ctlact : Letsencrypt#do_update
# name : letsencryptd, method : get, url : /letsencryptd, ctlact : Letsencrypt#do_display
#
# routes : end
#
# Documentation: https://wiki.contribs.org/Letsencrypt
#----------------------------------------------------------------------
#
# Scheme of things:
#
# TBA!!
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use constant FALSE => 0;
use constant TRUE => 1;
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
require
'/usr/share/smanager/lib/SrvMngr/Controller/Letsencrypt-Custom.pm'; #The code that is to be added by the developer
sub main {
#
# Initial entry - route is "/<whatever>"
#
#set initial panel
#for initial panel:
#Specifiy panel to enter
#load up _data hash with DB fields
#load up stash with pointer(s) to control fields hash(= get-))
#and a pointer to the prefix_data hash
#render initial panel
my $c = shift;
$c->app->log->info($c->log_req);
#The most common ones
my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
my $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
my $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
my $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
my $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
my %lets_data = ();
my $title = $c->l('lets_Letsencrypt_certificate');
my $modul = '';
$lets_data{'trt'} = 'LIST';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
my $db = $cdb; #pickup local or global db or Default to config
$c->do_display($lets_data{'trt'});
} ## end sub main
# Post request with params - submit from the form
sub do_update {
#
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
# parameters in the params hash.
#
#load up all params into prefix_data hash:
#By panel (series of if statements - only one executed):
#call validate-PANEL() - return ret = ok or error message
#if validation not ok:
#render back to current panel with error message in stash
#otherwise:
#By panel (series of if statements - only one executed):
#do whatever is required: call perform-PANEL() - return "ok" or Error Message
#call signal-event for any global actions specified (check it exists - error and continue?)
#if action smeserver-<whatever>-update exists
#signal_event smeserver-<whatever>-update
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
#set success in stash
#if no "nextpanel" entry:
#set firstpanel
#else
#set nextpanel
#call render
my $c = shift;
$c->app->log->info($c->log_req);
my $modul = '';
#The most common ones - you might want to comment out any not used.
my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
my $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
my $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
my $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
my $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
my %lets_data = ();
my $title = $c->l('lets_Letsencrypt_certificate');
# Accessing all POST parameters
my %params = $c->req->params->to_hash;
# Get number of POST parameters
my $num_params = keys %params;
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $lets_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'LIST'; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
my $thispanel;
if ($trt eq 'LIST') {
#Validate form parameters for panel LIST
$ret = $c->validate_LIST(\%lets_data);
$thispanel = 'LIST';
} ## end if ($trt eq 'LIST')
if ($trt eq 'PARAMS') {
#Validate form parameters for panel PARAMS
$ret = $c->validate_PARAMS(\%lets_data);
$thispanel = 'PARAMS';
} ## end if ($trt eq 'PARAMS')
if ($trt eq 'CHECKALLDOMAINS') {
#Validate form parameters for panel CHECKALLDOMAINS
$ret = $c->validate_CHECKALLDOMAINS(\%lets_data);
$thispanel = 'CHECKALLDOMAINS';
} ## end if ($trt eq 'CHECKALLDOMAINS')
if ($trt eq 'CHECKALLENABLEDDOMAINS') {
#Validate form parameters for panel CHECKALLENABLEDDOMAINS
$ret = $c->validate_CHECKALLENABLEDDOMAINS(\%lets_data);
$thispanel = 'CHECKALLENABLEDDOMAINS';
} ## end if ($trt eq 'CHECKALLENABLEDDOMAINS')
if ($trt eq 'CHECKONEDOMAIN') {
#Validate form parameters for panel CHECKONEDOMAIN
$ret = $c->validate_CHECKONEDOMAIN(\%lets_data);
$thispanel = 'CHECKONEDOMAIN';
} ## end if ($trt eq 'CHECKONEDOMAIN')
if ($ret ne "ok") {
$c->do_display($thispanel);
} else {
#Do whatever is needed, including writing values to the DB
if ($trt eq 'LIST') {
#do whatever is required ...
$ret = $c->perform_LIST(\%lets_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} else {
$c->stash(success => $c->l('lets_LIST_panel_action_was_successful'))
; #A bit bland - edit it in the lex file
}
} ## end if ($trt eq 'LIST')
if ($trt eq 'PARAMS') {
#do whatever is required ...
$ret = $c->perform_PARAMS(\%lets_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} else {
$c->stash(success => $c->l('lets_PARAMS_panel_action_was_successful'))
; #A bit bland - edit it in the lex file
}
} ## end if ($trt eq 'PARAMS')
if ($trt eq 'CHECKALLDOMAINS') {
#do whatever is required ...
$ret = $c->perform_CHECKALLDOMAINS(\%lets_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} else {
$c->stash(success => $c->l('lets_CHECKALLDOMAINS_panel_action_was_successful'))
; #A bit bland - edit it in the lex file
}
} ## end if ($trt eq 'CHECKALLDOMAINS')
if ($trt eq 'CHECKALLENABLEDDOMAINS') {
#do whatever is required ...
$ret = $c->perform_CHECKALLENABLEDDOMAINS(\%lets_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} else {
$c->stash(success => $c->l('lets_CHECKALLENABLEDDOMAINS_panel_action_was_successful'))
; #A bit bland - edit it in the lex file
}
} ## end if ($trt eq 'CHECKALLENABLEDDOMAINS')
if ($trt eq 'CHECKONEDOMAIN') {
#do whatever is required ...
$ret = $c->perform_CHECKONEDOMAIN(\%lets_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} else {
$c->stash(success => $c->l('lets_CHECKONEDOMAIN_panel_action_was_successful'))
; #A bit bland - edit it in the lex file
}
} ## end if ($trt eq 'CHECKONEDOMAIN')
# and call any signal-events needed
#TBD
# Setup shared data and call panel
if ('none' eq 'none') {
$lets_data{'trt'} = 'LIST';
} else {
$lets_data{'trt'} = 'none';
}
$c->do_display($lets_data{'trt'});
} ## end else [ if ($ret ne "ok") ]
} ## end sub do_update
sub do_display {
#
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
#
# OR it maybe a post from the main panel to add a new record
#
#load up all supplied params into prefix_data hash
#call get-selected-PANEL() - returns hash of all relevent parameters
#load up returned hash into prefix_data
#render - to called panel
my ($c, $trt) = @_;
$c->app->log->info($c->log_req);
#The most common ones - you might want to comment out any not used.
my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
my $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
my $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
my $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
my $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
my %lets_data = ();
my $title = $c->l('lets_Letsencrypt_certificate');
my $modul = "";
# Accessing all parameters
my $params = $c->req->params->to_hash;
# Get number of parameters
my $num_params = scalar keys %$params;
#Tag as Post or Get (ie. create new entry or edit existing one
my $is_new_record = ($c->req->method() eq 'POST');
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $lets_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
if (!$trt) {
$trt = $c->param('trt') || 'LIST'; #Indicates where to go now
}
# Now add in the params from the selected row from the table
my %selectedrow;
if ($trt eq 'LIST') {
#Validate Get selected row (if applicable) LIST
%selectedrow = $c->get_selected_LIST($lets_data{'Selected'}, $is_new_record);
} ## end if ($trt eq 'LIST')
if ($trt eq 'PARAMS') {
#Validate Get selected row (if applicable) PARAMS
%selectedrow = $c->get_selected_PARAMS($lets_data{'Selected'}, $is_new_record);
} ## end if ($trt eq 'PARAMS')
if ($trt eq 'CHECKALLDOMAINS') {
#Validate Get selected row (if applicable) CHECKALLDOMAINS
%selectedrow = $c->get_selected_CHECKALLDOMAINS($lets_data{'Selected'}, $is_new_record);
} ## end if ($trt eq 'CHECKALLDOMAINS')
if ($trt eq 'CHECKALLENABLEDDOMAINS') {
#Validate Get selected row (if applicable) CHECKALLENABLEDDOMAINS
%selectedrow = $c->get_selected_CHECKALLENABLEDDOMAINS($lets_data{'Selected'}, $is_new_record);
} ## end if ($trt eq 'CHECKALLENABLEDDOMAINS')
if ($trt eq 'CHECKONEDOMAIN') {
#Validate Get selected row (if applicable) CHECKONEDOMAIN
%selectedrow = $c->get_selected_CHECKONEDOMAIN($lets_data{'Selected'}, $is_new_record);
} ## end if ($trt eq 'CHECKONEDOMAIN')
#Copy in the selected row params to the prefix_data hash to pass to the panel
while (my ($key, $value) = each %selectedrow) {
$lets_data{$key} = $value;
}
# Where to go now
$lets_data{'trt'} = $trt;
# Set up other shared data according to the panel to go to
if ($trt eq 'LIST') {
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_LIST();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$lets_data{$key} = $value;
}
} ## end if ($trt eq 'LIST')
if ($trt eq 'PARAMS') {
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_PARAMS();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$lets_data{$key} = $value;
}
} ## end if ($trt eq 'PARAMS')
if ($trt eq 'CHECKALLDOMAINS') {
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_CHECKALLDOMAINS();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$lets_data{$key} = $value;
}
} ## end if ($trt eq 'CHECKALLDOMAINS')
if ($trt eq 'CHECKALLENABLEDDOMAINS') {
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_CHECKALLENABLEDDOMAINS();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$lets_data{$key} = $value;
}
} ## end if ($trt eq 'CHECKALLENABLEDDOMAINS')
if ($trt eq 'CHECKONEDOMAIN') {
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_CHECKONEDOMAIN();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$lets_data{$key} = $value;
}
} ## end if ($trt eq 'CHECKONEDOMAIN')
# and table control fields
$c->stash(DomainList => $c->get_DomainList());
# Data for panel
$c->stash(
title => $title,
modul => $modul,
lets_data => \%lets_data
);
$c->render(template => "letsencrypt");
} ## end sub do_display
1;

View File

@@ -0,0 +1,39 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-09 17:25:37
%#
<div id="Letsencrypt-CHECKALLDOMAINS" class="partial Letsencrypt-CHECKALLDOMAINS">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if ($config->{debug} == 1) {
<pre>
%= dumper $lets_data
</pre>
% }
% my $btn = l('lets_APPLY');
%= form_for "letsencryptu" => (method => 'POST') => begin
% param 'trt' => $lets_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $lets_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('lets_Check_all_domains')%></h1>
<h2 class='subh'><%=l('lets_Loop_through_checking_the_letsencrypt')%></h2>
<span class=label>
%=l('lets_All_domains_check_result')
</span><span class=data>
% param 'AllDomainsCheck' => $lets_data->{AllDomainsCheck} unless param 'AllDomainsCheck';
%= text_area 'AllDomainsCheck', cols=>40, rows=>10, Readonly=>'true'
</span><br>
<span class='data'>
%= submit_button l('lets_Back'), class => 'action back', onclick =>'history.back()'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,39 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-09 17:25:37
%#
<div id="Letsencrypt-CHECKALLENABLEDDOMAINS" class="partial Letsencrypt-CHECKALLENABLEDDOMAINS">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if ($config->{debug} == 1) {
<pre>
%= dumper $lets_data
</pre>
% }
% my $btn = l('lets_APPLY');
%= form_for "letsencryptu" => (method => 'POST') => begin
% param 'trt' => $lets_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $lets_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('lets_Check_all_enabled_domains')%></h1>
<h2 class='subh'><%=l('lets_Loop_through_checking_the_letsencrypt')%></h2>
<span class=label>
%=l('lets_Enabled_domains_check_result')
</span><span class=data>
% param 'EnabledDomainsCheck' => $lets_data->{EnabledDomainsCheck} unless param 'EnabledDomainsCheck';
%= text_area 'EnabledDomainsCheck', cols=>40, rows=>10, Readonly=>'true'
</span><br>
<span class='data'>
%= submit_button l('lets_Back'), class => 'action back', onclick =>'history.back()'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,46 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-09 17:25:37
%#
<div id="Letsencrypt-CHECKONEDOMAIN" class="partial Letsencrypt-CHECKONEDOMAIN">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if ($config->{debug} == 1) {
<pre>
%= dumper $lets_data
</pre>
% }
% my $btn = l('lets_APPLY');
%= form_for "letsencryptu" => (method => 'POST') => begin
% param 'trt' => $lets_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $lets_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('lets_Check_just_one_domain')%></h1>
<h2 class='subh'><%=l('lets_Loop_through_and_check_the')%></h2>
<p><span class=label>
%=l('lets_Domains_name')
</span><span class=data>
% param 'OneDomainToCheck' => $lets_data->{OneDomainToCheck} unless param 'OneDomainToCheck';
%= text_field 'OneDomainToCheck', size => '50', class => 'textinput OneDomainToCheck' , pattern=>'.*' , placeholder=>'OneDomainToCheck', Readonly=>'true'
<br></span></p>
<span class=label>
%=l('lets_One_domain_check_result')
</span><span class=data>
% param 'OneDomainsCheck' => $lets_data->{OneDomainsCheck} unless param 'OneDomainsCheck';
%= text_area 'OneDomainsCheck', cols=>40, rows=>10, Readonly=>'true'
</span><br>
<span class='data'>
%= submit_button l('lets_Back'), class => 'action back', onclick =>'history.back()'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,126 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-09 17:25:37
%#
<div id="Letsencrypt-LIST" class="partial Letsencrypt-LIST">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if ($config->{debug} == 1) {
<pre>
%= dumper $lets_data
</pre>
% }
% my $btn = l('lets_APPLY');
%= form_for "letsencryptu" => (method => 'POST') => begin
% param 'trt' => $lets_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $lets_data->{trt}
%# Inputs etc in here.
<div class=inline-buttons>
<a href='letsencryptd?trt=PARAMS' class='link link2'>
%= l('lets_CONFIG')
</a>
%#= link_to l('lets_CONFIG'), 'letsencryptd?trt=PARAMS' , class=>'link link2'
<a href='letsencryptd?trt=CHECKALLDOMAINS' class='link link3'>
%= l('lets_CHECK_ALL_DOMAINS')
</a>
%#= link_to l('lets_CHECK_ALL_DOMAINS'), 'letsencryptd?trt=CHECKALLDOMAINS' , class=>'link link3'
<a href='letsencryptd?trt=CHECKALLENABLEDDOMAINS' class='link link4'>
%= l('lets_CHECK_ALL_ENABLED_DOMAINS')
</a>
%#= link_to l('lets_CHECK_ALL_ENABLED_DOMAINS'), 'letsencryptd?trt=CHECKALLENABLEDDOMAINS' , class=>'link link4'
</div>
<h2 class='subh2'><%=l('lets_For_this_Server')%></h2>
<p><span class=label>
%=l('lets_Internal_IP')
</span><span class=data>
% param 'InternalIP' => $lets_data->{InternalIP} unless param 'InternalIP';
%= text_field 'InternalIP', size => '50', class => 'textinput InternalIP' , pattern=>'.*' , placeholder=>'InternalIP', Readonly=>'true'
<br></span></p>
<p><span class=label>
%=l('lets_External_Interface_IP')
</span><span class=data>
% param 'ExternalIP' => $lets_data->{ExternalIP} unless param 'ExternalIP';
%= text_field 'ExternalIP', size => '50', class => 'textinput ExternalIP' , pattern=>'.*' , placeholder=>'ExternalIP', Readonly=>'true'
<br></span></p>
<p><span class=label>
%=l('lets_Internet_IP')
</span><span class=data>
% param 'InternetIP' => $lets_data->{InternetIP} unless param 'InternetIP';
%= text_field 'InternetIP', size => '50', class => 'textinput InternetIP' , pattern=>'.*' , placeholder=>'InternetIP', Readonly=>'true'
<br></span></p>
<h2 class='subh3'><%=l('lets_Current_certificate_details')%></h2>
<span class=label>
%=l('lets_Issuer')
</span><span class=data>
% param 'Issuer' => $lets_data->{Issuer} unless param 'Issuer';
%= text_area 'Issuer', cols=>40, rows=>10, Readonly=>'true'
</span><br>
<p><span class=label>
%=l('lets_Expiry')
</span><span class=data>
% param 'Expiry' => $lets_data->{Expiry} unless param 'Expiry';
%= text_field 'Expiry', size => '50', class => 'textinput Expiry' , pattern=>'.*' , placeholder=>'Expiry', Readonly=>'true'
<br></span></p>
<p><span class=label>
%=l('lets_Not_Before')
</span><span class=data>
% param 'NotBefore' => $lets_data->{NotBefore} unless param 'NotBefore';
%= text_field 'NotBefore', size => '50', class => 'textinput NotBefore' , pattern=>'.*' , placeholder=>'NotBefore', Readonly=>'true'
<br></span></p>
<h2 class='subh4'><%=l('lets_List_of_Domains_and_Hosts')%></h2>
<br /><table class="sme-border TableSort sme-table tabl1 ">
<thead class='tabl1'>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Domain name / HOSTNAME '><%=l('lets_Domain_name_/_HOSTNAME')%></th>
<th class='sme-border table-head-col table-head-col-Brief description '><%=l('lets_Brief_description')%></th>
<th class='sme-border table-head-col table-head-col-Content '><%=l('lets_Content')%></th>
<th class='sme-border table-head-col table-head-col-LABEL_NAMESERVERS '><%=l('lets_LABEL_NAMESERVERS')%></th>
<th class='sme-border table-head-col table-head-col-LABEL_POINT '><%=l('lets_LABEL_POINT')%></th>
<th class='sme-border table-head-col table-head-col-LABEL_LECERT '><%=l('lets_LABEL_LECERT')%></th>
<th class='sme-border table-head-col table-head-col-IS_IN_CERT '><%=l('lets_IS_IN_CERT')%></th>
<th class='sme-border table-head-col table-head-col-CHECK '><%=l('lets_CHECK')%></th>
</tr>
</thead>
<tbody class='tabl1'>
% my $control_data = $c->stash('DomainList');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Table1-Domain name / HOSTNAME'><%=$c->render_to_string(inline=>$row->{'Table1-Domain name / HOSTNAME'})%></td>
<td class='sme-border table-col table-col-Table1-Brief description'><%=$c->render_to_string(inline=>$row->{'Table1-Brief description'})%></td>
<td class='sme-border table-col table-col-Table1-Content'><%=$c->render_to_string(inline=>$row->{'Table1-Content'})%></td>
<td class='sme-border table-col table-col-Table1-LABEL_NAMESERVERS'><%=$c->render_to_string(inline=>$row->{'Table1-LABEL_NAMESERVERS'})%></td>
<td class='sme-border table-col table-col-Table1-LABEL_POINT'><%=$c->render_to_string(inline=>$row->{'Table1-LABEL_POINT'})%></td>
<td class='sme-border table-col table-col-Table1-LABEL_LECERT'><%=$c->render_to_string(inline=>$row->{'Table1-LABEL_LECERT'})%></td>
<td class='sme-border table-col table-col-Table1-IS_IN_CERT'><%=$c->render_to_string(inline=>$row->{'Table1-IS_IN_CERT'})%></td>
<td class='sme-border table-col table-col-Table1-CHECK'><%=$c->render_to_string(inline=>$row->{'Table1-CHECK'})%></td>
</tr>
%}
</tbody>
</table>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,97 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-09 17:25:37
%#
<div id="Letsencrypt-PARAMS" class="partial Letsencrypt-PARAMS">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if ($config->{debug} == 1) {
<pre>
%= dumper $lets_data
</pre>
% }
% my $btn = l('lets_APPLY');
%= form_for "letsencryptu" => (method => 'POST') => begin
% param 'trt' => $lets_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $lets_data->{trt}
%# Inputs etc in here.
<h2 class='subh'><%=l('lets_Manage_letsencrypt-config_settings:')%></h2>
<p class='paragraph para1'>
%=l('lets_CONFIG_LETSENCRYPT')
</p>
<p><span class=label>
%=l('lets_SERVICE_STATUS')
</span><span class=data>
% my @status_options = [['Disabled' => 'disabled'], ['Enabled' => 'enabled'], ['TEST' => 'test']];
% param 'status' => $lets_data->{status} unless param 'status';
%= select_field 'status' => @status_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('lets_HOOKSCRIPT_STATUS')
</span><span class=data>
% my @hookScript_options = [['Disabled' => 'disabled'], ['Enabled' => 'enabled']];
% param 'hookScript' => $lets_data->{hookScript} unless param 'hookScript';
%= select_field 'hookScript' => @hookScript_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('lets_HOSTOVERRIDE_STATUS')
</span><span class=data>
% my @hostOverride_options = [['Disabled' => 'disabled'], ['Yes' => 'yes']];
% param 'hostOverride' => $lets_data->{hostOverride} unless param 'hostOverride';
%= select_field 'hostOverride' => @hostOverride_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('lets_ACCEPT_TERMS_STATUS')
</span><span class=data>
% my @ACCEPT_TERMS_options = [['Disabled' => 'disabled'], ['Yes' => 'yes']];
% param 'ACCEPT_TERMS' => $lets_data->{ACCEPT_TERMS} unless param 'ACCEPT_TERMS';
%= select_field 'ACCEPT_TERMS' => @ACCEPT_TERMS_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('lets_API_STATUS')
</span><span class=data>
% my @API_options = [['2' => '2']];
% param 'API' => $lets_data->{API} unless param 'API';
%= select_field 'API' => @API_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('lets_KEYSIZE_STATUS')
</span><span class=data>
% my @keysize_options = [['2048' => '2048'], ['3072' => '3072'], ['4096' => '4096']];
% param 'keysize' => $lets_data->{keysize} unless param 'keysize';
%= select_field 'keysize' => @keysize_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('lets_CONFIGUREMODE_STATUS')
</span><span class=data>
% my @configure_options = [['ALL' => 'all'], ['Domains' => 'domains'], ['HOSTS' => 'hosts'], ['NONE' => 'none']];
% param 'configure' => $lets_data->{configure} unless param 'configure';
%= select_field 'configure' => @configure_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('lets_EMAIL')
</span><span class=data>
% param 'email' => $lets_data->{email} unless param 'email';
%=email_field 'email', class => 'emai8'
</span></p>
<span class='data'>
%= submit_button l('lets_Save'), class => 'action subm9'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,90 @@
/*
Generated by SM2Gen version: SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-01 15:22:43
*/
.Letsencrypt-panel {}
.name {}
.rout {}
.grou {}
.link2 {}
.link3 {}
.link4 {}
.endg {}
.subh2 {}
.read4 {}
.read5 {}
.read6 {}
.subh3 {}
.read1 {}
.read2 {}
.read3 {}
.subh4 {}
.tabl1 {}
thead .tabl1 {}
tbody .tabl1 {}
.name {}
.rout {}
.subh {}
.para1 {}
.sele1 {}
.sele2 {}
.sele3 {}
.sele4 {}
.sele5 {}
.sele6 {}
.sele7 {}
.emai8 {}
.subm9 {}
.name {}
.rout {}
.head {}
.subh {}
.text1 {}
.back2 {}
.name {}
.rout {}
.head {}
.subh {}
.text1 {}
.back2 {}
.name {}
.rout {}
.head {}
.subh {}
.read1 {}
.text2 {}
.back3 {}
.inline-buttons {
display: flex; /* Use flexbox to arrange items horizontally */
gap: 10px; /* Optional: Add space between buttons */
}
.inline-buttons .link {
/* Additional styling can be added here if needed */
}
.inline-buttons .link {
display: inline-block; /* Keep links as inline-block for button shape */
padding: 7px 14px; /* Adjusted padding to approximate 70% of the original */
margin: 0; /* Remove margin */
background-color: #efefef; /* Light gray background color */
color: black; /* Text color */
text-decoration: none; /* Remove underline */
border: 2px solid #bbb; /* Thin, light gray border */
border-radius: 3px; /* Slightly rounded corners */
font-size: 11.2px; /* Adjusted font size to approximate 70% of the original */
text-align: center; /* Center the text */
cursor: pointer; /* Pointer cursor on hover */ }
/* Hover and active effects for better interaction */
.inline-buttons .link:hover {
background-color: #d9d9d9; /* Darker shade on hover */
}
.inline-buttons .link:active {
background-color: #c0c0c0; /* Even darker shade on click */
}
span .label {
padding-top:13em;
}

View File

@@ -0,0 +1,69 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-09 17:25:37
%#
% layout 'default', title => "Sme server 2 - Letsencrypt certificate", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/letsencrypt.css'
<div id="module" class="module Letsencrypt-panel">
% if ($config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $lets_data->{trt}
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><p>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</p>
%} elsif ($c->stash('success')) {
<div class='success '>
<h2><%=$c->l('lets_Status_Report') %></h2><p>
%= $c->l($c->stash('success'));
</p>
</div>
%} elsif ($c->stash('error')) {
<div class='sme-error'>
<h2><%=$c->l('lets_Error_Status_Report') %></h2><p>
%= $c->l($c->stash('error'));
</p>
</div>
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($lets_data->{trt} eq "LIST") {
%= include 'partials/_lets_LIST'
%}
% if ($lets_data->{trt} eq "PARAMS") {
%= include 'partials/_lets_PARAMS'
%}
% if ($lets_data->{trt} eq "CHECKALLDOMAINS") {
%= include 'partials/_lets_CHECKALLDOMAINS'
%}
% if ($lets_data->{trt} eq "CHECKALLENABLEDDOMAINS") {
%= include 'partials/_lets_CHECKALLENABLEDDOMAINS'
%}
% if ($lets_data->{trt} eq "CHECKONEDOMAIN") {
%= include 'partials/_lets_CHECKONEDOMAIN'
%}
</div>
%end

View File

@@ -0,0 +1,54 @@
#
# Generated by SM2Gen version: SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-12-09 17:25:37
#
'lets_Enabled_domains_check_result' => 'Enabled domains check result',
'lets_CHECKALLENABLEDDOMAINS_panel_action_was_successful' => 'CHECKALLENABLEDDOMAINS panel action was successful',
'lets_Status_Report' => 'Status Report',
'lets_Current_certificate_details' => 'Current certificate details',
'lets_SERVICE_STATUS' => 'Service Status',
'lets_HOOKSCRIPT_STATUS' => 'Hookscript Status',
'lets_EMAIL' => 'Email',
'lets_Brief_description' => 'Brief description',
'lets_KEYSIZE_STATUS' => 'Keysize Status',
'lets_Loop_through_checking_the_letsencrypt' => 'Loop through checking the letsencrypt status for each configured domain',
'lets_LABEL_NAMESERVERS' => 'Label timeservers',
'lets_CHECKALLDOMAINS_panel_action_was_successful' => 'CHECKALLDOMAINS panel action was successful',
'lets_Letsencrypt_certificate' => 'Letsencrypt certificate',
'lets_APPLY' => 'Apply',
'lets_All_domains_check_result' => 'All domains check result',
'lets_API_STATUS' => 'ape Status',
'lets_External_Interface_IP' => 'External Interface IP',
'lets_CHECK' => 'Check',
'lets_Check_just_one_domain' => 'Check just one domain',
'lets_One_domain_check_result' => 'One domain check result',
'lets_LABEL_LECERT' => 'Label secret',
'lets_Internet_IP' => 'Internet IP',
'lets_CONFIG' => 'Config',
'lets_Check_all_enabled_domains' => 'Check all enabled domains',
'lets_Issuer' => 'Issuer',
'lets_CHECKONEDOMAIN_panel_action_was_successful' => 'CHECKONEDOMAIN panel action was successful',
'lets_CONFIG_LETSENCRYPT' => 'confirm Letsencrypt',
'lets_Content' => 'Content',
'lets_Check_all_domains' => 'Check all domains',
'lets_HOSTOVERRIDE_STATUS' => 'Hostoverride Status',
'lets_Internal_IP' => 'Internal IP',
'lets_Back' => 'Back',
'lets_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful',
'lets_Expiry' => 'Expiry',
'lets_Error_Status_Report' => 'Error Status Report',
'lets_For_this_Server' => 'For this Server',
'lets_List_of_Domains_and_Hosts' => 'List of Domains and Hosts',
'lets_Loop_through_and_check_the' => 'Loop through and check the letsencrypt status for a specific domain',
'lets_CHECK_ALL_DOMAINS' => 'Check All Domains',
'lets_IS_IN_CERT' => 'Is In cart',
'lets_Manage_letsencrypt-config_settings:' => 'Manage letsencrypt-config settings',
'lets_LABEL_POINT' => 'Label Point',
'lets_Domain_name_/_HOSTNAME' => 'Domain name / HOSTNAME',
'lets_LIST_panel_action_was_successful' => 'LIST panel action was successful',
'lets_Domains_name' => 'Domains name',
'lets_Loop_through_checking_the_letsencrypt' => 'Loop through checking the letsencrypt status for each configured domain which is enabled',
'lets_CHECK_ALL_ENABLED_DOMAINS' => 'Check All Enabled Domains',
'lets_CONFIGUREMODE_STATUS' => 'Configuremode Status',
'lets_Save' => 'Save',
'lets_ACCEPT_TERMS_STATUS' => 'Accept Terms Status',
'lets_Not_Before' => 'Not Before',

View File

@@ -0,0 +1,289 @@
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-04 12:59:05
#
#
# Routines to be edited by the developer to provide content and validation for parameters
# and provison of the control data for table(s)
#
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::DomainsDB;
use constant FALSE => 0;
use constant TRUE => 1;
#The most common ones
#my $cdb
#my $adb
#my $ndb
#my $hdb
#my $ddb
# Validation routines - parameters for each panel
sub validate_TABLE {
my $c = shift;
my $ms_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (! TRUE) #validate $c->param('account')
{$ret .= 'Validation for account failed';}
if (! TRUE) #validate $c->param('username')
{$ret .= 'Validation for username failed';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub validate_RULES {
my $c = shift;
my $ms_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (! TRUE) #validate $c->param('basis')
{$ret .= 'Validation for basis failed';}
if (! TRUE) #validate $c->param('criterion')
{$ret .= 'Validation for criterion failed';}
if (! TRUE) #validate $c->param('basis2')
{$ret .= 'Validation for basis2 failed';}
if (! TRUE) #validate $c->param('criterion2')
{$ret .= 'Validation for criterion2 failed';}
if (! TRUE) #validate $c->param('action')
{$ret .= 'Validation for action failed';}
if (! TRUE) #validate $c->param('deliver')
{$ret .= 'Validation for deliver failed';}
if (! TRUE) #validate $c->param('folder')
{$ret .= 'Validation for folder failed';}
if (! TRUE) #validate $c->param('copy')
{$ret .= 'Validation for copy failed';}
if (! TRUE) #validate $c->param('action2')
{$ret .= 'Validation for action2 failed';}
if (! TRUE) #validate $c->param('deliver2')
{$ret .= 'Validation for deliver2 failed';}
if (! TRUE) #validate $c->param('key')
{$ret .= 'Validation for key failed';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub validate_REMOVE {
my $c = shift;
my $ms_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (! TRUE) #validate $c->param('RemoveRule')
{$ret .= 'Validation for RemoveRule failed';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
# Get singleton data for each panel
sub get_data_for_panel_TABLE {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1'=>'Data for TABLE', #Example
# fields from Inputs in TABLE $fields['TABLE']
'account'=>'account contents',
'username'=>'username contents',
);
return %ret;
}
sub get_data_for_panel_RULES {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1'=>'Data for RULES', #Example
# fields from Inputs in RULES $fields['RULES']
'basis'=>'basis contents',
'criterion'=>'criterion contents',
'basis2'=>'basis2 contents',
'criterion2'=>'criterion2 contents',
'action'=>'action contents',
'deliver'=>'deliver contents',
'folder'=>'folder contents',
'copy'=>'copy contents',
'action2'=>'action2 contents',
'deliver2'=>'deliver2 contents',
'key'=>'key contents',
);
return %ret;
}
sub get_data_for_panel_REMOVE {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1'=>'Data for REMOVE', #Example
# fields from Inputs in REMOVE $fields['REMOVE']
'RemoveRule'=>'RemoveRule contents',
);
return %ret;
}
# Get control data for table(s)
# Define a constant hash for field name mapping
use constant getAllRules_FIELD_MAPPING => (
'MatchAgainst' => 'Source-for-MatchAgainst',
'TheRule' => 'Source-for-TheRule',
'c2ndMatch' => 'Source-for-c2ndMatch',
'c2ndRule' => 'Source-for-c2ndRule',
'Action' => 'Source-for-Action',
'Destination' => 'Source-for-Destination',
'Copy' => 'Source-for-Copy',
'Destination' => 'Source-for-Destination',
'Serial Number' => 'Source-for-Serial Number',
'Modify' => 'Source-for-Modify',
'Remove' => 'Source-for-Remove'
#'target_field2' => 'source_field2',
# Add more mappings as needed
);
sub actual_getAllRules {
my @ret = ();
# Actual code for extracting getAllRules
return @ret;
}
sub get_getAllRules {
# Return an array of hashes of the contents for each row and column for getAllRules
my $c = shift;
my @source_records = $c->actual_getAllRules();
my @transformed_records;
my %Field_Mapping = getAllRules_FIELD_MAPPING();
# Iterate over each record in the source array
for my $source_record (@source_records) {
my %transformed_record;
# Iterate over each key-value pair in the $Field_Mapping constant
while (my ($target, $source) = each %Field_Mapping) {
# Check if the source field exists in the source record
if (exists $source_record->{$source}) {
# Assign the source field value to the target field in the transformed record
$transformed_record{$target} = $source_record->{$source};
}
}
# Add transformed record to the array if it's not empty
push @transformed_records, \%transformed_record if %transformed_record;
}
return \@transformed_records;
}
# Return hash with values from row in which link clicked on table
sub get_selected_TABLE {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
}
sub get_selected_RULES {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
}
sub get_selected_REMOVE {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
}
#after sucessful modify or create or whatever and submit then perfom (if the params validate)
sub perform_TABLE {
my $c = shift;
my $ms_data = shift; #Data hash as parameter
my $ret = "";
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
if (! TRUE) #copy or perform with value: account e.g. $db->set_prop($dbkey,'account',$c->param('account'),type=>'service'))
{$ret .= 'Perform/save failed for account';}
if (! TRUE) #copy or perform with value: username e.g. $db->set_prop($dbkey,'username',$c->param('username'),type=>'service'))
{$ret .= 'Perform/save failed for username';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub perform_RULES {
my $c = shift;
my $ms_data = shift; #Data hash as parameter
my $ret = "";
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
if (! TRUE) #copy or perform with value: basis e.g. $db->set_prop($dbkey,'basis',$c->param('basis'),type=>'service'))
{$ret .= 'Perform/save failed for basis';}
if (! TRUE) #copy or perform with value: criterion e.g. $db->set_prop($dbkey,'criterion',$c->param('criterion'),type=>'service'))
{$ret .= 'Perform/save failed for criterion';}
if (! TRUE) #copy or perform with value: basis2 e.g. $db->set_prop($dbkey,'basis2',$c->param('basis2'),type=>'service'))
{$ret .= 'Perform/save failed for basis2';}
if (! TRUE) #copy or perform with value: criterion2 e.g. $db->set_prop($dbkey,'criterion2',$c->param('criterion2'),type=>'service'))
{$ret .= 'Perform/save failed for criterion2';}
if (! TRUE) #copy or perform with value: action e.g. $db->set_prop($dbkey,'action',$c->param('action'),type=>'service'))
{$ret .= 'Perform/save failed for action';}
if (! TRUE) #copy or perform with value: deliver e.g. $db->set_prop($dbkey,'deliver',$c->param('deliver'),type=>'service'))
{$ret .= 'Perform/save failed for deliver';}
if (! TRUE) #copy or perform with value: folder e.g. $db->set_prop($dbkey,'folder',$c->param('folder'),type=>'service'))
{$ret .= 'Perform/save failed for folder';}
if (! TRUE) #copy or perform with value: copy e.g. $db->set_prop($dbkey,'copy',$c->param('copy'),type=>'service'))
{$ret .= 'Perform/save failed for copy';}
if (! TRUE) #copy or perform with value: action2 e.g. $db->set_prop($dbkey,'action2',$c->param('action2'),type=>'service'))
{$ret .= 'Perform/save failed for action2';}
if (! TRUE) #copy or perform with value: deliver2 e.g. $db->set_prop($dbkey,'deliver2',$c->param('deliver2'),type=>'service'))
{$ret .= 'Perform/save failed for deliver2';}
if (! TRUE) #copy or perform with value: key e.g. $db->set_prop($dbkey,'key',$c->param('key'),type=>'service'))
{$ret .= 'Perform/save failed for key';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub perform_REMOVE {
my $c = shift;
my $ms_data = shift; #Data hash as parameter
my $ret = "";
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
if (! TRUE) #copy or perform with value: RemoveRule e.g. $db->set_prop($dbkey,'RemoveRule',$c->param('RemoveRule'),type=>'service'))
{$ret .= 'Perform/save failed for RemoveRule';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub create_link{
# WIP
my ($c,$route, $panel, $index) = @_;
my $link = "$route?trt=$panel&Selected=$index";
return $link;
}
1;

View File

@@ -0,0 +1,357 @@
package SrvMngr::Controller::Mailsorting;
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-04 12:59:05
# Remember that each route must be unique (else they just overwrite each other).
# you cannot have get and post on the same name and url.
#
#----------------------------------------------------------------------
# heading : System
# description : Process Mail
# navigation : 6000 1200
#
# name : mailsorting, method : get, url : /mailsorting, ctlact : Mailsorting#main
# name : mailsortingu, method : post, url : /mailsortingu, ctlact : Mailsorting#do_update
# name : mailsortingd, method : get, url : /mailsortingd, ctlact : Mailsorting#do_display
#
# routes : end
#
# Documentation: https://wiki.contribs.org/Mailsorting
#----------------------------------------------------------------------
#
# Scheme of things:
#
# TBA!!
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use constant FALSE => 0;
use constant TRUE => 1;
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
my $cdb;
my $adb;
my $ndb;
my $hdb;
my $ddb;
my %ms_data;
require '/usr/share/smanager/lib/SrvMngr/Controller/Mailsorting-Custom.pm'; #The code that is to be added by the developer
sub main {
#
# Initial entry - route is "/<whatever>"
#
#set initial panel
#for initial panel:
#Specifiy panel to enter
#load up _data hash with DB fields
#load up stash with pointer(s) to control fields hash(= get-))
#and a pointer to the prefix_data hash
#render initial panel
my $c = shift;
$c->app->log->info( $c->log_req );
#The most common ones
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
%ms_data = ();
my $title = $c->l('ms_Process_Mail');
my $modul = '';
$ms_data{'trt'} = 'TABLE';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
my $db = $cdb; #pickup local or global db or Default to config
$c->do_display($ms_data{'trt'});
}
# Post request with params - submit from the form
sub do_update {
#
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
# parameters in the params hash.
#
#load up all params into prefix_data hash:
#By panel (series of if statements - only one executed):
#call validate-PANEL() - return ret = ok or error message
#if validation not ok:
#render back to current panel with error message in stash
#otherwise:
#By panel (series of if statements - only one executed):
#do whatever is required: call perform-PANEL() - return "ok" or Error Message
#call signal-event for any global actions specified (check it exists - error and continue?)
#if action smeserver-<whatever>-update exists
#signal_event smeserver-<whatever>-update
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
#set success in stash
#if no "nextpanel" entry:
#set firstpanel
#else
#set nextpanel
#call render
my $c = shift;
$c->app->log->info($c->log_req);
my $modul = '';
#The most common ones - you might want to comment out any not used.
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
my $title = $c->l('ms_Process_Mail');
# Accessing all POST/GET parameters
my $params = $c->req->params->to_hash;
# Get number of POST parameters
#my $num_params = keys scaler %$params;
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $ms_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'TABLE'; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
my $thispanel;
if ($trt eq 'TABLE'){
#Validate form parameters for panel TABLE
$ret = $c->validate_TABLE(\%ms_data);
$thispanel = 'TABLE';
}
if ($trt eq 'RULES'){
#Validate form parameters for panel RULES
$ret = $c->validate_RULES(\%ms_data);
$thispanel = 'RULES';
}
if ($trt eq 'REMOVE'){
#Validate form parameters for panel REMOVE
$ret = $c->validate_REMOVE(\%ms_data);
$thispanel = 'REMOVE';
}
if ($ret ne "ok"){
$c->do_display($thispanel);
} else {
#Do whatever is needed, including writing values to the DB
if ($trt eq 'TABLE'){
#do whatever is required ...
$ret = $c->perform_TABLE(\%ms_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
ms_data => \%ms_data
);
$c->render(template => "mailsorting");
} else {
$c->stash( success => $c->l('ms_TABLE_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'RULES'){
#do whatever is required ...
$ret = $c->perform_RULES(\%ms_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
ms_data => \%ms_data
);
$c->render(template => "mailsorting");
} else {
$c->stash( success => $c->l('ms_RULES_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'REMOVE'){
#do whatever is required ...
$ret = $c->perform_REMOVE(\%ms_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
ms_data => \%ms_data
);
$c->render(template => "mailsorting");
} else {
$c->stash( success => $c->l('ms_REMOVE_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
# and call any signal-events needed
#TBD
# Setup shared data and call panel
if ('none' eq 'none') {
$ms_data{'trt'} = 'TABLE';
} else {
$ms_data{'trt'} = 'none';
}
$c->do_display($ms_data{'trt'});
}
}
sub do_display {
#
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
#
# OR it maybe a post from the main panel to add a new record
#
#load up all supplied params into prefix_data hash
#call get-selected-PANEL() - returns hash of all relevent parameters
#load up returned hash into prefix_data
#render - to called panel
my ($c,$trt) = @_;
$c->app->log->info($c->log_req);
#The most common ones - you might want to comment out any not used.
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
my $title = $c->l('ms_Process_Mail');
my $modul = "";
# Accessing all parameters
my $params = $c->req->params->to_hash;
# Get number of parameters
my $num_params = keys %$params;
#Tag as Post or Get (ie. create new entry or edit existing one
my $is_new_record = ($c->req->method() eq 'POST');
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $ms_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
if (! $trt){
$trt = $c->param('trt') || 'TABLE'; #Indicates where to go now
}
# Now add in the params from the selected row from the table
my %selectedrow;
if ($trt eq 'TABLE'){
#Validate Get selected row (if applicable) TABLE
%selectedrow = $c->get_selected_TABLE($ms_data{'Selected'},$is_new_record);
}
if ($trt eq 'RULES'){
#Validate Get selected row (if applicable) RULES
%selectedrow = $c->get_selected_RULES($ms_data{'Selected'},$is_new_record);
}
if ($trt eq 'REMOVE'){
#Validate Get selected row (if applicable) REMOVE
%selectedrow = $c->get_selected_REMOVE($ms_data{'Selected'},$is_new_record);
}
#Copy in the selected row params to the prefix_data hash to pass to the panel
while (my ($key, $value) = each %selectedrow){
$ms_data{$key} = $value;
}
# Where to go now
$ms_data{'trt'} = $trt;
# Set up other shared data according to the panel to go to
if ($trt eq 'TABLE'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_TABLE();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$ms_data{$key} = $value;
}
}
if ($trt eq 'RULES'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_RULES();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$ms_data{$key} = $value;
}
}
if ($trt eq 'REMOVE'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_REMOVE();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$ms_data{$key} = $value;
}
}
# and table control fields
$c->stash(getAllRules=>$c->get_getAllRules());
# Data for panel
$c->stash(
title => $title,
modul => $modul,
ms_data => \%ms_data
);
$c->render(template => "mailsorting");
}
1;

View File

@@ -0,0 +1,38 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-04 12:59:05
%#
<div id="Mailsorting-REMOVE" class="partial Mailsorting-REMOVE">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if (config->{debug} == 1) {
<pre>
%= dumper $ms_data
</pre>
% }
% my $btn = l('ms_APPLY');
%= form_for "mailsortingu" => (method => 'POST') => begin
% param 'trt' => $ms_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $ms_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('ms_Mail_sorting_rules')%></h1>
<h2 class='subh'><%=l('ms_You_are_about_to_remove')%></h2>
<span class=label>
%=l('ms_Rule_contents')
</span><span class=data>
% param 'RemoveRule' => $ms_data->{RemoveRule} unless param 'RemoveRule';
%= text_area 'RemoveRule', cols=>40, rows=>10, Readonly=>'true','
</span><br>
<span class='data'>
%= submit_button l('ms_Remove'), class => 'action subm95'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,122 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-04 12:59:05
%#
<div id="Mailsorting-RULES" class="partial Mailsorting-RULES">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if (config->{debug} == 1) {
<pre>
%= dumper $ms_data
</pre>
% }
% my $btn = l('ms_APPLY');
%= form_for "mailsortingu" => (method => 'POST') => begin
% param 'trt' => $ms_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $ms_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('ms_Mail_sorting_rules')%></h1>
<h2 class='subh'><%=l('ms_Manage_mailsortingModifyRule_settings:')%></h2>
<p class='paragraph para1'>
%=l('ms_Modify_your_rule.')
</p>
<p class='paragraph para2'>
%=l('ms_You_can_change_the_order')
</p>
<p><span class=label>
%=l('ms_basis')
</span><span class=data>
% my @basis_options = [['Subject' => 'Subject'], ['To' => 'TO_'], ['From' => 'From'], ['Email Headers' => 'headers'], ['Size greater than' => 'sizegt'], ['Size less than' => 'sizelt']];
% param 'basis' => $ms_data->{basis} unless param 'basis';
%= select_field 'basis' => @basis_options, class => 'input', id => 'basis_select'
<br></span> </p>
<p><span class=label>
%=l('ms_criterion')
</span><span class=data>
% param 'criterion' => $ms_data->{criterion} unless param 'criterion';
%= text_field 'criterion', size => '50', class => 'textinput criterion' , pattern=>'.*' , placeholder=>'criterion', title =>'Pattern regex mismatch', id => 'criterion_text'
<br></span></p>
<p><span class=label>
%=l('ms_basis2')
</span><span class=data>
% my @basis2_options = [['' => ''], ['Subject' => 'Subject'], ['To' => 'TO_'], ['From' => 'From'], ['Email Headers' => 'headers']];
% param 'basis2' => $ms_data->{basis2} unless param 'basis2';
%= select_field 'basis2' => @basis2_options, class => 'input', id => 'basis2_select'
<br></span> </p>
<p><span class=label>
%=l('ms_criterion2')
</span><span class=data>
% param 'criterion2' => $ms_data->{criterion2} unless param 'criterion2';
%= text_field 'criterion2', size => '50', class => 'textinput criterion2' , pattern=>'.*' , placeholder=>'criterion2', title =>'Pattern regex mismatch', id => 'criterion2_text'
<br></span></p>
<p><span class=label>
%=l('ms_action')
</span><span class=data>
% my @action_options = [['Delete email' => 'delete'], ['Forward email' => 'forward'], ['Sort to mail folder' => 'sort']];
% param 'action' => $ms_data->{action} unless param 'action';
%= select_field 'action' => @action_options, class => 'input', id => 'action_select'
<br></span> </p>
<p><span class=label>
%=l('ms_deliver')
</span><span class=data>
% param 'deliver' => $ms_data->{deliver} unless param 'deliver';
%= text_field 'deliver', size => '50', class => 'textinput deliver' , pattern=>'.*' , placeholder=>'deliver', title =>'Pattern regex mismatch', id => 'deliver_text'
<br></span></p>
<p><span class=label>
%=l('ms_folder')
</span><span class=data>
% my @folder_options = ;
% param 'folder' => $ms_data->{folder} unless param 'folder';
%= select_field 'folder' => @folder_options, class => 'input', id => 'folder_select'
<br></span> </p>
<p><span class=label>
%=l('ms_copy')
</span><span class=data>
% my @copy_options = [['No' => 'no'], ['Yes' => 'yes']];
% param 'copy' => $ms_data->{copy} unless param 'copy';
%= select_field 'copy' => @copy_options, class => 'input', id => 'copy_select'
<br></span> </p>
<p><span class=label>
%=l('ms_action2')
</span><span class=data>
% my @action2_options = [['' => ''], ['Delete email' => 'delete'], ['Forward email' => 'forward'], ['Send to my inbox' => 'inbox']];
% param 'action2' => $ms_data->{action2} unless param 'action2';
%= select_field 'action2' => @action2_options, class => 'input', id => 'action2_select'
<br></span> </p>
<p><span class=label>
%=l('ms_deliver2')
</span><span class=data>
% param 'deliver2' => $ms_data->{deliver2} unless param 'deliver2';
%= text_field 'deliver2', size => '50', class => 'textinput deliver2' , pattern=>'.*' , placeholder=>'deliver2', title =>'Pattern regex mismatch', id => 'deliver2_text'
<br></span></p>
<p><span class=label>
%=l('ms_key')
</span><span class=data>
% param 'key' => $ms_data->{key} unless param 'key';
%= text_field 'key', size => '50', class => 'textinput key' , pattern=>'.*' , placeholder=>'key', title =>'Pattern regex mismatch', id => 'key_text'
<br></span></p>
<span class='data'>
%= submit_button l('ms_Save'), class => 'action subm12'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,88 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-04 12:59:05
%#
<div id="Mailsorting-TABLE" class="partial Mailsorting-TABLE">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if (config->{debug} == 1) {
<pre>
%= dumper $ms_data
</pre>
% }
% my $btn = l('ms_APPLY');
%= form_for "mailsortingu" => (method => 'POST') => begin
% param 'trt' => $ms_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $ms_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('ms_Mail_sorting_rules')%></h1>
<p class='paragraph para1'>
%=l('ms_Rules_are_executed_as_email')
</p>
<p><span class=label>
%=l('ms_Account')
</span><span class=data>
% param 'account' => $ms_data->{account} unless param 'account';
%= text_field 'account', size => '50', class => 'textinput account' , pattern=>'.*' , placeholder=>'account', title =>'Pattern regex mismatch', id => 'account_text'
<br></span></p>
<p><span class=label>
%=l('ms_User_Name')
</span><span class=data>
% param 'username' => $ms_data->{username} unless param 'username';
%= text_field 'username', size => '50', class => 'textinput username' , pattern=>'.*' , placeholder=>'username', title =>'Pattern regex mismatch', id => 'username_text'
<br></span></p>
<a href='mailsortingdd?trt=RULES' class='link link1'>
%= l('ms_Add_new_rule')
</a>
%#= link_to l('ms_Add_new_rule'), 'mailsortingdd?trt=RULES' , class=>'link link1'
<h2 class='subh'><%=l('ms_Current_rules')%></h2>
<br /><table class="sme-border TableSort sme-table tabl1 ">
<thead class='tabl1'>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Match Against '><%=l('ms_Match_Against')%></th>
<th class='sme-border table-head-col table-head-col-The Rule '><%=l('ms_The_Rule')%></th>
<th class='sme-border table-head-col table-head-col-2nd Match '><%=l('ms_2nd_Match')%></th>
<th class='sme-border table-head-col table-head-col-2nd Rule '><%=l('ms_2nd_Rule')%></th>
<th class='sme-border table-head-col table-head-col-Action '><%=l('ms_Action')%></th>
<th class='sme-border table-head-col table-head-col-Destination '><%=l('ms_Destination')%></th>
<th class='sme-border table-head-col table-head-col-Copy '><%=l('ms_Copy')%></th>
<th class='sme-border table-head-col table-head-col-Destination '><%=l('ms_Destination')%></th>
<th class='sme-border table-head-col table-head-col-Serial Number '><%=l('ms_Serial_Number')%></th>
<th class='sme-border table-head-col table-head-col-Modify '><%=l('ms_Modify')%></th>
<th class='sme-border table-head-col table-head-col-Remove '><%=l('ms_Remove')%></th>
</tr>
</thead>
<tbody class='tabl1'>
% my $control_data = $c->stash('getAllRules');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-MatchAgainst'><%=$c->render_to_string(inline=>$row->{'MatchAgainst'})%></td>
<td class='sme-border table-col table-col-TheRule'><%=$c->render_to_string(inline=>$row->{'TheRule'})%></td>
<td class='sme-border table-col table-col-c2ndMatch'><%=$c->render_to_string(inline=>$row->{'c2ndMatch'})%></td>
<td class='sme-border table-col table-col-c2ndRule'><%=$c->render_to_string(inline=>$row->{'c2ndRule'})%></td>
<td class='sme-border table-col table-col-Action'><%=$c->render_to_string(inline=>$row->{'Action'})%></td>
<td class='sme-border table-col table-col-Destination'><%=$c->render_to_string(inline=>$row->{'Destination'})%></td>
<td class='sme-border table-col table-col-Copy'><%=$c->render_to_string(inline=>$row->{'Copy'})%></td>
<td class='sme-border table-col table-col-Destination'><%=$c->render_to_string(inline=>$row->{'Destination'})%></td>
<td class='sme-border table-col table-col-Serial Number'><%=$c->render_to_string(inline=>$row->{'Serial Number'})%></td>
<td class='sme-border table-col table-col-Modify'><%=$c->render_to_string(inline=>$row->{'Modify'})%></td>
<td class='sme-border table-col table-col-Remove'><%=$c->render_to_string(inline=>$row->{'Remove'})%></td>
</tr>
%}
</tbody>
</table>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,39 @@
/*
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-04 12:59:05
*/
.Mailsorting-panel {}
.name {}
.rout {}
.head {}
.para1 {}
.text97 {}
.text96 {}
.link1 {}
.subh {}
.tabl1 {}
thead .tabl1 {}
tbody .tabl1 {}
.name {}
.rout {}
.head {}
.subh {}
.para1 {}
.para2 {}
.sele1 {}
.text2 {}
.sele3 {}
.text4 {}
.sele5 {}
.text6 {}
.sele7 {}
.sele8 {}
.sele9 {}
.text10 {}
.text11 {}
.subm12 {}
.name {}
.rout {}
.head {}
.subh {}
.text94 {}
.subm95 {}

View File

@@ -0,0 +1,64 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-04 12:59:05
%#
% layout 'default', title => "Sme server 2 - Process Mail", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/mailsorting.css'
%= javascript '/js/mailsorting.js'
<div id="module" class="module Mailsorting-panel">
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $ms_data->{trt}
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><p>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</p>
%} elsif ($c->stash('success')) {
<div class='success '>
<p>
%= $c->l($c->stash('success'));
</p>
</div>
<br />
%} elsif ($c->stash('error')) {
<div class='sme-error'>
<p>
%= $c->l($c->stash('error'));
</p>
</div>
<br />
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($ms_data->{trt} eq "TABLE") {
%= include 'partials/_ms_TABLE'
%}
% if ($ms_data->{trt} eq "RULES") {
%= include 'partials/_ms_RULES'
%}
% if ($ms_data->{trt} eq "REMOVE") {
%= include 'partials/_ms_REMOVE'
%}
</div>
%end

View File

@@ -0,0 +1,5 @@
//
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-04 12:59:05
//
$(document).ready(function() {
});

View File

@@ -0,0 +1,41 @@
#
# Generated by SM2Gen version: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-04 12:59:05
#
'ms_Modify_your_rule.' => 'Modify your rule',
'ms_REMOVE_panel_action_was_successful' => 'REMOVE panel action was successful',
'ms_criterion' => 'Criterion',
'ms_APPLY' => 'Apply',
'ms_RULES_panel_action_was_successful' => 'RULES panel action was successful',
'ms_Rule_contents' => 'Rule contents',
'ms_Add_new_rule' => 'Add new rule',
'ms_action2' => 'action',
'ms_You_are_about_to_remove' => 'You are about to remove a rule',
'ms_You_can_change_the_order' => 'You can change the order in which rules are evaluated by altering the numeric value in order of rule execution Priority is determined by asci value And must be unique beg rule user101 goes first Then user then user',
'ms_Remove' => 'Remove',
'ms_The_Rule' => 'The Rule',
'ms_key' => 'Key',
'ms_Rules_are_executed_as_email' => 'Rules are executed as email arrives in your mailbox on the server And are independent of your email client Your current rules If you have any are listed below',
'ms_2nd_Rule' => 'and Rule',
'ms_Action' => 'Action',
'ms_Save' => 'Save',
'ms_TABLE_panel_action_was_successful' => 'TABLE panel action was successful',
'ms_Match_Against' => 'Match Against',
'ms_2nd_Match' => 'and Match',
'ms_Copy' => 'Copy',
'ms_criterion2' => 'criterion',
'ms_deliver2' => 'deliver',
'ms_basis2' => 'basis',
'ms_Mail_sorting_rules' => 'Mail sorting rules',
'ms_User_Name' => 'User Name',
'ms_folder' => 'Folder',
'ms_action' => 'Action',
'ms_copy' => 'Copy',
'ms_basis' => 'Basis',
'ms_Account' => 'Account',
'ms_Serial_Number' => 'Serial Number',
'ms_Manage_mailsortingModifyRule_settings:' => 'Manage mailsortingModifyRule settings',
'ms_Destination' => 'Destination',
'ms_Modify' => 'Modify',
'ms_Process_Mail' => 'Process Mail',
'ms_deliver' => 'Deliver',
'ms_Current_rules' => 'Current rules',

View File

@@ -0,0 +1,321 @@
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-04 12:46:00
#
#
# Routines to be edited by the developer to provide content and validation for parameters
# and provison of the control data for table(s)
#
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::DomainsDB;
use POSIX 'strftime';
use constant FALSE => 0;
use constant TRUE => 1;
#The most common ones
#my $cdb
#my $adb
#my $ndb
#my $hdb
#my $ddb
# Validation routines - parameters for each panel
sub validate_TABLE {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (! TRUE) #validate $c->param('StatsDate')
{$ret .= 'Validation for StatsDate failed';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub validate_CONFIG {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (! TRUE) #validate $c->param('TextorHTML')
{$ret .= 'Validation for TextorHTML failed';}
if (! TRUE) #validate $c->param('Email')
{$ret .= 'Validation for Email failed';}
if (! TRUE) #validate $c->param('EmailHost')
{$ret .= 'Validation for EmailHost failed';}
if (! TRUE) #validate $c->param('EmailUser')
{$ret .= 'Validation for EmailUser failed';}
if (! TRUE) #validate $c->param('DBSave')
{$ret .= 'Validation for DBSave failed';}
if (! TRUE) #validate $c->param('DBHost')
{$ret .= 'Validation for DBHost failed';}
if (! TRUE) #validate $c->param('DBUser')
{$ret .= 'Validation for DBUser failed';}
if (! TRUE) #validate $c->param('CountrySelect')
{$ret .= 'Validation for CountrySelect failed';}
if (! TRUE) #validate $c->param('AccumCountryCodes')
{$ret .= 'Validation for AccumCountryCodes failed';}
if (! TRUE) #validate $c->param('EnableRHSBL')
{$ret .= 'Validation for EnableRHSBL failed';}
if (! TRUE) #validate $c->param('EnableRHSBL')
{$ret .= 'Validation for EnableRHSBL failed';}
if (! TRUE) #validate $c->param('RBLLIST')
{$ret .= 'Validation for RBLLIST failed';}
if (! TRUE) #validate $c->param('SBLLIST')
{$ret .= 'Validation for SBLLIST failed';}
if (! TRUE) #validate $c->param('UBLLIST')
{$ret .= 'Validation for UBLLIST failed';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
# Get singleton data for each panel
sub get_data_for_panel_TABLE {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1'=>'Data for TABLE', #Example
# fields from Inputs in TABLE $fields['TABLE']
'StatsDate'=>'StatsDate contents',
);
return %ret;
}
sub get_data_for_panel_CONFIG {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
my $key = 'mailstats';
my %ret = (
'Data1'=>'Data for CONFIG', #Example
# fields from Inputs in CONFIG $fields['CONFIG']
'TextorHTML'=>$cdb->get_prop($key,'TextorHTML') || 'HTML',
'Email'=>$cdb->get_prop($key,'Email') || 'admin',
'EmailHost'=>$cdb->get_prop($key,'EmailHost') || 'localhost',
'EmailPort'=>$cdb->get_prop($key,'EmailPORT') || '25',
'EmailUser'=>$cdb->get_prop($key,'EmailUser') || 'admin',
'DBSave'=>$cdb->get_prop($key,'SaveDataToMySQL') || 'yes',
'DBHost'=>$cdb->get_prop($key,'DBHost') || 'localhost',
'DBUser'=>$cdb->get_prop($key,'DBUser') || 'admin',
'DBPort'=>$cdb->get_prop($key,'DBPort') || '3306',
#'CountrySelect'=>'CountrySelect ',
'AccumCountryCodes'=>$cdb->get_prop('qpsmtpd','BadCountries'),
'EnableRHSBL'=>$cdb->get_prop('qpsmtpd','RHSBL'),
'EnableDNSBL'=>$cdb->get_prop('qpsmtpd','DNSBL'),
'EnableURIBL'=>$cdb->get_prop('qpsmtpd','URIBL'),
'RBLList'=>$cdb->get_prop('qpsmtpd','RBLList'),
'SBLList'=>$cdb->get_prop('qpsmtpd','SBLList'),
'UBLList'=>$cdb->get_prop('qpsmtpd','UBLList'),
'LevelPort'=>$cdb->get_prop('spamassassin','TagLevel') || '5',
'RejectLevel'=>$cdb->get_prop('spamassassin','RejectLevel') || '12'
);
return %ret;
}
# Get control data for table(s)
# Return hash with values from row in which link clicked on table
sub get_selected_TABLE {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
}
sub get_selected_CONFIG {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
}
#after sucessful modify or create or whatever and submit then perfom (if the params validate)
sub perform_TABLE {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = "";
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
if (! TRUE) #copy or perform with value: StatsDate e.g. $db->set_prop($dbkey,'StatsDate',$c->param('StatsDate'),type=>'service'))
{$ret .= 'Perform/save failed for StatsDate';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub perform_CONFIG {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = "";
my $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
my $db = $cdb; #maybe one of the others
my $dbkey = 'mailstats';
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
if (! $db->set_prop($dbkey,'TextorHTML',$c->param('TextorHTML'),type=>'service'))
{$ret .= 'Perform/save failed for TextorHTML';}
if (! $db->set_prop($dbkey,'Email',$c->param('Email'),type=>'service'))
{$ret .= 'Perform/save failed for Email';}
if (! $db->set_prop($dbkey,'EmailHost',$c->param('EmailHost'),type=>'service'))
{$ret .= 'Perform/save failed for EmailHost';}
if (! $db->set_prop($dbkey,'EmailPort',$c->param('EmailPort'),type=>'service'))
{$ret .= 'Perform/save failed for EmailPort';}
if (! $db->set_prop($dbkey,'EmailUser',$c->param('EmailUser'),type=>'service'))
{$ret .= 'Perform/save failed for EmailUser';}
if (! $db->set_prop($dbkey,'SaveDataToMySQL',$c->param('DBSave'),type=>'service'))
{$ret .= 'Perform/save failed for DBSave';}
if (! $db->set_prop($dbkey,'DBHost',$c->param('DBHost'),type=>'service'))
{$ret .= 'Perform/save failed for DBHost';}
if (! $db->set_prop($dbkey,'DBUser',$c->param('DBUser'),type=>'service'))
{$ret .= 'Perform/save failed for DBUser';}
if (! $db->set_prop($dbkey,'DBPort',$c->param('DBPort'),type=>'service'))
{$ret .= 'Perform/save failed for DBPort';}
#if (! $db->set_prop($dbkey,'CountrySelect',$c->param('CountrySelect'),type=>'service'))
# {$ret .= 'Perform/save failed for CountrySelect';}
if (! $db->set_prop('qpsmtpd','BadCountries',$c->param('AccumCountryCodes'),type=>'service'))
{$ret .= 'Perform/save failed for AccumCountryCodes';}
if (! $db->set_prop('qpsmtpd','RHSBL',$c->param('EnableRHSBL'),type=>'service'))
{$ret .= 'Perform/save failed for EnableRHSBL';}
if (! $db->set_prop('qpsmtpd','DNSBL',$c->param('EnableDNSBL'),type=>'service'))
{$ret .= 'Perform/save failed for EnableDNSBL';}
if (! $db->set_prop('qpsmtpd','URIBL',$c->param('EnableURIBL'),type=>'service'))
{$ret .= 'Perform/save failed for EnableURIBL';}
if (! $db->set_prop('qpsmtpd','RBLList',$c->param('RBLList'),type=>'service'))
{$ret .= 'Perform/save failed for RBLLIST';}
if (! $db->set_prop('qpsmtpd','SBLList',$c->param('SBLList'),type=>'service'))
{$ret .= 'Perform/save failed for SBLLIST';}
if (! $db->set_prop('qpsmtpd','UBLList',$c->param('UBLList'),type=>'service'))
{$ret .= 'Perform/save failed for UBLLIST';}
if (! $db->set_prop('spamassassin','TagLevel',$c->param('TagLevel'),type=>'service'))
{$ret .= 'Perform/save failed for TagLevel';}
if (! $db->set_prop('spamassassin','RejectLevel',$c->param('RejectLevel'),type=>'service'))
{$ret .= 'Perform/save failed for RejectLevel';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub create_link{
# WIP
my ($c,$route, $panel, $index) = @_;
my $link = "$route?trt=$panel&Selected=$index";
return $link;
}
sub get_StatsDate{
return ['yesterday']
}
sub get_CountryCodes {
return [
['Afghanistan' => 'AF'], # Frequent political/malware spam
['Argentina' => 'AR'], # 52% spam call rate (highest globally)
['Brazil' => 'BR'], # Top spam call origin
['China' => 'CN'], # High spam volume
['France' => 'FR'], # 43% spam call rate, top email spam source
['Germany' => 'DE'], # Significant email spam volume
['India' => 'IN'], # High spam call/text volume
['Indonesia' => 'ID'], # 51.5% spam call rate
['Italy' => 'IT'], # 35.1% spam call rate, email spam source
['Malaysia' => 'MY'], # 63% scam calls
['Mexico' => 'MX'], # Emerging spam source
['Nigeria' => 'NG'], # "Nigerian prince" scams
['Pakistan' => 'PK'], # Phishing campaigns
['Peru' => 'PE'], # Emerging spam source
['Russia' => 'RU'], # Cybercrime associations
['Saudi Arabia' => 'SA'], # High spam volume
['Spain' => 'ES'], # 43.9% spam call rate, email spam
['Turkey' => 'TR'], # Significant spam activity
['Ukraine' => 'UA'], # Spam proxy servers
['United States' => 'US'], # High email spam volume
['Viet Nam' => 'VN'] # Phishing/malware origins
];
}
sub get_RBL_lists{
return (
# Other Major Providers
"zen.spamhaus.org", # Combines SBL, XBL, and PBL
'bl.spamcop.net', # SpamCop Blocklist (user-reported spam)
'cbl.abuseat.org', # Composite Blocking List (bot-infected hosts)
'b.barracudacentral.org', # Barracuda Reputation Blocklist
# Specialized Lists
'dun.dnsrbl.net', # DNSRBL (DNS-based blacklist)
'psbl.surriel.com', # Passive Spam Block List (passive spam traps)
'backscatterer.org', # Backscatter/Out-of-Bounce spam sources
'dronebl.org', # Drones/Proxy/DDoS sources
'dnsbl-1.uceprotect.net',# UCEPROTECT Level 1 (entry-level blocking)[User Query]
'dnsbl-2.uceprotect.net' # UCEPROTECT Level 2 (more aggressive)[User Query]
);}
sub get_SBL_list{
return (
"sbl.spamhaus.org", # Spamhaus Blocklist
"xbl.spamhaus.org", # eXploits Blocklist
"pbl.spamhaus.org", # Policy Blocklist
"auth.spamhaus.org", # Auth Blocklist
"multi.surbl.org", # SURBL's multi-level URI checker (domains in email content)
"rhsbl.sorbs.net" # Right-Hand Side Blocklist (domain-based, not IP-based)
);}
sub get_URIBL_list{
return my @uribl_lists = (
"uribl.com", # Primary URIBL service
"multi.uribl.com", # Combined URIBL checks
"black.uribl.com", # Aggressive blocking list
"grey.uribl.com", # Suspicious URI list
"white.uribl.com" # Verified safe URI list
);}
sub get_mailstat_dates {
my ($directory) = '/opt/mailstats/html';
my @date_pairs;
# Find all matching files in directory
opendir(my $dh, $directory) or die "Can't open directory: $!";
while (my $file = readdir($dh)) {
next unless $file =~ /mailstats_for_(\d{4}-\d{2}-\d{2})\.html$/;
my $date = $1;
if ($date =~ /^(\d{4})-(\d{2})-(\d{2})$/) {
my $formatted_date = strftime("%B %-d %Y", 0, 0, 0, $3, $2-1, $1-1900);
push @date_pairs, [$formatted_date, $date];
}
}
closedir($dh);
# Sort dates chronologically
@date_pairs = sort { $a->[1] cmp $b->[1] } @date_pairs;
return \@date_pairs;
}
1;

View File

@@ -0,0 +1,315 @@
package SrvMngr::Controller::Mailstats;
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-05 11:59:08
#
#----------------------------------------------------------------------
# heading : Investigation
# description : Mailstats
# navigation : 7000 100
#
# name : mailstats, method : get, url : /mailstats, ctlact : Mailstats#main
# name : mailstatsu, method : post, url : /mailstatsu, ctlact : Mailstats#do_update
# name : mailstatsd, method : get, url : /mailstatsd, ctlact : Mailstats#do_display
#
# routes : end
#
# Documentation: https://wiki.contribs.org/Mailstats
#----------------------------------------------------------------------
#
# Scheme of things:
#
# TBA!!
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use constant FALSE => 0;
use constant TRUE => 1;
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
my $cdb;
my $adb;
my $ndb;
my $hdb;
my $ddb;
require '/usr/share/smanager/lib/SrvMngr/Controller/Mailstats-Custom.pm'; #The code that is to be added by the developer
sub main {
#
# Initial entry - route is "/<whatever>"
#
#set initial panel
#for initial panel:
#Specifiy panel to enter
#load up _data hash with DB fields
#load up stash with pointer(s) to control fields hash(= get-))
#and a pointer to the prefix_data hash
#render initial panel
my $c = shift;
$c->app->log->info( $c->log_req );
#The most common ones
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
my %mst_data = ();
my $title = $c->l('mst_Mailstats');
my $modul = '';
$mst_data{'trt'} = 'TABLE';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
my $db = $cdb; #pickup local or global db or Default to config
$c->do_display($mst_data{'trt'});
}
# Post request with params - submit from the form
sub do_update {
#
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
# parameters in the params hash.
#
#load up all params into prefix_data hash:
#By panel (series of if statements - only one executed):
#call validate-PANEL() - return ret = ok or error message
#if validation not ok:
#render back to current panel with error message in stash
#otherwise:
#By panel (series of if statements - only one executed):
#do whatever is required: call perform-PANEL() - return "ok" or Error Message
#call signal-event for any global actions specified (check it exists - error and continue?)
#if action smeserver-<whatever>-update exists
#signal_event smeserver-<whatever>-update
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
#set success in stash
#if no "nextpanel" entry:
#set firstpanel
#else
#set nextpanel
#call render
my $c = shift;
$c->app->log->info($c->log_req);
my $modul = '';
#The most common ones - you might want to comment out any not used.
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
my %mst_data = ();
my $title = $c->l('mst_Mailstats');
# Accessing all POST/GET parameters
my $params = $c->req->params->to_hash;
# Get number of POST parameters
#my $num_params = keys scaler %$params;
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $mst_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'TABLE'; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
my $thispanel;
if ($trt eq 'TABLE'){
#Validate form parameters for panel TABLE
$ret = $c->validate_TABLE(\%mst_data);
$thispanel = 'TABLE';
}
if ($trt eq 'CONFIG'){
#Validate form parameters for panel CONFIG
$ret = $c->validate_CONFIG(\%mst_data);
$thispanel = 'CONFIG';
}
if ($ret ne "ok"){
$c->do_display($thispanel);
} else {
#Do whatever is needed, including writing values to the DB
if ($trt eq 'TABLE'){
#do whatever is required ...
$ret = $c->perform_TABLE(\%mst_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mst_data => \%mst_data
);
$c->render(template => "mailstats");
} else {
$c->stash( success => $c->l('mst_TABLE_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'CONFIG'){
#do whatever is required ...
$ret = $c->perform_CONFIG(\%mst_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->stash(
title => $title,
modul => $modul,
mst_data => \%mst_data
);
$c->render(template => "mailstats");
} else {
$c->stash( success => $c->l('mst_CONFIG_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
# and call any signal-events needed
#TBD
# Setup shared data and call panel
if ('none' eq 'none') {
$mst_data{'trt'} = 'TABLE';
} else {
$mst_data{'trt'} = 'none';
}
$c->do_display($mst_data{'trt'});
}
}
sub do_display {
#
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
#
# OR it maybe a post from the main panel to add a new record
#
#load up all supplied params into prefix_data hash
#call get-selected-PANEL() - returns hash of all relevent parameters
#load up returned hash into prefix_data
#render - to called panel
my ($c,$trt) = @_;
$c->app->log->info($c->log_req);
#The most common ones - you might want to comment out any not used.
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
my %mst_data = ();
my $title = $c->l('mst_Mailstats');
my $modul = "";
# Accessing all parameters
my %params = $c->req->params->to_hash;
# Get number of parameters
my $num_params = keys %params;
#Tag as Post or Get (ie. create new entry or edit existing one
my $is_new_record = ($c->req->method() eq 'POST');
#Params are available in the hash "params" - copy to the prefix_data hash
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
# $mst_data{$key} = $value;
#}
# the value of trt will tell you which panel has returned
if (! $trt){
$trt = $c->param('trt') || 'TABLE'; #Indicates where to go now
}
# Now add in the params from the selected row from the table
my %selectedrow;
if ($trt eq 'TABLE'){
#Validate Get selected row (if applicable) TABLE
%selectedrow = $c->get_selected_TABLE($mst_data{'Selected'},$is_new_record);
}
if ($trt eq 'CONFIG'){
#Validate Get selected row (if applicable) CONFIG
%selectedrow = $c->get_selected_CONFIG($mst_data{'Selected'},$is_new_record);
}
#Copy in the selected row params to the prefix_data hash to pass to the panel
while (my ($key, $value) = each %selectedrow){
$mst_data{$key} = $value;
}
# Where to go now
$mst_data{'trt'} = $trt;
# Set up other shared data according to the panel to go to
if ($trt eq 'TABLE'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_TABLE();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mst_data{$key} = $value;
}
}
if ($trt eq 'CONFIG'){
# pickup any other contents needed and load them into hash shared with panel
my %returned_hash;
# subroutine returns a hash directly
%returned_hash = $c->get_data_for_panel_CONFIG();
# Copy each key-value pair from the returned hash to the prefix data hash
while (my ($key, $value) = each %returned_hash) {
$mst_data{$key} = $value;
}
}
# and table control fields
# Data for panel
$c->stash(
title => $title,
modul => $modul,
mst_data => \%mst_data
);
$c->render(template => "mailstats");
}
1;

View File

@@ -0,0 +1,207 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-05 11:17:38
%#
<div id="Mailstats-CONFIG" class="partial Mailstats-CONFIG">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mst_data
</pre>
% }
% my $btn = l('mst_APPLY');
%= form_for "mailstatsu" => (method => 'POST') => begin
% param 'trt' => $mst_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $mst_data->{trt}
%# Inputs etc in here.
<p><span class=label>
%=l('mst_Specify_if_you_would_like')
</span><span class=data>
% my @TextorHTML_options = [['HTML' => 'HTML'], ['Text' => 'Text'], ['Both' => 'Both'], ['Neither' => 'Neither']];
% param 'TextorHTML' => $mst_data->{TextorHTML} unless param 'TextorHTML';
%= select_field 'TextorHTML' => @TextorHTML_options, class => 'input', id => 'TextorHTML_select'
<br></span> </p>
<div class=emailwanted>
<h2 class='subh'><%=l('mst_Email_details')%></h2>
<p><span class=label>
%=l('mst_Email_for_stats')
</span><span class=data>
% param 'Email' => $mst_data->{Email} unless param 'Email';
%=email_field 'Email', class => 'emai3'
</span></p>
<p><span class=label>
%=l('mst_Host_name_for_email_server')
</span><span class=data>
% param 'EmailHost' => $mst_data->{EmailHost} unless param 'EmailHost';
%= text_field 'EmailHost', size => '50', class => 'textinput EmailHost' , pattern=>'.*' , placeholder=>'EmailHost', title =>'Pattern regex mismatch'
<br></span></p>
<p><span class='label'>
%=l('mst_Port_number_for_email_server')
</span><span class=data>
% param 'EmailPort' => $mst_data->{EmailPort} unless param 'EmailPort';
%=number_field 'EmailPort', class => 'numb6'
</span></p>
<p><span class=label>
%=l('mst_User_name_for_email_sending')
</span><span class=data>
% param 'EmailUser' => $mst_data->{EmailUser} unless param 'EmailUser';
%= text_field 'EmailUser', size => '50', class => 'textinput EmailUser' , pattern=>'.*' , placeholder=>'EmailUser', title =>'Pattern regex mismatch'
<br></span></p>
<p><span class='label'>
%=l('mst_User_Password_for_email_sending')
</span><span class=data>
% param 'EmailPassword' => $mst_data->{EmailPassword} unless param 'EmailPassword';
%=password_field 'EmailPassword', class => 'pass8 sme-password', autocomplete => 'off'
</span></p>
</div>
<p><span class=label>
%=l('mst_Would_you_like_to_save')
</span><span class=data>
% my @DBSave_options = [['yes' => 'yes'], ['no' => 'no']];
% param 'DBSave' => $mst_data->{DBSave} unless param 'DBSave';
%= select_field 'DBSave' => @DBSave_options, class => 'input', id => 'DBSave_select'
<br></span> </p>
<div class=dbwanted>
<h2 class='subh2'><%=l('mst_Details_for_connection_to_database')%></h2>
<p><span class=label>
%=l('mst_Host_name_for_DB_server')
</span><span class=data>
% param 'DBHost' => $mst_data->{DBHost} unless param 'DBHost';
%= text_field 'DBHost', size => '50', class => 'textinput DBHost' , pattern=>'.*' , placeholder=>'DBHost', title =>'Pattern regex mismatch'
<br></span></p>
<p><span class='label'>
%=l('mst_Port_number_for_DB_server')
</span><span class=data>
% param 'DBPort' => $mst_data->{DBPort} unless param 'DBPort';
%=number_field 'DBPort', class => 'numb11'
</span></p>
<p><span class=label>
%=l('mst_User_name_for_DB_sending')
</span><span class=data>
% param 'DBUser' => $mst_data->{DBUser} unless param 'DBUser';
%= text_field 'DBUser', size => '50', class => 'textinput DBUser' , pattern=>'.*' , placeholder=>'DBUser', title =>'Pattern regex mismatch'
<br></span></p>
<p><span class='label'>
%=l('mst_User_Password_for_DB_sending')
</span><span class=data>
% param 'DBPassword' => $mst_data->{DBPassword} unless param 'DBPassword';
%=password_field 'DBPassword', class => 'pass13 sme-password', autocomplete => 'off'
</span></p>
</div>
<h2 class='subh3'><%=l('mst_Email_filtering_/_exclusion')%></h2>
<p><span class=label>
%=l('mst_Select_the_countries_you_would')
</span><span class=data>
% my @CountrySelect_options = $c->get_CountryCodes();
% param 'CountrySelect' => $mst_data->{CountrySelect} unless param 'CountrySelect';
%= select_field 'CountrySelect' => @CountrySelect_options, class => 'input', id => 'CountrySelect_select', multiple => 'multiple'
<br></span> </p>
<p><span class=label>
%=l('mst_Accumulated_country_codes_(editable)')
</span><span class=data>
% param 'AccumCountryCodes' => $mst_data->{AccumCountryCodes} unless param 'AccumCountryCodes';
%= text_field 'AccumCountryCodes', size => '50', class => 'textinput AccumCountryCodes' , pattern=>'.*' , placeholder=>'AccumCountryCodes', title =>'Pattern regex mismatch', id => 'AccumCountryCodes_text'
<br></span></p>
<p><span class=label>
%=l('mst_Enable_RHSBL_checking')
</span><span class=data>
% my @EnableRHSBL_options = [['yes' => 'enabled'], ['no' => 'disabled']];
% param 'EnableRHSBL' => $mst_data->{EnableRHSBL} unless param 'EnableRHSBL';
%= select_field 'EnableRHSBL' => @EnableRHSBL_options, class => 'input', id => 'EnableRHSBL_select'
<br></span> </p>
<p><span class=label>
%=l('mst_Enable_DNSBL_checking')
</span><span class=data>
% my @EnableDNSBL_options = [['yes' => 'enabled'], ['no' => 'disabled']];
% param 'EnableDNSBL' => $mst_data->{EnableDNSBL} unless param 'EnableDNSBL';
%= select_field 'EnableDNSBL' => @EnableDNSBL_options, class => 'input', id => 'EnableDNSBL_select'
<br></span> </p>
<p><span class=label>
%=l('mst_Enable_URIBL_checking')
</span><span class=data>
% my @EnableURIBL_options = [['yes' => 'enabled'], ['no' => 'disabled']];
% param 'EnableURIBL' => $mst_data->{EnableURIBL} unless param 'EnableURIBL';
%= select_field 'EnableURIBL' => @EnableURIBL_options, class => 'input', id => 'EnableURIBL_select'
<br></span> </p>
<p><span class=label>
%=l('mst_RBL_Servers_to_use')
</span><span class=data>
% param 'RBLList' => $mst_data->{RBLList} unless param 'RBLList';
%= text_field 'RBLList', size => '50', class => 'textinput RBLList' , pattern=>'.*' , placeholder=>'RBLList', title =>'Pattern regex mismatch'
<br></span></p>
<p><span class=label>
%=l('mst_SBL_Servers_to_use')
</span><span class=data>
% param 'SBLList' => $mst_data->{SBLList} unless param 'SBLList';
%= text_field 'SBLList', size => '50', class => 'textinput SBLList' , pattern=>'.*' , placeholder=>'SBLList', title =>'Pattern regex mismatch'
<br></span></p>
<p><span class=label>
%=l('mst_UBL_Servers_to_use')
</span><span class=data>
% param 'UBLList' => $mst_data->{UBLList} unless param 'UBLList';
%= text_field 'UBLList', size => '50', class => 'textinput UBLList' , pattern=>'.*' , placeholder=>'UBLList', title =>'Pattern regex mismatch'
<br></span></p>
<h2 class='subh4'><%=l('mst_Spamassassin_scores_-_tag_and')%></h2>
<p><span class='label'>
%=l('mst_Score_to_fully_reject_emmail')
</span><span class=data>
% param 'RejectLevel' => $mst_data->{RejectLevel} unless param 'RejectLevel';
%=number_field 'RejectLevel', class => 'numb21'
</span></p>
<p><span class='label'>
%=l('mst_Score_for_tagging_as_spam,')
</span><span class=data>
% param 'TagLevel' => $mst_data->{TagLevel} unless param 'TagLevel';
%=number_field 'TagLevel', class => 'numb22'
</span></p>
<span class='data'>
%= submit_button l('mst_Save'), class => 'action subm23'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,52 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-05 11:59:08
%#
<div id="Mailstats-TABLE" class="partial Mailstats-TABLE">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if (config->{debug} == 1) {
<pre>
%= dumper $mst_data
</pre>
% }
% my $btn = l('mst_APPLY');
%= form_for "mailstatsu" => (method => 'POST') => begin
% param 'trt' => $mst_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $mst_data->{trt}
%# Inputs etc in here.
<div class=inline-buttons>
<a href='mailstatsd?trt=CONFIG' class='link link1'>
%= l('mst_Configure_Mailstats')
</a>
%#= link_to l('mst_Configure_Mailstats'), 'mailstatsd?trt=CONFIG' , class=>'link link1'
</div>
<h2 class='subh1'><%=l('mst_Table_of_email_status')%></h2>
<p class='paragraph para1'>
%=l('mst_Descriptive_paragraph')
</p>
<p><span class=label>
%=l('mst_Date_for_Stats_display')
</span><span class=data>
% my @StatsDate_options = $c->get_mailstat_dates();
% param 'StatsDate' => $mst_data->{StatsDate} unless param 'StatsDate';
%= select_field 'StatsDate' => @StatsDate_options, class => 'input', id => 'StatsDate_select'
<br></span> </p>
<object id = 'mailstats_object' data="<%='mailstats/$c-&gt;stash(&quot;url&quot;)' %>" title="<%= $c->stash('title') %>" type="text/html" ><%= $c->stash('title') %> not found</object>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,45 @@
/*
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-05 11:59:08
*/
.Mailstats-panel {}
.name {}
.rout {}
.grou1 {}
.link1 {}
.endg1 {}
.subh1 {}
.para1 {}
.sele1 {}
.obje2 {}
.name {}
.rout {}
.sele4 {}
.grou1 {}
.subh {}
.emai3 {}
.text5 {}
.numb6 {}
.text7 {}
.pass8 {}
.endg1 {}
.sele9 {}
.grou2 {}
.subh2 {}
.text10 {}
.numb11 {}
.text12 {}
.pass13 {}
.endg2 {}
.subh3 {}
.mult14 {}
.text15 {}
.sele16 {}
.sele17 {}
.sele24 {}
.text18 {}
.text19 {}
.text20 {}
.subh4 {}
.numb21 {}
.numb22 {}
.subm23 {}

View File

@@ -0,0 +1,60 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-05 11:59:08
%#
% layout 'default', title => "Sme server 2 - Mailstats", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/mailstats.css'
%= javascript '/js/mailstats.js'
<div id="module" class="module Mailstats-panel">
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $mst_data->{trt}
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><p>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</p>
%} elsif ($c->stash('success')) {
<div class='success '>
<p>
%= $c->l($c->stash('success'));
</p>
</div>
<br />
%} elsif ($c->stash('error')) {
<div class='sme-error'>
<p>
%= $c->l($c->stash('error'));
</p>
</div>
<br />
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($mst_data->{trt} eq "TABLE") {
%= include 'partials/_mst_TABLE'
%}
% if ($mst_data->{trt} eq "CONFIG") {
%= include 'partials/_mst_CONFIG'
%}
</div>
%end

View File

@@ -0,0 +1,66 @@
//
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-05 11:17:38
//
$(document).ready(function() {
});
// Initialize multiselect with existing text values
function initMultiselect() {
const multiselect = document.getElementById('CountrySelect_select');
const textInput = document.getElementById('AccumCountryCodes_text');
// Split text input values and select corresponding options
textInput.value.split(',').forEach(value => {
const option = Array.from(multiselect.options).find(opt => opt.value === value.trim());
if (option) option.selected = true;
});
}
// Update text input when multiselect changes
function updateTextInput() {
const multiselect = document.getElementById('CountrySelect_select');
const textInput = document.getElementById('AccumCountryCodes_text');
// Get selected values as comma-separated string
const selectedValues = Array.from(multiselect.selectedOptions)
.map(option => option.value)
.join(',');
textInput.value = selectedValues;
}
// Initialize on page load
document.addEventListener('DOMContentLoaded', () => {
initMultiselect();
// Add change listener to multiselect
document.getElementById('CountrySelect_select')
.addEventListener('click', updateTextInput);
});
// Initialize select with current object content
document.addEventListener('DOMContentLoaded', () => {
const objectElement = document.getElementById('mailstats_object');
const selectElement = document.getElementById('StatsDate_select');
// Extract current date from object's data URL
const currentDate = objectElement.data.match(/mailstats_for_(\d{4}-\d{2}-\d{2})\.html/)?.[1];
if (currentDate) {
selectElement.value = currentDate;
}
});
// Update object content when selection changes
document.getElementById('StatsDate_select').addEventListener('change', function() {
const selectedDate = this.value;
const objectElement = document.getElementById('mailstats_object');
// Update object's data source
objectElement.data = `mailstats_for_${selectedDate}.html`;
// Force refresh using clone method (cross-browser workaround)
const clone = objectElement.cloneNode(true);
objectElement.replaceWith(clone);
});

View File

@@ -0,0 +1,37 @@
#
# Generated by SM2Gen version: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-04-05 11:59:08
#
'mst_Host_name_for_DB_server' => 'Host name for DB server',
'mst_Enable_RHSBL_checking' => 'Enable RHSBL checking',
'mst_RBL_Servers_to_use' => 'RBL Servers to use',
'mst_Port_number_for_email_server' => 'Port number for email server',
'mst_User_name_for_DB_sending' => 'User name for DB sending',
'mst_Table_of_email_status' => 'Table of email status',
'mst_Score_to_fully_reject_emmail' => 'Score to fully reject email',
'mst_User_Password_for_email_sending' => 'User Password for email sending',
'mst_UBL_Servers_to_use' => 'UBL Servers to use',
'mst_Would_you_like_to_save' => 'Would you like to save data in the DB?',
'mst_Specify_if_you_would_like' => 'Specify if you would like to receive email in text or HTML form',
'mst_Port_number_for_DB_server' => 'Port number for DB server',
'mst_Mailstats' => 'mailshots',
'mst_Email_filtering_/_exclusion' => 'Email filtering / exclusion',
'mst_Score_for_tagging_as_spam,' => 'Score for tagging as spam But queued',
'mst_Accumulated_country_codes_(editable)' => 'Accumulated country codes editable',
'mst_Date_for_Stats_display' => 'Date for Stats display',
'mst_Enable_URIBL_checking' => 'Enable URIBL checking',
'mst_CONFIG_panel_action_was_successful' => 'CONFIG panel action was successful',
'mst_Email_details' => 'Email details',
'mst_User_Password_for_DB_sending' => 'User Password for DB sending',
'mst_Email_for_stats' => 'Email for stats',
'mst_Select_the_countries_you_would' => 'Select the countries you would like to reject',
'mst_Spamassassin_scores_-_tag_and' => 'Spamassassin scores - tag and reject levels',
'mst_SBL_Servers_to_use' => 'SBL Servers to use',
'mst_Save' => 'Save',
'mst_Descriptive_paragraph' => 'Descriptive paragraph',
'mst_APPLY' => 'Apply',
'mst_Enable_DNSBL_checking' => 'Enable DNSBL checking',
'mst_Host_name_for_email_server' => 'Host name for email server',
'mst_Details_for_connection_to_database' => 'Details for connection to database for saving email status',
'mst_TABLE_panel_action_was_successful' => 'TABLE panel action was successful',
'mst_Configure_Mailstats' => 'Configure mailshots',
'mst_User_name_for_email_sending' => 'User name for email sending',

View File

@@ -1,59 +0,0 @@
#
# Routines to be editted by the developer to provide validation for parameters
# and provison of the control data for table(s)
#
#$cdb=$main::cdb;
#$adb=$main::adb;
#$ndb=$main::ndb;
#$hdb=$main::hdb;
#$ddb=$main::ddb;
use esmith::util;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
#The most common ones
our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
# Validation routines - parameters for each panel
sub validate_PARAMS {
$ret = 'ok';
return $ret;
}
sub validate_TABLE {
$ret = 'ok';
return $ret;
}
# Get control data for tables(s)
sub get_ibays {
my @res;
my @ibays = $adb->ibays();
foreach my $i (@ibays){
my %hash = ('Name'=> $i->prop('Name'),
'Description' => $i->prop('Description'),
'Flag' => 1,
'PARAMS' => 'Modify'
);
push(@res,\%hash);
}
return \@res
}
1;

View File

@@ -1,178 +0,0 @@
package SrvMngr::Controller::Nfsshare;
#----------------------------------------------------------------------
# heading : Network
# description : NFS data share
# navigation : 2000 400
#
# name : nfsshare, method : get, url : /nfsshare, ctlact : nfsshare#main
# name : nfsshared, method : post, url : /nfsshared, ctlact : nfsshare#do_update
#
# routes : end
#
# Documentation: https://wiki.contribs.org/{PackageName}
#----------------------------------------------------------------------
#
# Scheme of things:
#
#main:
##
## Initial entry
##
#set initial panel
#for initial panel:
# load up _data hash with DB fields
# load up stash with pointer(s) to control fields hash(= get-))
#render initial panel
#
#do_display
##
## Return after submit pushed on panel
##
#load up all params into local hash
# by panel:
# by param:
# validate param (return ret = ok or error message) - call validate-
# break out on error
#if validation not ok
# render back to current panel with error message in stash
#otherwise
# By panel:
# Copy back to DB any that have changed (how to easily tell if it has changed?)
# do whatever is required (inc signal_event smeserver-<whatever>-update?)
# set success
# call main?
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use constant FALSE => 0;
use constant TRUE => 1;
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
#The most common ones
our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
require '/usr/share/smanager/lib/SrvMngr/Controller/Nfsshare-Custom.pm'; #The code that is to be added by the developer
sub main {
my $c = shift;
$c->app->log->info( $c->log_req );
my %nfs_data = ();
my $title = $c->l("nfs_NFS data share");
my $modul = '';
$nfs_data{'trt'} = 'TABLE';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB
my $db = $cdb; #pickup local or global db or Default to config
# and table control fields
$c->stash(ibays=>get_ibays());
$c->stash(
title => $title,
modul => $modul,
nfs_data => \%nfs_data
);
$c->render( template => "Nfsshare" );
}
sub do_update {
my $c = shift;
$c->app->log->info($c->log_req);
my %nfs_data = ();
my $title = $c->l("nfs_NFS data share");
# Accessing all POST parameters
my %params = $c->req->params->to_hash;
# Get number of POST parameters
my $num_params = keys %params;
#Params are available in the hash "params"
# you may use:
my @result;
foreach my $key (keys %params) {
my $value = $params{$key};
push @result, { $key => $value };
$c->app->log->debug("$key: $value");
}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'TABLE' ; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters accordingly
my $thispanel;
if ($trt eq 'PARAMS'){
#Validate form parameters for panel PARAMS
$ret = validate_PARAMS();
$thispanel = 'PARAMS';
}
if ($trt eq 'TABLE'){
#Validate form parameters for panel TABLE
$ret = validate_TABLE();
$thispanel = 'TABLE';
}
if ($ret eq "ok") {
#Do whatever is needed, including writing values to the DB
my $db = $cdb; #pickup local or global db or Default to config
# anything else here...
$c->stash( success => $c->l("$thispanel successfull message"));
$c->stash(
title => $title,
nfs_data => \%nfs_data
# Extra data in here - repeat for each stash data entry needed for panels
);
nfs_data{'trt'} = 'TABLE';
$c->render("Nfsshare");
}
}
1;

View File

@@ -0,0 +1,125 @@
#
# Routines to be edited by the developer to provide validation for parameters
# and provison of the control data for table(s)
#
# Generated by SME2Gen version:0.7 Chameleon version:4.5.4 On Python:3.10.12 at 2024-05-06 08:40
#
use esmith::util;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
#The most common ones
our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
# Validation routines - parameters for each panel
sub validate_PARAMS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = 'ok';
return $ret;
}
sub validate_TABLE {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = 'ok';
return $ret;
}
# Get control data for tables(s)
sub get_ibays {
my $c = shift;
my @ret = {};
my @ibays = $adb->ibays();
foreach my $i (@ibays){
# Taken pretty well verbatim from /usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/nfsshare.pm
# although the href is more specific to the SM2 structure.
my $ibayname = $i->key();
my $ibaydesc = $i->prop('Name');
my $ibaynfs = $i->prop('NfsStatus')||'disabled';
my $modifiable = $i->prop('Modifiable') || 'yes';
$ibaynfs = $c->l('ENABLED') if ($ibaynfs eq 'enabled');
$ibaynfs = $c->l('DISABLED') if ($ibaynfs eq 'disabled');
#my $params = $self->build_ibay_cgi_params($ibayname, $i->props());
#my $scriptname = "nfsshareu";
#my $href = "$scriptname?$params&action=modify&wherenext=";
my $actionModify = '&nbsp;';
if ($modifiable eq 'yes'){
$actionModify .= "<a href='nfsshared?trt=PARAMS&Selected=$ibayname'><button class='sme-modify-button' title=".$c->l("MODIFY").">".$c->l("MODIFY")."</button></a>"."&nbsp"
}
my %hash = ('Name'=> $ibayname,
'Description' => $ibaydesc,
'Flag' => $ibaynfs,
'Modify' => $actionModify
);
push(@ret,\%hash);
}
return \@ret
}
# Return hash with values from row in which link clicked on table
sub get_selected_PARAMS {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return $ret;
}
sub get_selected_TABLE {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return $ret;
}
#after sucessful modify or create or whatever and submit then perfom (if the params validate)
sub perform_PARAMS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = 'ok';
return $ret;
}
sub perform_TABLE {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = 'ok';
return $ret;
}
sub create_link{
# WIP
my ($c,$route, $panel, $index) = shift;
my $link = "$route?trt=$panel&Selected=$index";
return $link;
}
1;

View File

@@ -0,0 +1,97 @@
#
# Routines to be edited by the developer to provide validation for parameters
# and provison of the control data for table(s)
#
# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-16 11:52
#
use esmith::util;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
#The most common ones
our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
# Validation routines - parameters for each panel
sub validate_PARAMS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = 'ok';
return $ret;
}
sub validate_TABLE {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = 'ok';
return $ret;
}
# Get control data for tables(s)
sub get_ibays {
# Return an array of hashes of the contents for each row and column for ibays
# default is a single row of strings "col1header-1, col2header-1, col3Header-1 etc"
my $c = shift;
my $control_data = $self->stash('ibays');
my @ret = {}
# foreach my $colHead (@$control_data) {
# my ret{$colHead} = "$colhead-1"
# };
return \@ret
}
# Return hash with values from row in which link clicked on table
sub get_selected_PARAMS {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return $ret;
}
sub get_selected_TABLE {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return $ret;
}
#after sucessful modify or create or whatever and submit then perfom (if the params validate)
sub perform_PARAMS {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = 'ok';
return $ret;
}
sub perform_TABLE {
my $c = shift;
my $prefix_data = shift; #Data hash as parameter
my $ret = 'ok';
return $ret;
}
sub create_link{
# WIP
my ($c,$route, $panel, $index) = shift;
my $link = "$route?trt=$panel&Selected=$index";
return $link;
}
1;

267
Targets/Nfsshare/Nfsshare.pm Executable file
View File

@@ -0,0 +1,267 @@
package SrvMngr::Controller::Nfsshare;
#
# Generated by version:SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-16 11:52
#
#----------------------------------------------------------------------
# heading : Network
# description : NFS data share
# navigation : 2000 400
#
# name : nfsshare, method : get, url : /nfsshare, ctlact : Nfsshare#main
# name : nfsshareu, method : post, url : /nfsshareu, ctlact : Nfsshare#do_update
# name : nfsshared, method : get, url : /nfsshared, ctlact : Nfsshare#do_display
#
# routes : end
#
# Documentation: https://wiki.contribs.org/Nfsshare
#----------------------------------------------------------------------
#
# Scheme of things:
#
# TBA!!
use strict;
use warnings;
use Mojo::Base 'Mojolicious::Controller';
use constant FALSE => 0;
use constant TRUE => 1;
use Locale::gettext;
use SrvMngr::I18N;
use SrvMngr qw(theme_list init_session);
use Data::Dumper;
use esmith::util;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::HostsDB;
use esmith::DomainsDB;
#The most common ones
our $cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
our $adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
our $ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
our $hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
our $ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
require '/usr/share/smanager/lib/SrvMngr/Controller/Nfsshare-Custom.pm'; #The code that is to be added by the developer
sub main {
#
# Initial entry - route is "/<whatever>"
#
#set initial panel
#for initial panel:
#Specifiy panel to enter
#load up _data hash with DB fields
#load up stash with pointer(s) to control fields hash(= get-))
#and a pointer to the prefix_data hash
#render initial panel
my $c = shift;
$c->app->log->info( $c->log_req );
my %nfs_data = ();
my $title = $c->l('nfs_NFS_data_share');
my $modul = '';
$nfs_data{'trt'} = 'TABLE';
#Load any DB entries into the <prefix>_data area so as they are preset in the form
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
my $db = $cdb; #pickup local or global db or Default to config
# and table control fields
$c->stash(ibays=>$c->get_ibays());
$c->stash(
title => $title,
modul => $modul,
nfs_data => \%nfs_data
);
$c->render( template => "nfsshare" );
}
# Post request with params - submit from the form
sub do_update {
#
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
# parameters in the params hash.
#
#load up all params into prefix_data hash:
#By panel (series of if statements - only one executed):
#call validate-PANEL() - return ret = ok or error message
#if validation not ok:
#render back to current panel with error message in stash
#otherwise:
#By panel (series of if statements - only one executed):
#do whatever is required: call perform-PANEL() - return "ok" or Error Message
#call signal-event for any global actions specified (check it exists - error and continue?)
#if action smeserver-<whatever>-update exists
#signal_event smeserver-<whatever>-update
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
#set success in stash
#if no "nextpanel" entry:
#set firstpanel
#else
#set nextpanel
#call render
my $c = shift;
$c->app->log->info($c->log_req);
my %nfs_data = ();
my $title = $c->l('nfs_NFS_data_share');
# Accessing all POST parameters
my %params = $c->req->params->to_hash;
# Get number of POST parameters
my $num_params = keys %params;
#Params are available in the hash "params" - copy to the prefix_data hash
while (my ($key, $value) = each %{$c->req->params->to_hash}) {
$nfs_data{$key} = $value;
}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'TABLE'; #hidden control on every form.
my $ret = 'ok';
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
my $thispanel;
if ($trt eq 'PARAMS'){
#Validate form parameters for panel PARAMS
$ret = $c->validate_PARAMS(\%nfs_data);
$thispanel = 'PARAMS';
}
if ($trt eq 'TABLE'){
#Validate form parameters for panel TABLE
$ret = $c->validate_TABLE(\%nfs_data);
$thispanel = 'TABLE';
}
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("nfsshare");
} else {
#Do whatever is needed, including writing values to the DB
if ($trt eq 'PARAMS'){
#do whatever is required ...
$ret = $c->perform_PARAMS(\%nfs_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("nfsshare");
} else {
$c->stash( success => $c->l('nfs_PARAMS_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
if ($trt eq 'TABLE'){
#do whatever is required ...
$ret = $c->perform_TABLE(\%nfs_data);
if ($ret ne "ok") {
# return to the panel with error message
$c->stash(error => $c->l($ret));
$c->render("nfsshare");
} else {
$c->stash( success => $c->l('nfs_TABLE_panel_action_was_successful')); #A bit bland - edit it in the lex file
}
}
# and call any signal-events needed
# Setup shared data and call panel
$c->stash(
title => $title,
nfs_data => \%nfs_data
);
if ('none' eq 'none') {
$nfs_data{'trt'} = 'TABLE';
} else {
$nfs_data{'trt'} = 'none';
}
$c->render("nfsshare");
}
}
sub do_display {
#
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
#
# OR it maybe a post from the main panel to add a new record
#
#load up all supplied params into prefix_data hash
#call get-selected-PANEL() - returns hash of all relevent parameters
#load up returned hash into prefix_data
#render - to called panel
my $c = shift;
$c->app->log->info($c->log_req);
my %nfs_data = ();
my $title = $c->l('nfs_NFS_data_share');
# Accessing all parameters
my %params = $c->req->params->to_hash;
# Get number of parameters
my $num_params = keys %params;
#Tag as Post or Get (ie. create new entry or edit existing one
my $is_new_record = ($c->req->method() eq 'POST');
#Params are available in the hash "params" - copy to the prefix_data hash
while (my ($key, $value) = each %{$c->req->params->to_hash}) {
$nfs_data{$key} = $value;
}
# the value of trt will tell you which panel has returned
my $trt = $c->param('trt') || 'TABLE'; #Indicates where to go now
# Now add in the params from the selected row from the table
my %selectedrow;
if ($trt eq 'PARAMS'){
#Validate form parameters for panel PARAMS
%selectedrow = $c->get_selected_PARAMS($nfs_data{'Selected'},$is_new_record);
}
if ($trt eq 'TABLE'){
#Validate form parameters for panel TABLE
%selectedrow = $c->get_selected_TABLE($nfs_data{'Selected'},$is_new_record);
}
#Copy in the selected row params to the prefix_data hash to pass to the panel
while (my ($key, $value) = each %selectedrow){
$nfs_data{$key} = $value;
}
# Where to go now
$nfs_data{'trt'} = $trt;
# Data for panel
$c->stash(
title => $title,
nfs_data => \%nfs_data
);
$c->render("nfsshare");
}
1;

View File

@@ -1,31 +1,39 @@
<div id="Nfsshare-PARAMS">
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-16 11:52
%#
<div id="Nfsshare-PARAMS" class="partial Nfsshare-PARAMS">
<script>
window.onload = function() {
SelectInput();
};
</script>
<h2>
%= l("nfs Hello PARAMS");
%= l('nfs_Hello_PARAMS');
</h2>
% my $btn = l('APPLY');
% my $btn = l('nfs_APPLY');
%= form_for "Nfsshared" => (method => 'POST') => begin
% param 'trt' => $nfs_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $nfs_data->{trt}
%# Inputs etc in here.
<h2>Manage NFS Ibay settings:</h2>
<h1><%=l('NFS_Share_Contrib')%></h1>
<h2><%=l('nfs_Manage_NFS_Ibay_settings:')%></h2>
<p>
%= l('nfs_These parameters will be effective only if the share is enabled. The share is in /home/e-smith/files/ibays//files')
%=l('nfs_These_parameters_will_be_effective')
</p>
<p><span class=label>
%=l('nfs_Information Bay name'), class => 'label'
%=l('nfs_Information_Bay_name')
</span><span class=data>
%= stash("IbayName"), class => 'data'
</span></p>
% param 'IbayName' => $nfs_data->{IbayName} unless param 'IbayName';
%= text_field 'IbayName', size => '50', class => 'input' , pattern=>'.*' , placeholder=>'IbayName'
<br></span></p>
<p><span class=label>
%=l('nfs_Share owner Group')
%=l('nfs_Share_owner_Group')
</span><span class=data>
% my @ShareOwnerGrp_options = ['Write = admin, Read = group', 'Write = group, Read = everyone', 'Write = group, Read = group'];
% param 'ShareOwnerGrp' => $nfs_data->{ShareOwnerGrp} unless param 'ShareOwnerGrp';
@@ -33,7 +41,7 @@
<br></span> </p>
<p><span class=label>
%=l('nfs_Enable the NFS Share')
%=l('nfs_Enable_the_NFS_Share')
</span><span class=data>
% my @EnableNFSshare_options = ['Disabled', 'Enabled'];
% param 'EnableNFSshare' => $nfs_data->{EnableNFSshare} unless param 'EnableNFSshare';
@@ -41,7 +49,7 @@
<br></span> </p>
<p><span class=label>
%=l('nfs_EnableShare on local network')
%=l('nfs_EnableShare_on_local_network')
</span><span class=data>
% my @ShareOnLocalNetwork_options = ['Disabled', 'Enabled'];
% param 'ShareOnLocalNetwork' => $nfs_data->{ShareOnLocalNetwork} unless param 'ShareOnLocalNetwork';
@@ -49,18 +57,18 @@
<br></span> </p>
<p>
%= l('nfs_For writing permissions,allowing the root user and using insecure ports, you must configure a list of one IP per line, being part of the local network(s).')
%=l('nfs_For_writing_permissions,allowing_the_root')
</p>
<span class=label>
%=l('nfs_NFS Client(s) allowed')
%=l('nfs_NFS_Client(s)_allowed')
</span><span class=data>
% param 'NFSClientsAllowed' => $nfs_data->{NFSClientsAllowed} unless param 'NFSClientsAllowed';
%= text_area 'NFSClientsAllowed', cols=>40, rows=>5
</span><br>
<p><span class=label>
%=l('nfs_File system permissions')
%=l('nfs_File_system_permissions')
</span><span class=data>
% my @FileSystemPermissions_options = ['Read only', 'Read and Write'];
% param 'FileSystemPermissions' => $nfs_data->{FileSystemPermissions} unless param 'FileSystemPermissions';
@@ -68,7 +76,7 @@
<br></span> </p>
<p><span class=label>
%=l('nfs_Write (a)synchronously')
%=l('nfs_Write_(a)synchronously')
</span><span class=data>
% my @WriteAsync_options = ['Synchronous', 'Asynchronous'];
% param 'WriteAsync' => $nfs_data->{WriteAsync} unless param 'WriteAsync';
@@ -76,7 +84,7 @@
<br></span> </p>
<p><span class=label>
%=l('nfs_Delays the disk writing')
%=l('nfs_Delays_the_disk_writing')
</span><span class=data>
% my @DelayWrite_options = ['Write delay', 'No write delay'];
% param 'DelayWrite' => $nfs_data->{DelayWrite} unless param 'DelayWrite';
@@ -84,7 +92,7 @@
<br></span> </p>
<p><span class=label>
%=l('nfs_Squash the power of users')
%=l('nfs_Squash_the_power_of_users')
</span><span class=data>
% my @Squash_options = ['All users squash', 'No root squash', 'root squash'];
% param 'Squash' => $nfs_data->{Squash} unless param 'Squash';
@@ -92,7 +100,7 @@
<br></span> </p>
<p><span class=label>
%=l('nfs_Browse the parent folders')
%=l('nfs_Browse_the_parent_folders')
</span><span class=data>
% my @BrowseParents_options = ['Hide folder', 'Show folder'];
% param 'BrowseParents' => $nfs_data->{BrowseParents} unless param 'BrowseParents';
@@ -100,7 +108,7 @@
<br></span> </p>
<p><span class=label>
%=l('nfs_Requests on secure ports')
%=l('nfs_Requests_on_secure_ports')
</span><span class=data>
% my @SecurePorts_options = ['Secure', 'Insecure'];
% param 'SecurePorts' => $nfs_data->{SecurePorts} unless param 'SecurePorts';
@@ -108,27 +116,13 @@
<br></span> </p>
<p>
%= l('nfs_Set the uid and gid if you want all requests appear to be from one user or one group, otherwise leave blank')
%=l('nfs_Set_the_uid_and_gid')
</p>
<p><span class=label>
%=l('nfs_Set the UID.')
</span><span class=data>
% param 'SetUID' => $nfs_data->{SetUID} unless param 'SetUID';
%= text_field 'SetUID', size => '50', class => 'input' , pattern=>'.*' , placeholder=>'SetUID'
<br></span></p>
<p><span class=label>
%=l('nfs_Set the GID.')
</span><span class=data>
% param 'SetGID' => $nfs_data->{SetGID} unless param 'SetGID';
%= text_field 'SetGID', size => '50', class => 'input' , pattern=>'.*' , placeholder=>'SetGID'
<br></span></p>
<span class='data'>
%= submit_button l('Save'), class => 'action'
%= submit_button l('nfs_Save'), class => 'action'
</span>
%# Probably finally by a submit.
% end
%end
</div>

View File

@@ -0,0 +1,49 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-16 11:52
%#
<div id="Nfsshare-TABLE" class="partial Nfsshare-TABLE">
<script>
window.onload = function() {
SelectInput();
};
</script>
<h2>
%= l('nfs_Hello_TABLE');
</h2>
% my $btn = l('nfs_APPLY');
%= form_for "Nfsshared" => (method => 'POST') => begin
% param 'trt' => $nfs_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $nfs_data->{trt}
%# Inputs etc in here.
<h1><%=l('NFS_Share_Contrib')%></h1>
<h2><%=l('nfs_Manage_NFS_Ibay_settings:')%></h2>
<br /><table class="sme-border TableSort sme-table">
<thead>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Name '><%=l('nfs_Name')%></th>
<th class='sme-border table-head-col table-head-col-Description '><%=l('nfs_Description')%></th>
<th class='sme-border table-head-col table-head-col-Nfs status '><%=l('Nfs_status')%></th>
<th class='sme-border table-head-col table-head-col-Action '><%=l('nfs_Action')%></th>
</tr>
</thead>
<tbody>
% my $control_data = $self->stash('ibays');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Name'><%=$c->render_to_string(inline=>$row->{'Name'})%></td>
<td class='sme-border table-col table-col-Description'><%=$c->render_to_string(inline=>$row->{'Description'})%></td>
<td class='sme-border table-col table-col-flag'><%=$c->render_to_string(inline=>$row->{'flag'})%></td>
<td class='sme-border table-col table-col-Modify'><%=$c->render_to_string(inline=>$row->{'Modify'})%></td>
</tr>
%}
</tbody>
</table>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,139 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:3.8.1 On Python:3.12.3 at 2024-09-14 05:33
%#
<div id="Nfsshare-PARAMS" class="partial Nfsshare-PARAMS">
<script>
window.onload = function() {
SelectInput();
};
</script>
<h2>
%= l('nfs_Hello_PARAMS');
</h2>
% my $btn = l('nfs_APPLY');
%= form_for "Nfsshared" => (method => 'POST') => begin
% param 'trt' => ${prefix}_data->{trt} unless param 'trt';
%= hidden_field 'trt' => ${prefix}_data->{trt}
%# Inputs etc in here.
<h2><%=l('nfs_Manage_NFS_Ibay_settings:')%></h2>
<p>
%= l('nfs_These_parameters_will_be_effective')
</p>
<p><span class=label>
%=l('nfs_Information_Bay_name')
</span><span class=data>
%= stash("IbayName")
</span></p>
<p><span class=label>
%=l('nfs_Share_owner_Group')
</span><span class=data>
% my @ShareOwnerGrp_options = ['Write = admin, Read = group', 'Write = group, Read = everyone', 'Write = group, Read = group'];
% param 'ShareOwnerGrp' => ${prefix}_data->{ShareOwnerGrp} unless param 'ShareOwnerGrp';
%= select_field 'ShareOwnerGrp' => @ShareOwnerGrp_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('nfs_Enable_the_NFS_Share')
</span><span class=data>
% my @EnableNFSshare_options = ['Disabled', 'Enabled'];
% param 'EnableNFSshare' => ${prefix}_data->{EnableNFSshare} unless param 'EnableNFSshare';
%= select_field 'EnableNFSshare' => @EnableNFSshare_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('nfs_EnableShare_on_local_network')
</span><span class=data>
% my @ShareOnLocalNetwork_options = ['Disabled', 'Enabled'];
% param 'ShareOnLocalNetwork' => ${prefix}_data->{ShareOnLocalNetwork} unless param 'ShareOnLocalNetwork';
%= select_field 'ShareOnLocalNetwork' => @ShareOnLocalNetwork_options, class => 'input'
<br></span> </p>
<p>
%= l('nfs_For_writing_permissions,allowing_the_root')
</p>
<span class=label>
%=l('nfs_NFS_Client(s)_allowed')
</span><span class=data>
% param 'NFSClientsAllowed' => ${prefix}_data->{NFSClientsAllowed} unless param 'NFSClientsAllowed';
%= text_area 'NFSClientsAllowed', cols=>40, rows=>5
</span><br>
<p><span class=label>
%=l('nfs_File_system_permissions')
</span><span class=data>
% my @FileSystemPermissions_options = ['Read only', 'Read and Write'];
% param 'FileSystemPermissions' => ${prefix}_data->{FileSystemPermissions} unless param 'FileSystemPermissions';
%= select_field 'FileSystemPermissions' => @FileSystemPermissions_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('nfs_Write_(a)synchronously')
</span><span class=data>
% my @WriteAsync_options = ['Synchronous', 'Asynchronous'];
% param 'WriteAsync' => ${prefix}_data->{WriteAsync} unless param 'WriteAsync';
%= select_field 'WriteAsync' => @WriteAsync_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('nfs_Delays_the_disk_writing')
</span><span class=data>
% my @DelayWrite_options = ['Write delay', 'No write delay'];
% param 'DelayWrite' => ${prefix}_data->{DelayWrite} unless param 'DelayWrite';
%= select_field 'DelayWrite' => @DelayWrite_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('nfs_Squash_the_power_of_users')
</span><span class=data>
% my @Squash_options = ['All users squash', 'No root squash', 'root squash'];
% param 'Squash' => ${prefix}_data->{Squash} unless param 'Squash';
%= select_field 'Squash' => @Squash_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('nfs_Browse_the_parent_folders')
</span><span class=data>
% my @BrowseParents_options = ['Hide folder', 'Show folder'];
% param 'BrowseParents' => ${prefix}_data->{BrowseParents} unless param 'BrowseParents';
%= select_field 'BrowseParents' => @BrowseParents_options, class => 'input'
<br></span> </p>
<p><span class=label>
%=l('nfs_Requests_on_secure_ports')
</span><span class=data>
% my @SecurePorts_options = ['Secure', 'Insecure'];
% param 'SecurePorts' => ${prefix}_data->{SecurePorts} unless param 'SecurePorts';
%= select_field 'SecurePorts' => @SecurePorts_options, class => 'input'
<br></span> </p>
<p>
%= l('nfs_Set_the_uid_and_gid')
</p>
<p><span class=label>
%=l('nfs_Set_the_UID.')
</span><span class=data>
% param 'SetUID' => ${prefix}_data->{SetUID} unless param 'SetUID';
%= text_field 'SetUID', size => '50', class => 'input' , pattern=>'.*' , placeholder=>'SetUID'
<br></span></p>
<p><span class=label>
%=l('nfs_Set_the_GID.')
</span><span class=data>
% param 'SetGID' => ${prefix}_data->{SetGID} unless param 'SetGID';
%= text_field 'SetGID', size => '50', class => 'input' , pattern=>'.*' , placeholder=>'SetGID'
<br></span></p>
<span class='data'>
%= submit_button l('nfs_Save'), class => 'action'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@@ -0,0 +1,47 @@
%#
%# Generated by SM2Gen version:0.8 Chameleon version:3.8.1 On Python:3.12.3 at 2024-09-14 05:33
%#
<div id="Nfsshare-TABLE" class="partial Nfsshare-TABLE">
<script>
window.onload = function() {
SelectInput();
};
</script>
<h2>
%= l('nfs_Hello_TABLE');
</h2>
% my $btn = l('nfs_APPLY');
%= form_for "Nfsshared" => (method => 'POST') => begin
% param 'trt' => ${prefix}_data->{trt} unless param 'trt';
%= hidden_field 'trt' => ${prefix}_data->{trt}
%# Inputs etc in here.
<h2><%=l('nfs_Manage_NFS_Ibay_settings:')%></h2>
<br /><table class="sme-border TableSort sme-table">
<thead>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Name '><%=l('nfs_Name')%></th>
<th class='sme-border table-head-col table-head-col-Description '><%=l('nfs_Description')%></th>
<th class='sme-border table-head-col table-head-col-Nfs status '><%=l('Nfs_status')%></th>
<th class='sme-border table-head-col table-head-col-Action '><%=l('nfs_Action')%></th>
</tr>
</thead>
<tbody>
% my $control_data = $self->stash('ibays');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Name'><%=$c->render_to_string(inline=>$row->{Name})%></td>
<td class='sme-border table-col table-col-Description'><%=$c->render_to_string(inline=>$row->{Description})%></td>
<td class='sme-border table-col table-col-flag'><%=$c->render_to_string(inline=>$row->{flag})%></td>
<td class='sme-border table-col table-col-Modify'><%=$c->render_to_string(inline=>$row->{Modify})%></td>
</tr>
%}
</tbody>
</table>
%# Probably finally by a submit.
%end
</div>

Binary file not shown.

View File

@@ -1,4 +1,7 @@
% layout 'default', title => "Sme server 2 - NFS data share", share_dir => './';
%#
%# Generated by SM2Gen version:0.8 Chameleon version:4.5.4 On Python:3.12.3 at 2024-09-16 11:52
%#
% content_for 'module' => begin
<div id="module" class="module Nfsshare-panel">
@@ -35,6 +38,7 @@
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($nfs_data->{trt} eq "PARAMS") {
%= include 'partials/_nfs_PARAMS'

View File

@@ -0,0 +1,30 @@
'nfs_NFS_data_share' => "NFS дял за данни",
'nfs_NFS_Client(s)_allowed' => "Клиент(и) на NFS разрешени",
'nfs_Manage_NFS_Ibay_settings:' => "Управление на настройки за NFS Ibay:",
'nfs_Squash_the_power_of_users' => "Разпределете силата на потребителите",
'nfs_Set_the_UID.' => "Задайте UID.",
'nfs_Enable_the_NFS_Share' => "Активирайте NFS споделянето",
'nfs_Requests_on_secure_ports' => "Заявки на защитени портове",
'nfs_Save' => "Запази",
'nfs_Delays_the_disk_writing' => "Забавя записването на диска",
'nfs_Set_the_GID.' => "Задайте GID.",
'nfs_Name' => "Име",
'nfs_These_parameters_will_be_effective' => "Ефектът на тези параметри ще бъде валиден само ако споделянето е активирано. Споделянето се намира в /home/e-smith/files/ibays//files",
'nfs_Hello_TABLE' => "Здравей, ТАБЛИЦА",
'nfs_PARAMS_panel_action_was_successful' => "Действието на панела PARAMS беше успешно.",
'nfs_TABLE_panel_action_was_successful' => "Табличното действие на панела беше успешно.",
'nfs_Action' => "Действие",
'Nfs_status' => "Състояние",
'nfs_Write_(a)synchronously' => "Пишете (а)синхронно",
'nfs_For_writing_permissions,allowing_the_root' => "За разрешения за запис, разрешаването на root потребител и използването на незащитени портове, трябва да конфигурирате списък с по един IP на ред, който да бъде част от локалната мрежа(и).",
'nfs_Browse_the_parent_folders' => "Преглед на родителските папки",
'nfs_File_system_permissions' => "Разрешения на файловата система",
'nfs_Hello_PARAMS' => "Здравейте PARAMS",
'nfs_EnableShare_on_local_network' => "Активиране на споделяне в локалната мрежа",
'nfs_Set_the_uid_and_gid' => "Задайте uid и gid, ако искате всички заявки да изглеждат като от един потребител или една група. В противен случай оставете празно.",
'nfs_APPLY' => "Приложи",
'nfs_Description' => "Описание",
'nfs_Information_Bay_name' => "Име на Информационния Бей",
'nfs_Share_owner_Group' => "```
Сподели собственик Група
```",

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Speichern",
'nfs_Hello_TABLE' => "~~~Hallo TABELLE~~~",
'nfs_Hello_PARAMS' => "Hallo PARAMS",
'nfs_Requests_on_secure_ports' => "Anfragen auf sicheren Ports",
'nfs_File_system_permissions' => "Dateisystem-Berechtigungen",
'nfs_NFS_Client(s)_allowed' => "~~~NFS-Clients erlaubt~~~",
'nfs_NFS_data_share' => "NFS-Datenfreigabe",
'nfs_APPLY' => "Anwenden",
'nfs_Enable_the_NFS_Share' => "~~~NFS-Freigabe aktivieren~~~",
'nfs_For_writing_permissions,allowing_the_root' => "Für Schreibrechte, Zulassen des Root-Benutzers und Verwendung unsicherer Ports müssen Sie eine Liste mit einer IP pro Zeile konfigurieren, die Teil der lokalen Netzwerke ist.",
'nfs_Set_the_uid_and_gid' => "~~~Legen Sie die uid und gid fest, wenn alle Anfragen von einem Benutzer oder einer Gruppe stammen sollen. Andernfalls leer lassen~~~",
'nfs_Set_the_GID.' => "GID festlegen",
'nfs_TABLE_panel_action_was_successful' => "TABELLE Panelaktion war erfolgreich",
'Nfs_status' => "Status",
'nfs_PARAMS_panel_action_was_successful' => "~~~PARAMETER-Panelaktion war erfolgreich~~~",
'nfs_Information_Bay_name' => "~~~Informationsbucht-Name~~~",
'nfs_Delays_the_disk_writing' => "~~~Verzögert das Schreiben auf die Festplatte~~~",
'nfs_Share_owner_Group' => "~~~Besitzergruppen freigeben~~~",
'nfs_Description' => "Beschreibung",
'nfs_Write_(a)synchronously' => "Schreiben (a)synchron",
'nfs_Manage_NFS_Ibay_settings:' => "~~~NFS Ibay-Einstellungen verwalten:~~~",
'nfs_Name' => "Name",
'nfs_Set_the_UID.' => "UID festlegen.",
'nfs_Squash_the_power_of_users' => "Die Benutzerrechte einschränken",
'nfs_EnableShare_on_local_network' => "~~~Freigabe im lokalen Netzwerk aktivieren~~~",
'nfs_These_parameters_will_be_effective' => "Diese Parameter sind nur wirksam, wenn die Freigabe aktiviert ist. Die Freigabe befindet sich in /home/e-smith/files/ibays//files",
'nfs_Browse_the_parent_folders' => "Durchsuchen Sie die übergeordneten Ordner",
'nfs_Action' => "Aktion",

View File

@@ -0,0 +1,28 @@
'nfs_APPLY' => "Anvend",
'nfs_NFS_Client(s)_allowed' => "Tilladte NFS-klient(er)",
'nfs_TABLE_panel_action_was_successful' => "Handlingspanelet for TABEL var vellykket",
'nfs_Share_owner_Group' => "Del ejergruppe",
'nfs_Information_Bay_name' => "Information Bay navn",
'nfs_Write_(a)synchronously' => "Skriv (a)synkront",
'nfs_Squash_the_power_of_users' => "Knus brugernes magt",
'nfs_For_writing_permissions,allowing_the_root' => "For at skrive tilladelser, Tillade root-brugeren og bruge usikre porte, Du skal konfigurere en liste med én IP pr. linje, Som er en del af de lokale netværk.",
'nfs_Hello_PARAMS' => "~~~Hej PARAMS~~~",
'nfs_PARAMS_panel_action_was_successful' => "PARAMS panelet var vellykket",
'nfs_Enable_the_NFS_Share' => "Aktiver NFS-deling",
'nfs_NFS_data_share' => "NFS-deling af data",
'nfs_Set_the_UID.' => "Indstil UID.",
'nfs_Manage_NFS_Ibay_settings:' => "Administrer NFS Ibay indstillinger:",
'nfs_Browse_the_parent_folders' => "Gennemse de overordnede mapper",
'nfs_These_parameters_will_be_effective' => "Disse parametre vil kun træde i kraft, hvis delingen er aktiveret. Delingen er i /home/e-smith/files/ibays//files",
'nfs_Hello_TABLE' => "~~~Hej TABEL~~~",
'nfs_Description' => "Beskrivelse",
'nfs_Set_the_uid_and_gid' => "Indstil uid og gid, hvis du ønsker, at alle forespørgsler skal se ud til at være fra en bruger eller en gruppe. Ellers lad det være tomt.",
'nfs_EnableShare_on_local_network' => "Aktiver deling på lokalt netværk",
'nfs_Set_the_GID.' => "Indstil GID.",
'nfs_Save' => "Gem",
'nfs_Requests_on_secure_ports' => "Anmodninger på sikre porte",
'nfs_Action' => "Handling",
'nfs_Delays_the_disk_writing' => "Forsinker disk skrivning",
'Nfs_status' => "Status",
'nfs_Name' => "Navn",
'nfs_File_system_permissions' => "Filsystem tilladelser",

View File

@@ -0,0 +1,30 @@
'nfs_Save' => "Αποθήκευση",
'nfs_Hello_TABLE' => "~~~Γειά σου ΠΙΝΑΚΑΣ~~~",
'nfs_Hello_PARAMS' => "Γειά σας PARAMS",
'nfs_Requests_on_secure_ports' => "Αιτήματα σε ασφαλείς θύρες",
'nfs_File_system_permissions' => "Άδειες συστήματος αρχείων",
'nfs_NFS_Client(s)_allowed' => "Επιτρεπόμενοι NFS πελάτες",
'nfs_NFS_data_share' => "Κοινή χρήση δεδομένων NFS",
'nfs_APPLY' => "Εφαρμογή",
'nfs_Enable_the_NFS_Share' => "Ενεργοποιήστε την κοινή χρήση NFS",
'nfs_For_writing_permissions,allowing_the_root' => "Για δικαιώματα εγγραφής, Επιτρέποντας τον χρήστη root και χρησιμοποιώντας μη ασφαλείς θύρες, Πρέπει να διαμορφώσετε μια λίστα με μία IP ανά γραμμή, Όντας μέρος των τοπικών δικτύων.",
'nfs_Set_the_uid_and_gid' => "Ορίστε το uid και gid αν θέλετε όλα τα αιτήματα να φαίνονται από έναν χρήστη ή μία ομάδα, διαφορετικά αφήστε το κενό",
'nfs_Set_the_GID.' => "Ορίστε το GID.",
'nfs_TABLE_panel_action_was_successful' => "Η ενέργεια του πίνακα ΤΑΒΛΑ ήταν επιτυχής",
'Nfs_status' => "Κατάσταση",
'nfs_PARAMS_panel_action_was_successful' => "Η ενέργεια του πίνακα PARAMS ήταν επιτυχής",
'nfs_Information_Bay_name' => "Όνομα Κόλπου Πληροφοριών",
'nfs_Delays_the_disk_writing' => "Καθυστερεί την εγγραφή στο δίσκο",
'nfs_Share_owner_Group' => "Κοινή χρήση ομάδας ιδιοκτήτη",
'nfs_Description' => "Περιγραφή",
'nfs_Write_(a)synchronously' => "Γράψτε (α)σύγχρονα",
'nfs_Manage_NFS_Ibay_settings:' => "Διαχείριση ρυθμίσεων NFS Ibay:",
'nfs_Name' => "Όνομα",
'nfs_Set_the_UID.' => "Ορίστε το UID.",
'nfs_Squash_the_power_of_users' => "~~~
Περιορίστε τα δικαιώματα των χρηστών
~~~",
'nfs_EnableShare_on_local_network' => "Ενεργοποίηση κοινής χρήσης στο τοπικό δίκτυο",
'nfs_These_parameters_will_be_effective' => "~~~Αυτές οι παράμετροι θα είναι αποτελεσματικές μόνο αν είναι ενεργοποιημένη η κοινή χρήση. Η κοινή χρήση βρίσκεται στο /home/e-smith/files/ibays//files~~~",
'nfs_Browse_the_parent_folders' => "Περιήγηση στους γονικούς φακέλους",
'nfs_Action' => "Ενέργεια",

View File

@@ -0,0 +1,27 @@
'NFS_Share_Contrib' => 'Share Contrib',
'nfs_NFS_Client(s)_allowed' => 'NFS Client(s) allowed',
'nfs_These_parameters_will_be_effective' => 'These parameters will be effective only if the share is enabled. The share is in /home/e-smith/files/ibays//files',
'nfs_For_writing_permissions,allowing_the_root' => 'For writing permissions, Allowing the root user and using insecure ports, You must configure a list of one IP per line, Being part of the local network(s). ',
'nfs_Requests_on_secure_ports' => 'Requests on secure ports',
'nfs_Write_(a)synchronously' => 'Write (a)synchronously',
'nfs_Share_owner_Group' => 'Share owner Group',
'nfs_NFS_data_share' => 'NFS data share',
'nfs_Action' => 'Action',
'nfs_Hello_TABLE' => 'Hello TABLE',
'nfs_APPLY' => 'Apply',
'nfs_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful',
'nfs_File_system_permissions' => 'File system permissions',
'Nfs_status' => 'Status',
'nfs_EnableShare_on_local_network' => 'Enableshare on local network',
'nfs_Description' => 'Description',
'nfs_Information_Bay_name' => 'Information Bay name',
'nfs_Browse_the_parent_folders' => 'Browse the parent folders',
'nfs_Set_the_uid_and_gid' => 'Set the uid and gid if you want all requests appear to be from one user or one group, Otherwise leave blank',
'nfs_Squash_the_power_of_users' => 'Squash the power of users',
'nfs_Save' => 'Save',
'nfs_Delays_the_disk_writing' => 'Delays the disk writing',
'nfs_Name' => 'Name',
'nfs_Hello_PARAMS' => 'Hello PARAMS',
'nfs_TABLE_panel_action_was_successful' => 'TABLE panel action was successful',
'nfs_Manage_NFS_Ibay_settings:' => 'Manage NFS Ibay settings:',
'nfs_Enable_the_NFS_Share' => 'Enable the NFS Share',

94
Targets/Nfsshare/nfsshare_en.po Executable file
View File

@@ -0,0 +1,94 @@
#
msgid ""
msgstr ""
msgid "nfs_APPLY"
msgstr "Apply',"
msgid "nfs_NFS_Client(s)_allowed"
msgstr "NFS Client(s) allowed',"
msgid "nfs_TABLE_panel_action_was_successful"
msgstr "TABLE panel action was successful',"
msgid "nfs_Share_owner_Group"
msgstr "Share owner Group',"
msgid "nfs_Information_Bay_name"
msgstr "Information Bay name',"
msgid "nfs_Write_(a)synchronously"
msgstr "Write (a)synchronously',"
msgid "nfs_Squash_the_power_of_users"
msgstr "Squash the power of users',"
msgid "nfs_For_writing_permissions,allowing_the_root"
msgstr ""
"For writing permissions, Allowing the root user and using insecure ports, "
"You must configure a list of one IP per line, Being part of the local "
"network(s). ',"
msgid "nfs_Hello_PARAMS"
msgstr "Hello PARAMS',"
msgid "nfs_PARAMS_panel_action_was_successful"
msgstr "PARAMS panel action was successful',"
msgid "nfs_Enable_the_NFS_Share"
msgstr "Enable the NFS Share',"
msgid "nfs_NFS_data_share"
msgstr "NFS data share',"
msgid "nfs_Set_the_UID."
msgstr "Set the UID. ',"
msgid "nfs_Manage_NFS_Ibay_settings:"
msgstr "Manage NFS Ibay settings:',"
msgid "nfs_Browse_the_parent_folders"
msgstr "Browse the parent folders',"
msgid "nfs_These_parameters_will_be_effective"
msgstr ""
"These parameters will be effective only if the share is enabled. The share "
"is in /home/e-smith/files/ibays//files',"
msgid "nfs_Hello_TABLE"
msgstr "Hello TABLE',"
msgid "nfs_Description"
msgstr "Description',"
msgid "nfs_Set_the_uid_and_gid"
msgstr ""
"Set the uid and gid if you want all requests appear to be from one user or "
"one group, Otherwise leave blank',"
msgid "nfs_EnableShare_on_local_network"
msgstr "Enableshare on local network',"
msgid "nfs_Set_the_GID."
msgstr "Set the GID. ',"
msgid "nfs_Save"
msgstr "Save',"
msgid "nfs_Requests_on_secure_ports"
msgstr "Requests on secure ports',"
msgid "nfs_Action"
msgstr "Action',"
msgid "nfs_Delays_the_disk_writing"
msgstr "Delays the disk writing',"
msgid "Nfs_status"
msgstr "Status',"
msgid "nfs_Name"
msgstr "Name',"
msgid "nfs_File_system_permissions"
msgstr "File system permissions',"

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Guardar",
'nfs_Hello_TABLE' => "~~~Hola MESA~~~",
'nfs_Hello_PARAMS' => "~~~Hola PARAMS~~~",
'nfs_Requests_on_secure_ports' => "~~Solicitudes en puertos seguros~~",
'nfs_File_system_permissions' => "Permisos del sistema de archivos",
'nfs_NFS_Client(s)_allowed' => "Clientes NFS permitidos",
'nfs_NFS_data_share' => "Compartición de datos NFS",
'nfs_APPLY' => "Aplicar",
'nfs_Enable_the_NFS_Share' => "~~~Habilitar el recurso compartido NFS~~~",
'nfs_For_writing_permissions,allowing_the_root' => "Para permisos de escritura, permitiendo al usuario root y usando puertos inseguros, debe configurar una lista de una IP por línea, siendo parte de la(s) red(es) local(es).",
'nfs_Set_the_uid_and_gid' => "Establezca el uid y gid si desea que todas las solicitudes parezcan ser de un solo usuario o de un solo grupo, de lo contrario, deje en blanco",
'nfs_Set_the_GID.' => "Establecer el GID.",
'nfs_TABLE_panel_action_was_successful' => "Acción de panel de TABLA fue exitosa",
'Nfs_status' => "Estado",
'nfs_PARAMS_panel_action_was_successful' => "La acción del panel de PARAMS fue exitosa",
'nfs_Information_Bay_name' => "Nombre de la Bahía de Información",
'nfs_Delays_the_disk_writing' => "Retrasa la escritura en disco",
'nfs_Share_owner_Group' => "Compartir grupo de propietarios",
'nfs_Description' => "Descripción",
'nfs_Write_(a)synchronously' => "Escribir (a)síncronamente",
'nfs_Manage_NFS_Ibay_settings:' => "Administrar configuraciones de NFS Ibay:",
'nfs_Name' => "Nombre",
'nfs_Set_the_UID.' => "Establecer el UID.",
'nfs_Squash_the_power_of_users' => "Aplastar el poder de los usuarios",
'nfs_EnableShare_on_local_network' => "Habilitar compartir en la red local",
'nfs_These_parameters_will_be_effective' => "Estos parámetros serán efectivos solo si el recurso compartido está habilitado. El recurso compartido está en /home/e-smith/files/ibays//files",
'nfs_Browse_the_parent_folders' => "Explorar las carpetas principales",
'nfs_Action' => "Acción",

95
Targets/Nfsshare/nfsshare_es.po Executable file
View File

@@ -0,0 +1,95 @@
#
msgid ""
msgstr ""
msgid "nfs_Save"
msgstr "\"Guardar\","
msgid "nfs_Hello_TABLE"
msgstr "\"~~~Hola MESA~~~\","
msgid "nfs_Hello_PARAMS"
msgstr "\"~~~Hola PARAMS~~~\","
msgid "nfs_Requests_on_secure_ports"
msgstr "\"~~Solicitudes en puertos seguros~~\","
msgid "nfs_File_system_permissions"
msgstr "\"Permisos del sistema de archivos\","
msgid "nfs_NFS_Client(s)_allowed"
msgstr "\"Clientes NFS permitidos\","
msgid "nfs_NFS_data_share"
msgstr "\"Compartición de datos NFS\","
msgid "nfs_APPLY"
msgstr "\"Aplicar\","
msgid "nfs_Enable_the_NFS_Share"
msgstr "\"~~~Habilitar el recurso compartido NFS~~~\","
msgid "nfs_For_writing_permissions,allowing_the_root"
msgstr ""
"\"Para permisos de escritura, permitiendo al usuario root y usando puertos "
"inseguros, debe configurar una lista de una IP por línea, siendo parte de "
"la(s) red(es) local(es).\","
msgid "nfs_Set_the_uid_and_gid"
msgstr ""
"\"Establezca el uid y gid si desea que todas las solicitudes parezcan ser de"
" un solo usuario o de un solo grupo, de lo contrario, deje en blanco\","
msgid "nfs_Set_the_GID."
msgstr "\"Establecer el GID.\","
msgid "nfs_TABLE_panel_action_was_successful"
msgstr "\"Acción de panel de TABLA fue exitosa\","
msgid "Nfs_status"
msgstr "\"Estado\","
msgid "nfs_PARAMS_panel_action_was_successful"
msgstr "\"La acción del panel de PARAMS fue exitosa\","
msgid "nfs_Information_Bay_name"
msgstr "\"Nombre de la Bahía de Información\","
msgid "nfs_Delays_the_disk_writing"
msgstr "\"Retrasa la escritura en disco\","
msgid "nfs_Share_owner_Group"
msgstr "\"Compartir grupo de propietarios\","
msgid "nfs_Description"
msgstr "\"Descripción\","
msgid "nfs_Write_(a)synchronously"
msgstr "\"Escribir (a)síncronamente\","
msgid "nfs_Manage_NFS_Ibay_settings:"
msgstr "\"Administrar configuraciones de NFS Ibay:\","
msgid "nfs_Name"
msgstr "\"Nombre\","
msgid "nfs_Set_the_UID."
msgstr "\"Establecer el UID.\","
msgid "nfs_Squash_the_power_of_users"
msgstr "\"Aplastar el poder de los usuarios\","
msgid "nfs_EnableShare_on_local_network"
msgstr "\"Habilitar compartir en la red local\","
msgid "nfs_These_parameters_will_be_effective"
msgstr ""
"\"Estos parámetros serán efectivos solo si el recurso compartido está "
"habilitado. El recurso compartido está en "
"/home/e-smith/files/ibays//files\","
msgid "nfs_Browse_the_parent_folders"
msgstr "\"Explorar las carpetas principales\","
msgid "nfs_Action"
msgstr "\"Acción\","

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Salvesta",
'nfs_Hello_TABLE' => "~~~Tere, TABEL~~~",
'nfs_Hello_PARAMS' => "Tere PARAMS",
'nfs_Requests_on_secure_ports' => "Päringud turvatud portidele",
'nfs_File_system_permissions' => "Failisüsteemi õigused",
'nfs_NFS_Client(s)_allowed' => "NFS Kliendid lubatud",
'nfs_NFS_data_share' => "NFS andmejagamine",
'nfs_APPLY' => "~~~Rakenda~~~",
'nfs_Enable_the_NFS_Share' => "~~Luba NFS-jagamine~~",
'nfs_For_writing_permissions,allowing_the_root' => "Kirjutamisõiguste jaoks, root-kasutaja lubamine ja ebaturvaliste portide kasutamine, peate seadistama nimekirja, kus iga IP on eraldi real, olles osa kohalikust võrgust/võrkudest.",
'nfs_Set_the_uid_and_gid' => "Määrake uid ja gid, kui soovite, et kõik päringud näiksid pärinevat ühelt kasutajalt või ühest grupist. Vastasel juhul jätke tühjaks.",
'nfs_Set_the_GID.' => "Määra GID.",
'nfs_TABLE_panel_action_was_successful' => "TABELI paneeli toiming õnnestus",
'Nfs_status' => "Olek",
'nfs_PARAMS_panel_action_was_successful' => "PARAMS paneeli tegevus oli edukas",
'nfs_Information_Bay_name' => "Informatsiooni jaotuse nimi",
'nfs_Delays_the_disk_writing' => "Viivitab ketta kirjutamisega",
'nfs_Share_owner_Group' => "Jaga omaniku rühma",
'nfs_Description' => "Kirjeldus",
'nfs_Write_(a)synchronously' => "Kirjuta (a)sünkroonselt",
'nfs_Manage_NFS_Ibay_settings:' => "Halda NFS Ibay seadeid:",
'nfs_Name' => "Nimi",
'nfs_Set_the_UID.' => "Määra UID.",
'nfs_Squash_the_power_of_users' => "Kasutajate volituste eemaldamine",
'nfs_EnableShare_on_local_network' => "Jaga kohaliku võrgus",
'nfs_These_parameters_will_be_effective' => "Need parameetrid rakenduvad ainult siis, kui jagamine on lubatud. Jagamine asub /home/e-smith/files/ibays//files.",
'nfs_Browse_the_parent_folders' => "Sirvi ülemkaustu",
'nfs_Action' => "Toiming",

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Sauvegarder",
'nfs_Hello_TABLE' => "Bonjour TABLE",
'nfs_Hello_PARAMS' => "Bonjour PARAMS",
'nfs_Requests_on_secure_ports' => "Requêtes sur ports sécurisés",
'nfs_File_system_permissions' => "Autorisations du système de fichiers",
'nfs_NFS_Client(s)_allowed' => "Clients NFS autorisés",
'nfs_NFS_data_share' => "Partage de données NFS",
'nfs_APPLY' => "Appliquer",
'nfs_Enable_the_NFS_Share' => "~~~Activer le partage NFS~~~",
'nfs_For_writing_permissions,allowing_the_root' => "Pour les autorisations d\'écriture, permettre à l\'utilisateur root et utiliser des ports non sécurisés, vous devez configurer une liste d\'une IP par ligne, faisant partie du ou des réseaux locaux.",
'nfs_Set_the_uid_and_gid' => "Définissez l\'uid et le gid si vous souhaitez que toutes les requêtes semblent provenir d\'un seul utilisateur ou d\'un seul groupe. Sinon, laissez vide.",
'nfs_Set_the_GID.' => "Définir le GID.",
'nfs_TABLE_panel_action_was_successful' => "Action du panneau TABLE réussie",
'Nfs_status' => "Statut",
'nfs_PARAMS_panel_action_was_successful' => "Le panneau PARAMS a été mis à jour avec succès",
'nfs_Information_Bay_name' => "Nom de la baie d\'information",
'nfs_Delays_the_disk_writing' => "~~~Retarde l\'écriture du disque~~~",
'nfs_Share_owner_Group' => "Partager le groupe propriétaire",
'nfs_Description' => "Description",
'nfs_Write_(a)synchronously' => "~~~Écrire (a)synchrone~~~",
'nfs_Manage_NFS_Ibay_settings:' => "~~~Gérer les paramètres NFS Ibay:~~~",
'nfs_Name' => "Nom",
'nfs_Set_the_UID.' => "Définir l\'UID.",
'nfs_Squash_the_power_of_users' => "Réduire les privilèges des utilisateurs",
'nfs_EnableShare_on_local_network' => "Activer le partage sur le réseau local",
'nfs_These_parameters_will_be_effective' => "Ces paramètres seront effectifs uniquement si le partage est activé. Le partage se trouve dans /home/e-smith/files/ibays//files",
'nfs_Browse_the_parent_folders' => "Parcourir les dossiers parents",
'nfs_Action' => "Action",

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Mentés",
'nfs_Hello_TABLE' => "~~~Helló TÁBLA~~~",
'nfs_Hello_PARAMS' => "~~~Helló PARAMS~~~",
'nfs_Requests_on_secure_ports' => "Lekérdezések biztonságos portokon",
'nfs_File_system_permissions' => "Fájlrendszer jogosultságok",
'nfs_NFS_Client(s)_allowed' => "Engedélyezett NFS kliens(ek)",
'nfs_NFS_data_share' => "NFS adatmegosztás",
'nfs_APPLY' => "Alkalmazás",
'nfs_Enable_the_NFS_Share' => "NFS-megosztás engedélyezése",
'nfs_For_writing_permissions,allowing_the_root' => "Írási engedélyekhez, a root felhasználó engedélyezése és nem biztonságos portok használata esetén konfigurálnia kell egy listát, amelyben egy IP cím egy sorban szerepel, és amely a helyi hálózat(ok) része.",
'nfs_Set_the_uid_and_gid' => "Állítsa be a uid és gid értékeket, ha azt szeretné, hogy minden kérés egy felhasználótól vagy egy csoporttól származzon. Ellenkező esetben hagyja üresen.",
'nfs_Set_the_GID.' => "Állítsa be a GID-t.",
'nfs_TABLE_panel_action_was_successful' => "A TÁBLA panel művelet sikeres volt",
'Nfs_status' => "Állapot",
'nfs_PARAMS_panel_action_was_successful' => "~~~PARAMS panel akció sikeres volt~~~",
'nfs_Information_Bay_name' => "Információs öböl neve",
'nfs_Delays_the_disk_writing' => "Késlelteti a lemezírást",
'nfs_Share_owner_Group' => "Oszd meg a tulajdonosi csoportot",
'nfs_Description' => "Leírás",
'nfs_Write_(a)synchronously' => "Írás (a)szinkronban",
'nfs_Manage_NFS_Ibay_settings:' => "~~NFS Ibay beállítások kezelése~~",
'nfs_Name' => "Név",
'nfs_Set_the_UID.' => "Állítsa be az UID-t.",
'nfs_Squash_the_power_of_users' => "Felhasználók hatalmának visszavonása",
'nfs_EnableShare_on_local_network' => "Megosztás engedélyezése helyi hálózaton",
'nfs_These_parameters_will_be_effective' => "Ezek a beállítások csak akkor lépnek érvénybe, ha a megosztás engedélyezve van. A megosztás a /home/e-smith/files/ibays//files mappában található.",
'nfs_Browse_the_parent_folders' => "Tallózás a szülőmappák között",
'nfs_Action' => "Művelet",

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Simpan",
'nfs_Hello_TABLE' => "Halo TABEL",
'nfs_Hello_PARAMS' => "Halo PARAMS",
'nfs_Requests_on_secure_ports' => "Permintaan pada port aman",
'nfs_File_system_permissions' => "Izin sistem berkas",
'nfs_NFS_Client(s)_allowed' => "Klien NFS diizinkan",
'nfs_NFS_data_share' => "Berbagi data NFS",
'nfs_APPLY' => "Terapkan",
'nfs_Enable_the_NFS_Share' => "Aktifkan NFS Share",
'nfs_For_writing_permissions,allowing_the_root' => "Untuk izin menulis, Izinkan pengguna root dan gunakan port yang tidak aman, Anda harus mengonfigurasi daftar satu IP per baris, Menjadi bagian dari jaringan lokal.",
'nfs_Set_the_uid_and_gid' => "Tetapkan uid dan gid jika Anda ingin semua permintaan terlihat dari satu pengguna atau satu grup, Jika tidak biarkan kosong",
'nfs_Set_the_GID.' => "Tetapkan GID.",
'nfs_TABLE_panel_action_was_successful' => "~~PANEL tabel berhasil dilakukan~~~",
'Nfs_status' => "Status",
'nfs_PARAMS_panel_action_was_successful' => "Panel PARAMS berhasil dijalankan",
'nfs_Information_Bay_name' => "Nama Pusat Informasi",
'nfs_Delays_the_disk_writing' => "Menunda penulisan disk",
'nfs_Share_owner_Group' => "Berbagi Grup Pemilik",
'nfs_Description' => "Deskripsi",
'nfs_Write_(a)synchronously' => "Tulis (a)sinkronisasi",
'nfs_Manage_NFS_Ibay_settings:' => "Kelola pengaturan NFS Ibay:",
'nfs_Name' => "Nama",
'nfs_Set_the_UID.' => "Tetapkan UID.",
'nfs_Squash_the_power_of_users' => "~~~Kurangi hak akses pengguna~~~",
'nfs_EnableShare_on_local_network' => "Mengaktifkan berbagi di jaringan lokal",
'nfs_These_parameters_will_be_effective' => "Parameter ini akan efektif hanya jika share diaktifkan. Share berada di /home/e-smith/files/ibays/files",
'nfs_Browse_the_parent_folders' => "Menjelajahi folder induk",
'nfs_Action' => "Aksi",

View File

@@ -0,0 +1,28 @@
'nfs_APPLY' => "החל",
'nfs_NFS_Client(s)_allowed' => "לקוחות NFS מורשים",
'nfs_TABLE_panel_action_was_successful' => "הפעולה של לוח TABLE הצליחה",
'nfs_Share_owner_Group' => "שתף קבוצת בעלי מניות",
'nfs_Information_Bay_name' => "שם מפרץ המידע",
'nfs_Write_(a)synchronously' => "~~~כתוב (באופן) סינכרוני/אסינכרוני~~~",
'nfs_Squash_the_power_of_users' => "~~~להמעיט את כוח המשתמשים~~~",
'nfs_For_writing_permissions,allowing_the_root' => "כדי לקבל הרשאות כתיבה, לאפשר את משתמש השורש ולהשתמש ביציאות לא מאובטחות, יש להגדיר רשימה של כתובת IP אחת בכל שורה, כחלק מהרשת המקומית.",
'nfs_Hello_PARAMS' => "שלום PARAMS",
'nfs_PARAMS_panel_action_was_successful' => "פאנל הדֶפָאוֹת ביצע את הפעולה בהצלחה",
'nfs_Enable_the_NFS_Share' => "אפשר שיתוף NFS",
'nfs_NFS_data_share' => "שיתוף נתונים NFS",
'nfs_Set_the_UID.' => "הגדר את ה-UID.",
'nfs_Manage_NFS_Ibay_settings:' => "נהל הגדרות NFS Ibay:",
'nfs_Browse_the_parent_folders' => "עיין בתיקיות האב",
'nfs_These_parameters_will_be_effective' => "פרמטרים אלו יהיו בתוקף רק אם השיתוף מופעל. השיתוף נמצא ב-/home/e-smith/files/ibays/files",
'nfs_Hello_TABLE' => "~~~שלום TABLE~~~",
'nfs_Description' => "תיאור",
'nfs_Set_the_uid_and_gid' => "~~~הגדר את ה-uid וה-gid אם ברצונך שכל הבקשות ייראו כאילו הן מגיעות ממשתמש אחד או מקבוצה אחת, אחרת השאר ריק~~~",
'nfs_EnableShare_on_local_network' => "אפשר שיתוף ברשת המקומית",
'nfs_Set_the_GID.' => "קבע את ה-GID.",
'nfs_Save' => "שמור",
'nfs_Requests_on_secure_ports' => "בקשות על יציאות מאובטחות",
'nfs_Action' => "פעולה",
'nfs_Delays_the_disk_writing' => "מעכב את כתיבת הדיסק",
'Nfs_status' => "סטטוס",
'nfs_Name' => "~~שם~~",
'nfs_File_system_permissions' => "הרשאות מערכת קבצים",

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Salva",
'nfs_Hello_TABLE' => "Ciao TABELLA",
'nfs_Hello_PARAMS' => "Ciao PARAMS",
'nfs_Requests_on_secure_ports' => "Richieste su porte sicure",
'nfs_File_system_permissions' => "Autorizzazioni del file system",
'nfs_NFS_Client(s)_allowed' => "~~Client NFS autorizzati~~",
'nfs_NFS_data_share' => "Condivisione dati NFS",
'nfs_APPLY' => "Applicare",
'nfs_Enable_the_NFS_Share' => "Abilita la condivisione NFS",
'nfs_For_writing_permissions,allowing_the_root' => "Per i permessi di scrittura, consentire all\'utente root e utilizzare porte insicure, è necessario configurare un elenco di un IP per riga, facente parte della rete locale.",
'nfs_Set_the_uid_and_gid' => "Imposta l\'uid e il gid se desideri che tutte le richieste appaiano provenienti da un unico utente o da un unico gruppo, altrimenti lascia vuoto",
'nfs_Set_the_GID.' => "Imposta il GID.",
'nfs_TABLE_panel_action_was_successful' => "L\'azione del pannello TABELLA è stata completata con successo",
'Nfs_status' => "Stato",
'nfs_PARAMS_panel_action_was_successful' => "~~~L\'azione del pannello PARAMS è stata completata con successo~~~",
'nfs_Information_Bay_name' => "Nome della Baia Informazioni",
'nfs_Delays_the_disk_writing' => "Ritarda la scrittura su disco",
'nfs_Share_owner_Group' => "Condividi gruppo proprietario",
'nfs_Description' => "Descrizione",
'nfs_Write_(a)synchronously' => "Scrivi (a)sicronamente",
'nfs_Manage_NFS_Ibay_settings:' => "Gestisci impostazioni NFS Ibay:",
'nfs_Name' => "Nome",
'nfs_Set_the_UID.' => "Imposta l\'UID.",
'nfs_Squash_the_power_of_users' => "Sopprimi i privilegi degli utenti",
'nfs_EnableShare_on_local_network' => "Abilita condivisione sulla rete locale",
'nfs_These_parameters_will_be_effective' => "Questi parametri saranno efficaci solo se la condivisione è abilitata. La condivisione si trova in /home/e-smith/files/ibays//files",
'nfs_Browse_the_parent_folders' => "Sfoglia le cartelle principali",
'nfs_Action' => "Azione",

View File

@@ -0,0 +1,28 @@
'nfs_APPLY' => "適用",
'nfs_NFS_Client(s)_allowed' => "NFS クライアント(許可)",
'nfs_TABLE_panel_action_was_successful' => "テーブルパネルの操作が成功しました",
'nfs_Share_owner_Group' => "オーナーグループを共有",
'nfs_Information_Bay_name' => "情報ベイ名称",
'nfs_Write_(a)synchronously' => "非同期的に書き込み",
'nfs_Squash_the_power_of_users' => "ユーザーの権限を制限する",
'nfs_For_writing_permissions,allowing_the_root' => "ローカルネットワークの一部として、書き込み権限、ルートユーザーの許可、不安全なポートの使用には、1行に1つのIPアドレスのリストを設定する必要があります。",
'nfs_Hello_PARAMS' => "こんにちは PARAMS",
'nfs_PARAMS_panel_action_was_successful' => "~~~PARAMSパネルのアクションが成功しました~~~",
'nfs_Enable_the_NFS_Share' => "NFS 共有を有効にする",
'nfs_NFS_data_share' => "NFSデータ共有",
'nfs_Set_the_UID.' => "UIDを設定する。",
'nfs_Manage_NFS_Ibay_settings:' => "NFS Ibayの設定を管理する:",
'nfs_Browse_the_parent_folders' => "親フォルダーを参照",
'nfs_These_parameters_will_be_effective' => "共有が有効の場合のみ、これらのパラメーターが適用されます。共有は/home/e-smith/files/ibays/files にあります。",
'nfs_Hello_TABLE' => "~~~こんにちは、テーブル~~~",
'nfs_Description' => "説明",
'nfs_Set_the_uid_and_gid' => "すべてのリクエストが1人のユーザーまたは1つのグループからのものとして表示されるようにする場合は、uidとgidを設定してください。それ以外の場合は空白のままにしてください。",
'nfs_EnableShare_on_local_network' => "ローカルネットワークで共有を有効にする",
'nfs_Set_the_GID.' => "GIDを設定する。",
'nfs_Save' => "保存",
'nfs_Requests_on_secure_ports' => "セキュアポートへのリクエスト",
'nfs_Action' => "アクション",
'nfs_Delays_the_disk_writing' => "ディスク書き込みの遅延",
'Nfs_status' => "ステータス",
'nfs_Name' => "名前",
'nfs_File_system_permissions' => "ファイルシステムの権限",

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Opslaan",
'nfs_Hello_TABLE' => "Hallo TABEL",
'nfs_Hello_PARAMS' => "Hallo PARAMETERS",
'nfs_Requests_on_secure_ports' => "Verzoeken op beveiligde poorten",
'nfs_File_system_permissions' => "Bestandssysteemrechten",
'nfs_NFS_Client(s)_allowed' => "NFS-client(s) toegestaan",
'nfs_NFS_data_share' => "NFS-gegevensdeling",
'nfs_APPLY' => "Uitvoeren",
'nfs_Enable_the_NFS_Share' => "NFS-deel inschakelen",
'nfs_For_writing_permissions,allowing_the_root' => "Voor schrijfrechten, Sta de rootgebruiker toe en gebruik onveilige poorten, U moet een lijst configureren met één IP per regel, Als onderdeel van het lokale netwerk(en).",
'nfs_Set_the_uid_and_gid' => "Stel de uid en gid in als je wilt dat alle verzoeken van één gebruiker of één groep afkomstig lijken te zijn. Laat anders leeg.",
'nfs_Set_the_GID.' => "Stel de GID in.",
'nfs_TABLE_panel_action_was_successful' => "TABLE paneelactie was succesvol",
'Nfs_status' => "Status",
'nfs_PARAMS_panel_action_was_successful' => "PARAMS-paneelactie is geslaagd",
'nfs_Information_Bay_name' => "Informatiebaynaam",
'nfs_Delays_the_disk_writing' => "Vertraagt het schrijven naar de schijf",
'nfs_Share_owner_Group' => "Eigenaar groep delen",
'nfs_Description' => "Beschrijving",
'nfs_Write_(a)synchronously' => "Schrijven (a)synchroon",
'nfs_Manage_NFS_Ibay_settings:' => "~~~Beheer NFS Ibay-instellingen:~~~",
'nfs_Name' => "Naam",
'nfs_Set_the_UID.' => "Stel de UID in.",
'nfs_Squash_the_power_of_users' => "```Verwijder de macht van gebruikers```",
'nfs_EnableShare_on_local_network' => "###Delen inschakelen op lokaal netwerk###",
'nfs_These_parameters_will_be_effective' => "Deze parameters zijn alleen van kracht als de share is ingeschakeld. De share bevindt zich in /home/e-smith/files/ibays//files",
'nfs_Browse_the_parent_folders' => "Blader door de bovenliggende mappen",
'nfs_Action' => "Actie",

View File

@@ -0,0 +1,32 @@
'nfs_APPLY' => "Bruk",
'nfs_NFS_Client(s)_allowed' => "Tillatte NFS-klienter",
'nfs_TABLE_panel_action_was_successful' => "TABELL-handling var vellykket",
'nfs_Share_owner_Group' => "Dele eiergruppe",
'nfs_Information_Bay_name' => "Informasjon Bay-navn",
'nfs_Write_(a)synchronously' => "~~~Skriv (a)synkront~~~",
'nfs_Squash_the_power_of_users' => "~~~Undertrykk kraften til brukerne~~~",
'nfs_For_writing_permissions,allowing_the_root' => "For skrive-tillatelser, Tillate root-brukeren og bruke usikre porter, Du må konfigurere en liste med én IP per linje, Som er en del av det lokale nettverket.",
'nfs_Hello_PARAMS' => "~~~Hallo PARAMS~~~",
'nfs_PARAMS_panel_action_was_successful' => "~~PARAMS-panelet aksjonen var vellykket~~",
'nfs_Enable_the_NFS_Share' => "Aktiver NFS-deling",
'nfs_NFS_data_share' => "NFS-datadeling",
'nfs_Set_the_UID.' => "Sett UID.",
'nfs_Manage_NFS_Ibay_settings:' => "Administrer NFS Ibay-innstillinger:",
'nfs_Browse_the_parent_folders' => "~~~Bla gjennom overordnede mapper~~~",
'nfs_These_parameters_will_be_effective' => "Disse parametrene vil bare være effektive hvis delingen er aktivert. Delingen er i /home/e-smith/files/ibays/files",
'nfs_Hello_TABLE' => "~~~
Hallo TABELL
~~~",
'nfs_Description' => "Beskrivelse",
'nfs_Set_the_uid_and_gid' => "Sett uid og gid hvis du vil at alle forespørsler skal fremstå som fra én bruker eller én gruppe. Ellers la være tomt.",
'nfs_EnableShare_on_local_network' => "Aktiver deling på lokalt nettverk",
'nfs_Set_the_GID.' => "~~~
Angi GID.
~~~",
'nfs_Save' => "Lagre",
'nfs_Requests_on_secure_ports' => "Forespørsler på sikre porter",
'nfs_Action' => "~~Handling~~",
'nfs_Delays_the_disk_writing' => "Forsinker diskskrivingen",
'Nfs_status' => "Status",
'nfs_Name' => "Navn",
'nfs_File_system_permissions' => "Filsystemtillatelser",

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Zapisz",
'nfs_Hello_TABLE' => "Witaj TABELA",
'nfs_Hello_PARAMS' => "Witaj PARAMS",
'nfs_Requests_on_secure_ports' => "Żądania na zabezpieczonych portach",
'nfs_File_system_permissions' => "Uprawnienia systemu plików",
'nfs_NFS_Client(s)_allowed' => "Klient(y) NFS dozwolone",
'nfs_NFS_data_share' => "Udział danych NFS",
'nfs_APPLY' => "Zastosuj",
'nfs_Enable_the_NFS_Share' => "Włącz udostępnianie NFS",
'nfs_For_writing_permissions,allowing_the_root' => "Dla uprawnień do zapisu, Zezwolenia dla użytkownika root i używania niebezpiecznych portów, Musisz skonfigurować listę jednego IP na linię, Będąc częścią sieci lokalnej.",
'nfs_Set_the_uid_and_gid' => "Ustaw uid i gid, jeśli chcesz, aby wszystkie żądania pochodziły od jednego użytkownika lub jednej grupy. W przeciwnym razie pozostaw puste.",
'nfs_Set_the_GID.' => "Ustaw GID.",
'nfs_TABLE_panel_action_was_successful' => "Działanie panelu TABELA zakończone sukcesem",
'Nfs_status' => "Status",
'nfs_PARAMS_panel_action_was_successful' => "Akcja panelu PARAMS zakończyła się pomyślnie",
'nfs_Information_Bay_name' => "Nazwa zatoki informacyjnej",
'nfs_Delays_the_disk_writing' => "Opóźnia zapisywanie na dysku",
'nfs_Share_owner_Group' => "Udostępnij grupę właściciela",
'nfs_Description' => "Opis",
'nfs_Write_(a)synchronously' => "Pisz (a)synchronicznie",
'nfs_Manage_NFS_Ibay_settings:' => "~~~Zarządzaj ustawieniami NFS Ibay:~~~",
'nfs_Name' => "Nazwa",
'nfs_Set_the_UID.' => "Ustaw UID.",
'nfs_Squash_the_power_of_users' => "Zlikwiduj uprawnienia użytkowników",
'nfs_EnableShare_on_local_network' => "Udostępnianie w sieci lokalnej",
'nfs_These_parameters_will_be_effective' => "Te parametry będą skuteczne tylko wtedy, gdy udostępnianie jest włączone. Udostępnianie znajduje się w /home/e-smith/files/ibays//files",
'nfs_Browse_the_parent_folders' => "Przeglądaj foldery nadrzędne",
'nfs_Action' => "Akcja",

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Salvar",
'nfs_Hello_TABLE' => "Olá TABELA",
'nfs_Hello_PARAMS' => "Olá PARAMS",
'nfs_Requests_on_secure_ports' => "Solicitações em portas seguras",
'nfs_File_system_permissions' => "~~~Permissões do sistema de arquivos~~~",
'nfs_NFS_Client(s)_allowed' => "Clientes NFS permitidos",
'nfs_NFS_data_share' => "Compartilhamento de dados NFS",
'nfs_APPLY' => "Aplicar",
'nfs_Enable_the_NFS_Share' => "Habilitar o Compartilhamento NFS",
'nfs_For_writing_permissions,allowing_the_root' => "Para permissões de escrita, permitir o usuário root e usar portas inseguras, você deve configurar uma lista de um IP por linha, sendo parte da(s) rede(s) local(is).",
'nfs_Set_the_uid_and_gid' => "Defina o uid e gid se você quiser que todas as solicitações pareçam ser de um usuário ou grupo específicos. Caso contrário, deixe em branco.",
'nfs_Set_the_GID.' => "Definir o GID.",
'nfs_TABLE_panel_action_was_successful' => "Ação da tabela no painel foi bem-sucedida",
'Nfs_status' => "Status",
'nfs_PARAMS_panel_action_was_successful' => "Ação no painel de PARÂMETROS foi bem-sucedida",
'nfs_Information_Bay_name' => "Nome da Baía de Informações",
'nfs_Delays_the_disk_writing' => "Atrasar a gravação do disco",
'nfs_Share_owner_Group' => "Compartilhar grupo do proprietário",
'nfs_Description' => "Descrição",
'nfs_Write_(a)synchronously' => "Escrever (a)sicronamente",
'nfs_Manage_NFS_Ibay_settings:' => "Configurar definições do NFS Ibay:",
'nfs_Name' => "Nome",
'nfs_Set_the_UID.' => "Definir o UID.",
'nfs_Squash_the_power_of_users' => "Esmagar o poder dos usuários",
'nfs_EnableShare_on_local_network' => "Habilitar compartilhamento na rede local",
'nfs_These_parameters_will_be_effective' => "Esses parâmetros serão efetivos somente se o compartilhamento estiver habilitado. O compartilhamento está em /home/e-smith/files/ibays//files",
'nfs_Browse_the_parent_folders' => "Navegar pelas pastas-mãe",
'nfs_Action' => "Ação",

View File

@@ -0,0 +1,28 @@
'nfs_Save' => "Salvar",
'nfs_Hello_TABLE' => "Olá TABELA",
'nfs_Hello_PARAMS' => "Olá PARAMS",
'nfs_Requests_on_secure_ports' => "Solicitações em portas seguras",
'nfs_File_system_permissions' => "Permissões do sistema de arquivos",
'nfs_NFS_Client(s)_allowed' => "Clientes NFS permitidos",
'nfs_NFS_data_share' => "Compartilhamento de dados NFS",
'nfs_APPLY' => "Aplicar",
'nfs_Enable_the_NFS_Share' => "Habilitar o Compartilhamento NFS",
'nfs_For_writing_permissions,allowing_the_root' => "Para permissões de escrita, permitir o usuário root e usar portas inseguras, você deve configurar uma lista com um IP por linha, sendo parte da(s) rede(s) local(is).",
'nfs_Set_the_uid_and_gid' => "Defina o uid e gid se você quiser que todas as solicitações pareçam ser de um único usuário ou de um único grupo. Caso contrário, deixe em branco.",
'nfs_Set_the_GID.' => "Definir o GID.",
'nfs_TABLE_panel_action_was_successful' => "A ação no painel TABLE foi bem-sucedida",
'Nfs_status' => "Status",
'nfs_PARAMS_panel_action_was_successful' => "Ação do painel PARAMS foi bem-sucedida",
'nfs_Information_Bay_name' => "Nome da Baía de Informações",
'nfs_Delays_the_disk_writing' => "~~~Atrasar a gravação do disco~~~",
'nfs_Share_owner_Group' => "Compartilhar Grupo de Proprietários",
'nfs_Description' => "Descrição",
'nfs_Write_(a)synchronously' => "Escrever (a)síncronamente",
'nfs_Manage_NFS_Ibay_settings:' => "Configurar definições do NFS Ibay:",
'nfs_Name' => "Nome",
'nfs_Set_the_UID.' => "Definir o UID.",
'nfs_Squash_the_power_of_users' => "Esmagar o poder dos usuários",
'nfs_EnableShare_on_local_network' => "Habilitar compartilhamento na rede local",
'nfs_These_parameters_will_be_effective' => "Estes parâmetros serão eficazes apenas se o compartilhamento estiver ativado. O compartilhamento está em /home/e-smith/files/ibays//files",
'nfs_Browse_the_parent_folders' => "Procurar nas pastas principais",
'nfs_Action' => "Ação",

View File

@@ -0,0 +1,30 @@
'nfs_Save' => "Salvează",
'nfs_Hello_TABLE' => "Bună MASĂ",
'nfs_Hello_PARAMS' => "~~~Salutări PARAMS~~~",
'nfs_Requests_on_secure_ports' => "Solicitări pe porturi sigure",
'nfs_File_system_permissions' => "Permisiuni sistem de fișiere",
'nfs_NFS_Client(s)_allowed' => "~~~Clienți NFS permiși~~~",
'nfs_NFS_data_share' => "Partajare date NFS",
'nfs_APPLY' => "Aplicare",
'nfs_Enable_the_NFS_Share' => "Activați NFS Share-ul",
'nfs_For_writing_permissions,allowing_the_root' => "Pentru permisiuni de scriere, permiterea utilizatorului root și utilizarea porturilor nesigure, trebuie să configurați o listă cu câte un IP pe linie, fiind parte din rețelele locale.",
'nfs_Set_the_uid_and_gid' => "Setați uid și gid dacă doriți ca toate cererile să pară că provin de la un singur utilizator sau grup. Altfel, lăsați necompletat.",
'nfs_Set_the_GID.' => "Setați GID.",
'nfs_TABLE_panel_action_was_successful' => "~~~Acțiunea panoului TABLE a fost reușită~~~",
'Nfs_status' => "Stare",
'nfs_PARAMS_panel_action_was_successful' => "Acțiunea panoului PARAMS a fost finalizată cu succes",
'nfs_Information_Bay_name' => "Nume Golf Informativ",
'nfs_Delays_the_disk_writing' => "Întârzie scrierea pe disc",
'nfs_Share_owner_Group' => "Partajează grupul proprietarului",
'nfs_Description' => "Descriere",
'nfs_Write_(a)synchronously' => "Scrie (a)sincronizat",
'nfs_Manage_NFS_Ibay_settings:' => "Gestionați setările NFS Ibay:",
'nfs_Name' => "Nume",
'nfs_Set_the_UID.' => "Setează UID-ul.",
'nfs_Squash_the_power_of_users' => "~~~Limitarea puterii utilizatorilor~~~",
'nfs_EnableShare_on_local_network' => "Permite partajarea în rețeaua locală",
'nfs_These_parameters_will_be_effective' => "~~~
Acești parametri vor fi eficienți doar dacă partajarea este activată. Partajarea se află în /home/e-smith/files/ibays//files
~~~",
'nfs_Browse_the_parent_folders' => "Răsfoiți dosarele părinte",
'nfs_Action' => "Acțiune",

Some files were not shown because too many files have changed in this diff Show More