/[smecontribs]/rpms/smeserver-webhosting/contribs10/smeserver-webhosting-0.0.9-bz11786_bz11787.patch
ViewVC logotype

Annotation of /rpms/smeserver-webhosting/contribs10/smeserver-webhosting-0.0.9-bz11786_bz11787.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Thu Dec 2 15:09:43 2021 UTC (2 years, 10 months ago) by michel
Branch: MAIN
CVS Tags: smeserver-webhosting-0_0_9-15_el7_sme, smeserver-webhosting-0_0_9-19_el7_sme, smeserver-webhosting-0_0_9-14_el7_sme, smeserver-webhosting-0_0_9-17_el7_sme, smeserver-webhosting-0_0_9-18_el7_sme, smeserver-webhosting-0_0_9-16_el7_sme, HEAD
make: « clog » est à jour.

1 michel 1.1 diff -urN smeserver-webhosting-0.0.9.old/createlinks smeserver-webhosting-0.0.9/createlinks
2     --- smeserver-webhosting-0.0.9.old/createlinks 2021-12-01 22:52:01.000000000 +0400
3     +++ smeserver-webhosting-0.0.9/createlinks 2021-12-02 18:34:30.986000000 +0400
4     @@ -16,4 +16,8 @@
5     }
6     $event="smeserver-webhosting-update";
7     event_link("navigation-conf", $event, "70");
8     -
9     +# for smeserver-manager
10     +safe_symlink('restart', "root/etc/e-smith/events/$event/services2adjust/smanager");
11     +event_link('navigation2-conf', "$event", '80');
12     +event_link('routes2-conf', "$event", '80');
13     +event_link('locales2-conf', "$event", '80');
14     diff -urN smeserver-webhosting-0.0.9.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/webhosting.pm smeserver-webhosting-0.0.9/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/webhosting.pm
15     --- smeserver-webhosting-0.0.9.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/webhosting.pm 2021-12-01 22:52:01.000000000 +0400
16     +++ smeserver-webhosting-0.0.9/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/webhosting.pm 2021-12-02 18:36:29.629000000 +0400
17     @@ -396,7 +396,7 @@
18     FileUpload => 'fileupload',
19     UploadMaxFilesize => 'uploadmaxfilesize',
20     PostMaxSize => 'postmaxsize',
21     - MaxExecTime => 'maxexecutiontime',
22     + MaxExecutionTime => 'maxexecutiontime',
23     MaxInputTime => 'maxinputtime',
24     AllowPHTML => 'allowphtml',
25     MailForceSender => 'mailforcesender',
26     diff -urN smeserver-webhosting-0.0.9.old/root/usr/share/smanager/lib/SrvMngr/Controller/Webhosting.pm smeserver-webhosting-0.0.9/root/usr/share/smanager/lib/SrvMngr/Controller/Webhosting.pm
27     --- smeserver-webhosting-0.0.9.old/root/usr/share/smanager/lib/SrvMngr/Controller/Webhosting.pm 1970-01-01 04:00:00.000000000 +0400
28     +++ smeserver-webhosting-0.0.9/root/usr/share/smanager/lib/SrvMngr/Controller/Webhosting.pm 2021-12-01 21:52:12.000000000 +0400
29     @@ -0,0 +1,407 @@
30     +package SrvMngr::Controller::Webhosting;
31     +
32     +#----------------------------------------------------------------------
33     +# heading : Collaboration
34     +# description : Webhosting
35     +# navigation : 2000 2500
36     +#
37     +# name : webhosting, method : get, url : /webhosting, ctlact : webhosting#main
38     +# name : webhostingu, method : post, url : /webhosting, ctlact : webhosting#do_action
39     +# name : webhostingr, method : get, url : /webhosting2, ctlact : webhosting#do_display
40     +#
41     +# routes : end
42     +#----------------------------------------------------------------------
43     +use strict;
44     +use warnings;
45     +use Mojo::Base 'Mojolicious::Controller';
46     +
47     +use Locale::gettext;
48     +use SrvMngr::I18N;
49     +use SrvMngr qw( theme_list init_session is_normal_password );
50     +
51     +use esmith::AccountsDB;
52     +use esmith::ConfigDB;
53     +use esmith::DomainsDB;
54     +use esmith::php;
55     +
56     +our $adb = esmith::AccountsDB->open() || die "Couldn't open accounts db";
57     +our $cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
58     +
59     +#TODO those 3 variables should be exported from esmith::php
60     +our $defaultdisabledfunc='system,show_source,' .
61     + 'symlink,exec,dl,shell_exec,' .
62     + 'passthru,phpinfo,' .
63     + 'escapeshellarg,escapeshellcmd';
64     +
65     +our $BASEPHP = 54;
66     +
67     +our %defaultproperties = (
68     + MemoryLimit => '128M',
69     + MaxExecutionTime => '30',
70     + MaxInputTime => '60',
71     + AllowUrlFopen => 'disabled',
72     + PostMaxSize => '20M',
73     + UploadMaxFilesize => '10M',
74     + FileUpload => 'enabled',
75     + PHPBaseDir => '/home/e-smith/files/ibays/$key:/var/lib/php/$key',
76     + DisabledFunctions => $defaultdisabledfunc,
77     + MailForceSender => "admin@".$cdb->get_value('DomainName'),
78     + AllowPHTML => 'disabled',
79     +
80     + ModDav => "disabled",
81     + AllowOverride => "None",
82     + FollowSymLinks => "disabled",
83     + Indexes => "enabled",
84     + );
85     +
86     +# those are ok to be defined here and not in core.
87     +our %sizehash = ('20M' => 'S0020MB', '30M' => 'S0030MB', '40M' => 'S0040MB', '50M' => 'S0050MB',
88     + '75M' => 'S0075MB', '100M' => 'S0100MB', '125M' => 'S0125MB', '150M' => 'S0150MB', '175M' => 'S0175MB',
89     + '200M' => 'S0200MB', '300M' => 'S0300MB','400M' => 'S0400MB', '500M' => 'S0500MB', '600M' => 'S0600MB',
90     + '700M' => 'S0700MB', '800M' => 'S0800MB', '900M' => 'S0900MB', '1000M' => 'S1000MB', '1250M' => 'S1250MB',
91     + '1500M' => 'S1500MB', '1750M' => 'S1750MB', '1999M' => 'S2000MB');
92     +
93     +our %binary = ('disabled' => 'DISABLED', 'enabled' => 'ENABLED');
94     +
95     +our %timehash = ( '60' => 'T001m', '120' => 'T002m', '180' => 'T003m', '240' => 'T004m', '300' => 'T005m',
96     + '360' => 'T006m', '420' => 'T007m', '480' => 'T008m', '540' => 'T009m', '600' => 'T010m', '900' => 'T015m',
97     + '1800' => 'T030m', '2700' => 'T045m', '3600' => 'T060m', '7200' => 'T120m', '0' => 'UNLIMITED');
98     +
99     +our %optionsproperties =(
100     + MemoryLimit => {'64M' => 'M0064MB', '128M' => 'M0128MB',
101     + '256M' => 'M0256MB', '512M' => 'M0512MB', '768M' => 'M0768MB','1024M' => 'M1024MB'},
102     + MaxExecutionTime => {%timehash},
103     + MaxInputTime => {%timehash},
104     + AllowUrlFopen => {%binary},
105     + PostMaxSize => {%sizehash},
106     + UploadMaxFilesize => {%sizehash},
107     + FileUpload => {%binary},
108     + DisabledFunctions => $defaultdisabledfunc,
109     + AllowPHTML => {%binary},
110     + ModDav => {%binary},
111     + AllowOverride => { None =>'None' ,
112     + All => 'All',
113     + AuthConfig => 'AuthConfig',
114     + FileInfo => 'FileInfo',
115     + Indexes => 'Indexes',
116     + Limit => 'Limit',
117     + 'FileInfo Indexes' => 'FileInfo Indexes',
118     + },
119     + FollowSymLinks => {%binary},
120     + Indexes => {%binary},
121     +);
122     +
123     +sub main {
124     +
125     + my $c = shift;
126     + $c->app->log->info($c->log_req);
127     +
128     + my %wh_datas = ();
129     + my $title = $c->l('wh_FORM_TITLE');
130     +
131     + $wh_datas{'trt'} = 'LIST';
132     +
133     + my @ibays = $adb->ibays();
134     +
135     + $c->stash( title => $title, wh_datas => \%wh_datas, ibays => \@ibays );
136     + $c->render(template => 'webhosting');
137     +
138     +};
139     +
140     +
141     +sub do_display {
142     +
143     + my $c = shift;
144     + $c->app->log->info($c->log_req);
145     +
146     + my $rt = $c->current_route;
147     + my $trt = ($c->param('trt') || '');
148     + my $ibay = $c->param('ibay') || '';
149     +
150     + my %wh_datas = ();
151     + my $title = $c->l('wh_FORM_TITLE');
152     + my $modul = '';
153     +
154     + $wh_datas{'trt'} = $trt;
155     +
156     + if ( $trt eq 'UPD' ) {
157     +
158     + my $rec = $adb->get($ibay);
159     + if ($rec and $rec->prop('type') eq 'ibay') {
160     + $wh_datas{ibay} = $ibay;
161     + $wh_datas{description} = $rec->prop('Name');
162     + $wh_datas{indexes} = get_current_value($c, $ibay, 'Indexes');
163     + $wh_datas{followsymLinks} = get_current_value($c, $ibay, 'FollowSymLinks');
164     + $wh_datas{allowoverride} = get_current_value($c, $ibay, 'AllowOverride');
165     + $wh_datas{allowurlfopen} = get_current_value($c, $ibay, 'AllowUrlFopen');
166     + $wh_datas{memorylimit} = get_current_value($c, $ibay, 'MemoryLimit');
167     + $wh_datas{uploadmaxfilesize} = get_current_value($c, $ibay, 'UploadMaxFilesize');
168     + $wh_datas{postmaxsize} = get_current_value($c, $ibay, 'PostMaxSize');
169     + $wh_datas{maxexecutiontime} = get_current_value($c, $ibay, 'MaxExecutionTime');
170     + $wh_datas{maxinputtime} = get_current_value($c, $ibay, 'MaxInputTime');
171     + $wh_datas{fileupload} = get_current_value($c, $ibay, 'FileUpload');
172     + $wh_datas{allowphtml} = get_current_value($c, $ibay, 'AllowPHTML');
173     + $wh_datas{mailforcesender} = $rec->prop('MailForceSender');
174     + my $df = ($rec->prop('DisabledFunctions'))? $rec->prop('DisabledFunctions') : $defaultdisabledfunc;
175     + $wh_datas{disabledfunctions} = $df; # yes we want todo this one this way.
176     + $wh_datas{phpbasedir} = $rec->prop('PHPBaseDir'); # yes we keep this one simple
177     + $wh_datas{moddav} = get_current_value($c, $ibay, 'ModDav');
178     + $wh_datas{phpversion} = get_current_php_value($c, $ibay, 'PHPVersion');
179     + # we set phpversion using function called by cgi file
180     + }
181     +
182     + }
183     +
184     + if ( $trt eq 'LIST' ) {
185     + my @ibays = $adb->ibays();
186     + $c->stash( ibays => \@ibays );
187     + }
188     +
189     + $c->stash( title => $title, modul => $modul, wh_datas => \%wh_datas );
190     + $c->render( template => 'webhosting' );
191     +
192     +};
193     +
194     +
195     +sub do_action {
196     +
197     + my $c = shift;
198     + $c->app->log->info($c->log_req);
199     +
200     + my $rt = $c->current_route;
201     + my $trt = ($c->param('trt') || '');
202     +
203     + my %wh_datas = ();
204     + my $title = $c->l('wh_FORM_TITLE');
205     +
206     + $wh_datas{'trt'} = $trt;
207     +
208     + my $result = '';
209     + my $res;
210     +
211     +
212     + if ( $trt eq 'UPD' ) {
213     +
214     + my $name = ($c->param('ibay') || '');
215     +
216     + # controls
217     + $res = validate_up_post( $c );
218     + $result .= $res unless $res eq 'OK';
219     +
220     + if ( ! $result ) {
221     + $res = modify_ibay( $c, $name );
222     + $result .= $res unless $res eq 'OK';
223     + if ( ! $result ) {
224     + $result = $c->l('wh_SUCCESSFULLY_MODIFIED_IBAY') . ' ' . $name;
225     + $wh_datas{trt} = 'LST';
226     + }
227     + }
228     + }
229     +
230     +
231     + # common parts
232     +
233     + if ($res ne 'OK') {
234     + $c->stash( error => $result );
235     + $c->stash( title => $title, wh_datas => \%wh_datas );
236     + return $c->render('webhosting');
237     + }
238     +
239     + my $message = "'Ibays' updates ($trt) DONE";
240     + $c->app->log->info($message);
241     + $c->flash( success => $result );
242     +
243     + $c->redirect_to('/webhosting');
244     +};
245     +
246     +
247     +sub modify_ibay {
248     +
249     + my ($c, $name) = @_;
250     +
251     + my $msg;
252     + my $acct = $adb->get($name);
253     + if ( ! $acct or $acct->prop('type') ne 'ibay') {
254     + return $c->l('wh_CANT_FIND_IBAY') if $msg ne 'OK';
255     + }
256     +
257     + # real & current ibay
258     + my %doing=( Indexes => 'indexes',
259     + FollowSymLinks => 'followSymLinks',
260     + AllowOverride => 'allowOverride',
261     + ModDav => 'modDav',
262     + PHPVersion => 'phpVersion',
263     + AllowUrlFopen => 'allowUrlFopen',
264     + MemoryLimit => 'memorylimit',
265     + FileUpload => 'fileupload',
266     + UploadMaxFilesize => 'uploadmaxfilesize',
267     + PostMaxSize => 'postmaxsize',
268     + MaxExecutionTime => 'maxexecutiontime',
269     + MaxInputTime => 'maxinputtime',
270     + AllowPHTML => 'allowphtml',
271     + MailForceSender => 'mailforcesender',
272     + DisabledFunctions => 'disabledfunctions',
273     + PHPBaseDir => 'phpbasedir',
274     + );
275     + foreach my $prop (keys %doing) {
276     + my $value = $c->param($doing{$prop});
277     + $value = "" if ( $value eq "$BASEPHP" && $prop eq 'PHPVersion');
278     + my $default = $defaultproperties{$prop} || "";
279     + # exceptions to handle
280     + # DisabledFunctions if equal def delprop
281     + if ($prop eq 'DisabledFunctions' && $value eq $default) {
282     + $acct->delete_prop($prop) ;
283     + next;
284     + }
285     + # MailForceSender if empty delprop
286     + if ($prop eq 'MailForceSender' && $value eq "" ) {
287     + $acct->delete_prop($prop) ;
288     + next
289     + }
290     + # PHPBaseDir if empty delprop
291     + if ($prop eq 'PHPBaseDir' && $value eq "" ) {
292     + $acct->delete_prop($prop) ;
293     + next
294     + }
295     + # others if == default delprop
296     + if ($value eq "default") {
297     + $acct->delete_prop($prop) ;
298     + next;
299     + }
300     + $acct->merge_props($prop => $value);
301     + #TODO store them in a hash and call merge_props once
302     + }
303     +
304     + # Untaint $name before use in system()
305     + $name =~ /(.+)/; $name = $1;
306     + if (system ("/sbin/e-smith/signal-event", "webhosting-modify",
307     + $name) == 0)
308     + {
309     + $msg = 'OK';
310     + } else {
311     + $msg = $c->l('wh_ERROR_WHILE_MODIFYING_IBAY');
312     + }
313     +
314     + return $msg;
315     +
316     +}
317     +
318     +
319     +sub get_current_value{
320     + my ($c, $name, $property) = @_;
321     + my $ibay = $adb->get($name);
322     + my $key = $ibay->key;
323     + my $default = $defaultproperties{$property} || "";
324     + $default =~ s/\$key/$key/g if $property eq "PHPBaseDir";
325     + my $value = ($ibay->prop($property))? $ibay->prop($property) : "default" ;
326     + return $value;
327     +
328     +}
329     +
330     +
331     +=head2 validate_up_post
332     +
333     +verify that the upload_max_filesize value is not greater than the post_max_size value. If yes then display an error message.
334     +
335     +=cut
336     +
337     +sub validate_up_post{
338     +
339     + my $c = shift;
340     + my $upmaxfilesize = $c->param('uploadmaxfilesize');
341     + my $postmaxsizeform = $c->param('postmaxsize');
342     +##set value to "0M" if disabled in order to compare uploadmaxfilesize and postmaxsize
343     + $upmaxfilesize = "0M" if $upmaxfilesize eq 'disabled';
344     + $upmaxfilesize = $defaultproperties{'UploadMaxFilesize'} if $upmaxfilesize eq 'default';
345     + $postmaxsizeform = "0M" if $postmaxsizeform eq 'disabled';
346     + $postmaxsizeform =$defaultproperties{'PostMaxSize'} if $postmaxsizeform eq 'default';
347     +##remove the 'M' unit
348     + my $upmaxfilesizechop = chop($upmaxfilesize);
349     + my $postmaxsizeformchop = chop($postmaxsizeform);
350     +##test the condition
351     + if ( $upmaxfilesize > $postmaxsizeform ) {
352     + return $c->l('wh_UPLOADMAXFILESIZE_IS_GREATER_THAN_POSTMAXSIZE');
353     + } else {
354     + return "OK";
355     + }
356     +}
357     +
358     +
359     +sub get_current_php_value {
360     +
361     + my ($c, $name) = @_;
362     + my $ibay= $adb->get($name);
363     + return "default" unless defined $ibay->prop('PHPVersion');
364     + return VersionToUse($adb->get($name));
365     +
366     +}
367     +
368     +
369     +sub get_php_options {
370     +
371     + my ($c) = @_;
372     + my $translate = $c->l('wh_DEFAULT');
373     + my %opts= listPHPVersionHash();
374     + # transform options list
375     + my @opts = [ "$translate: ".PHPdefault(), 'default' ];
376     + foreach my $key ( sort keys %opts ) {
377     + push @opts, [ $opts{$key}, $key ];
378     + }
379     +# push @opts, [ "$translate: ".PHPdefault(), 'default' ];
380     +
381     + return \@opts;
382     +
383     +}
384     +
385     +
386     +sub print_options {
387     +
388     + my ($c, $property) = @_;
389     +
390     + my $translate = $c->l('wh_DEFAULT');
391     + my $name = $c->param('ibay');
392     + my $ibay = $adb->get($name);
393     + my $key = $ibay->key;
394     + my $default = $defaultproperties{$property} || "";
395     + $default =~ s/\$key/$key/g if $property eq "PHPBaseDir";
396     + $default=$c->l(uc("$default")) unless ($property eq 'AllowOverride');
397     +
398     + # transform options list
399     + my @opts;
400     + foreach my $key ( sort keys %{$optionsproperties{$property}} ) {
401     + push @opts, [ $c->l($optionsproperties{$property}{$key}), $key ];
402     + }
403     + push @opts, ["$translate: ".$default => 'default'];
404     +
405     + return \@opts
406     +
407     +}
408     +
409     +
410     +sub print_disabledfunctions {
411     +
412     + my ($c) = @_;
413     + my $translate = $c->l('wh_DESC_DISABLEDFUNCTIONS');
414     + my $name = $c->param('ibay');
415     + my $ibay= $adb->get($name); # ??
416     + return "$translate : ". $defaultdisabledfunc ;
417     +
418     +}
419     +
420     +
421     +sub print_phpbasedir {
422     +
423     + my ($c) = @_;
424     + my $translate = $c->l('wh_DESC_PHPBASEDIR');
425     + my $name = $c->param('ibay');
426     + my $ibay= $adb->get($name);
427     + my $key = $ibay->key;
428     + my $default = $defaultproperties{'PHPBaseDir'} ||'';
429     + $default =~ s/\$key/$key/g;
430     + my $basedir = ($ibay->prop('PHPBaseDir')) ? $ibay->prop('PHPBaseDir') : $defaultproperties{'PHPBaseDir'};
431     + return "$translate : ". $default ;
432     +
433     +}
434     +
435     +
436     +1
437     diff -urN smeserver-webhosting-0.0.9.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Webhosting/webhosting_en.lex smeserver-webhosting-0.0.9/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Webhosting/webhosting_en.lex
438     --- smeserver-webhosting-0.0.9.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Webhosting/webhosting_en.lex 1970-01-01 04:00:00.000000000 +0400
439     +++ smeserver-webhosting-0.0.9/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Webhosting/webhosting_en.lex 2021-11-29 21:26:55.000000000 +0400
440     @@ -0,0 +1,80 @@
441     +'wh_FORM_TITLE' => 'Web Hosting Contrib',
442     +'wh_webhosting' => 'I-bays - Web Hosting',
443     +'wh_FIRSTPAGE_DESC' => 'Manage Apache and PHP settings',
444     +'wh_ADD_TITLE' => 'Modify Apache and PHP Settings.',
445     +'wh_NAME_FIELD_DESC' => 'These parameters will be effective only if the access from the web is allowed for the concerned I-bay in the informations bays panel.',
446     +'wh_NAME_LABEL' => 'Information bay name',
447     +'wh_NO_IBAYS' => 'There are no I-bays currently configured.',
448     +'wh_CANT_FIND_IBAY' => 'Can\'t find account for {$name} (does it exist?)',
449     +'wh_ERROR_WHILE_MODIFYING_IBAY' => 'An error occurred while modifying the I-bay.',
450     +'wh_SUCCESSFULLY_MODIFIED_IBAY' => 'Successfully modified I-bay.',
451     +'wh_VIRTUAL_HOST_MESSAGE' => 'The following virtual domains were using this information bay as their content and will be changed to the primary web site (you can change them to something else afterward).',
452     +'wh_VHOST_MESSAGE' => '<P>The following virtual domains were using this information bay as their content and will be changed to the primary web site (you can change them to something else afterward):</P><ul>{$vhostList}</ul>',
453     +'wh_Information bays' => 'Information bays',
454     +'wh_DESC_HTTP_SETTINGS' => 'The following settings control the access of this I-bay using the HTTP/HTTPS protocol.',
455     +'wh_DESC_PHP_SETTINGS' => 'The following settings control the PHP values of this I-bay.',
456     +'wh_INDEXES' => 'Allow directory listing (+Indexes)',
457     +'wh_FOLLOWSYMLINKS' => 'Follow symbolic links (FollowSymLinks)',
458     +'wh_ALLOWOVERRIDE' => 'Allow .htaccess policy (AllowOverride)',
459     +'wh_ALLOWURLFOPEN' => 'Allow access to remote files (Allow_url_fopen)',
460     +'wh_DEFAULT' => 'Default value',
461     +'M0064MB' => '64MB',
462     +'M0128MB' => '128MB',
463     +'M0256MB' => '256MB',
464     +'M0512MB' => '512MB',
465     +'M0768MB' => '768MB',
466     +'M1024MB' => '1024MB',
467     +'T001m' => '1 minute',
468     +'T002m' => '2 minutes',
469     +'T003m' => '3 minutes',
470     +'T004m' => '4 minutes',
471     +'T005m' => '5 minutes',
472     +'T006m' => '6 minutes',
473     +'T007m' => '7 minutes',
474     +'T008m' => '8 minutes',
475     +'T009m' => '9 minutes',
476     +'T010m' => '10 minutes',
477     +'T015m' => '15 minutes ',
478     +'T030m' => '30 minutes',
479     +'T045m' => '45 minutes',
480     +'T060m' => 'One hour',
481     +'T120m' => 'Two hours',
482     +'wh_UNLIMITED' => 'Unlimited',
483     +'S0020MB' => '20MB',
484     +'S0030MB' => '30MB',
485     +'S0040MB' => '40MB',
486     +'S0050MB' => '50MB',
487     +'S0075MB' => '75MB',
488     +'S0100MB' => '100MB',
489     +'S0125MB' => '125MB',
490     +'S0150MB' => '150MB',
491     +'S0175MB' => '175MB',
492     +'S0200MB' => '200MB',
493     +'S0300MB' => '300MB',
494     +'S0400MB' => '400MB',
495     +'S0500MB' => '500MB',
496     +'S0600MB' => '600MB',
497     +'S0700MB' => '700MB',
498     +'S0800MB' => '800MB',
499     +'S0900MB' => '900MB',
500     +'S1000MB' => '1000MB',
501     +'S1250MB' => '1250MB',
502     +'S1500MB' => '1500MB ',
503     +'S1750MB' => '1750MB',
504     +'S2000MB' => '2000MB',
505     +'wh_MEMORYLIMIT' => 'Php memory limit (memory_limit)',
506     +'wh_UPLOADMAXFILESIZE' => 'Maximum upload size (upload_max_filesize)',
507     +'wh_POSTMAXSIZE' => 'Maximum post size (post_max_size)',
508     +'wh_MAXEXECUTIONTIME' => 'Maximum execution time (max_execution_time)',
509     +'wh_UPLOADMAXFILESIZE_IS_GREATER_THAN_POSTMAXSIZE' => ' The maximum upload file size is greater than the maximum post size form ',
510     +'wh_PHPBASEDIR' => 'Enter Path(s) for PHP Scripts (PHPBasedir) ',
511     +'wh_DESC_PHPBASEDIR' => 'You must specify the full path to the I-bay or remove the content to get back to default value ',
512     +'wh_DESC_DAV_SETTINGS' => 'The following settings control the WebDav files transfer protocol of this I-bay.',
513     +'wh_ENABLE_MOD_DAV' => 'Allow WebDav',
514     +'wh_PHPVERSION' => 'Select the php-fpm version you want to use with this I-bay',
515     +'wh_FILEUPLOAD' => 'Whether or not to allow HTTP file uploads (file_upload)',
516     +'wh_MAXINPUTTIME' => 'Maximum time in seconds a script is allowed to parse input data (max_input_time)',
517     +'wh_ALLOWPHTML' => 'Allow parsing php code inside html, phtml, htm and xml files.',
518     +'wh_MAILFORCESENDER' => 'Force an email sender address for the script in this I-bay.',
519     +'wh_DISABLEDFUNCTIONS' => 'List of php disabled functions (disable_functions)',
520     +'wh_DESC_DISABLEDFUNCTIONS' => 'Leave empty or with a random string to disable. Copy and paste the following default list to reset to default',
521     diff -urN smeserver-webhosting-0.0.9.old/root/usr/share/smanager/themes/default/templates/partials/_wh_list.html.ep smeserver-webhosting-0.0.9/root/usr/share/smanager/themes/default/templates/partials/_wh_list.html.ep
522     --- smeserver-webhosting-0.0.9.old/root/usr/share/smanager/themes/default/templates/partials/_wh_list.html.ep 1970-01-01 04:00:00.000000000 +0400
523     +++ smeserver-webhosting-0.0.9/root/usr/share/smanager/themes/default/templates/partials/_wh_list.html.ep 2021-11-28 22:05:34.000000000 +0400
524     @@ -0,0 +1,45 @@
525     +<div id='wh_list'>
526     +
527     + <p>
528     + %=l 'wh_FIRSTPAGE_DESC'
529     + <br><br>
530     + </p>
531     +
532     + % my $numIbays = @$ibays;
533     + % if ($numIbays == 0){
534     + %=l 'wh_NO_IBAYS'
535     + % } else {
536     + <table class="sme-border"><tbody>
537     + <tr>
538     + <th class='sme-border'>
539     + %=l 'NAME'
540     + </th>
541     + <th class='sme-border'>
542     + %=l 'DESCRIPTION'
543     + </th>
544     + <th class='sme-border'>
545     + %=l 'ACTION'
546     + </th>
547     + </tr>
548     + % foreach my $ibay (@$ibays)
549     + % {
550     + % my $modifiable = $ibay->prop('Modifiable') || 'yes';
551     + <tr>
552     + %= t td => (class => 'sme-border') => $ibay->key
553     + %= t td => (class => 'sme-border') => $ibay->prop('Name')
554     + % my $actionModify = '&nbsp;';
555     + % if ($modifiable eq 'yes') {
556     + % $actionModify = "<a href='webhosting2?CsrfDef=TOKEN&trt=UPD&ibay=" . $ibay->key . "'>" . l('MODIFY') . "</a>";
557     + % }
558     + <td class='sme-border'><%= $c->render_to_string(inline => $actionModify) %></td>
559     +
560     + </tr>
561     + % }
562     + </tbody>
563     + </table>
564     +
565     + <%} %>
566     +
567     + %= hidden_field 'trt' => $wh_datas->{trt}
568     +
569     +</div>
570     diff -urN smeserver-webhosting-0.0.9.old/root/usr/share/smanager/themes/default/templates/partials/_wh_upd.html.ep smeserver-webhosting-0.0.9/root/usr/share/smanager/themes/default/templates/partials/_wh_upd.html.ep
571     --- smeserver-webhosting-0.0.9.old/root/usr/share/smanager/themes/default/templates/partials/_wh_upd.html.ep 1970-01-01 04:00:00.000000000 +0400
572     +++ smeserver-webhosting-0.0.9/root/usr/share/smanager/themes/default/templates/partials/_wh_upd.html.ep 2021-12-01 21:50:47.000000000 +0400
573     @@ -0,0 +1,149 @@
574     +<div id='wh_upd'>
575     +
576     + %= form_for '/webhosting' => (method => 'POST') => begin
577     + <p>
578     + <h2>
579     + %=l 'wh_ADD_TITLE'
580     + </h2>
581     + <br>
582     + %=l 'wh_NAME_FIELD_DESC'
583     + </p>
584     +
585     + <p>
586     + <span class=label>
587     + %=l 'wh_NAME_LABEL', class => 'label'
588     + </span><span class=data>
589     + %= $wh_datas->{ibay}, class => 'data'
590     + </span>
591     + </p>
592     +
593     + <p><span class=label>
594     + %=l 'wh_INDEXES'
595     + </span><span class=data>
596     + % param 'indexes' => $wh_datas->{indexes} unless param 'indexes';
597     + %= select_field 'indexes' => $c->print_options('Indexes'), class => 'input'
598     + <br></span></p>
599     +
600     + <p><span class=label>
601     + %=l 'wh_FOLLOWSYMLINKS'
602     + </span><span class=data>
603     + % param 'followSymLinks' => $wh_datas->{followsymLinks} unless param 'followSymLinks';
604     + %= select_field 'followSymLinks' => $c->print_options('FollowSymLinks'), class => 'input'
605     + <br></span></p>
606     +
607     + <p><span class=label>
608     + %=l 'wh_ALLOWOVERRIDE'
609     + </span><span class=data>
610     + % param 'allowOverride' => $wh_datas->{allowoverride} unless param 'allowOverride';
611     + %= select_field 'allowOverride' => $c->print_options('AllowOverride'), class => 'input'
612     + <br></span></p>
613     +
614     + <p><%=l 'wh_DESC_DAV_SETTINGS', class => 'label'%></p>
615     +
616     + <p><span class=label>
617     + %=l 'wh_ENABLE_MOD_DAV'
618     + </span><span class=data>
619     + % param 'modDav' => $wh_datas->{moddav} unless param 'modDav';
620     + %= select_field 'modDav' => $c->print_options('ModDav'), class => 'input'
621     + <br></span></p>
622     +
623     + <p><%=l 'wh_DESC_PHP_SETTINGS', class => 'label'%></p>
624     +
625     + <p><span class=label>
626     + %=l 'wh_PHPVERSION'
627     + </span><span class=data>
628     + % param 'phpVersion' => $wh_datas->{phpversion} unless param 'phpVersion';
629     + %= select_field 'phpVersion' => $c->get_php_options(), class => 'input'
630     + <br></span></p>
631     +
632     + <p><span class=label>
633     + %=l 'wh_ALLOWURLFOPEN'
634     + </span><span class=data>
635     + % param 'allowUrlFopen' => $wh_datas->{allowurlfopen} unless param 'allowUrlFopen';
636     + %= select_field 'allowUrlFopen' => $c->print_options('AllowUrlFopen'), class => 'input'
637     + <br></span></p>
638     +
639     + <p><span class=label>
640     + %=l 'wh_MEMORYLIMIT'
641     + </span><span class=data>
642     + % param 'memorylimit' => $wh_datas->{memorylimit} unless param 'memorylimit';
643     + %= select_field 'memorylimit' => $c->print_options('MemoryLimit'), class => 'input'
644     + <br></span></p>
645     +
646     + <p><span class=label>
647     + %=l 'wh_FILEUPLOAD'
648     + </span><span class=data>
649     + % param 'fileupload' => $wh_datas->{fileupload} unless param 'fileupload';
650     + %= select_field 'fileupload' => $c->print_options('FileUpload'), class => 'input'
651     + <br></span></p>
652     +
653     + <p><span class=label>
654     + %=l 'wh_UPLOADMAXFILESIZE'
655     + </span><span class=data>
656     + % param 'uploadmaxfilesize' => $wh_datas->{uploadmaxfilesize} unless param 'uploadmaxfilesize';
657     + %= select_field 'uploadmaxfilesize' => $c->print_options('UploadMaxFilesize'), class => 'input'
658     + <br></span></p>
659     +
660     + <p><span class=label>
661     + %=l 'wh_POSTMAXSIZE'
662     + </span><span class=data>
663     + % param 'postmaxsize' => $wh_datas->{postmaxsize} unless param 'postmaxsize';
664     + %= select_field 'postmaxsize' => $c->print_options('PostMaxSize'), class => 'input'
665     + <br></span></p>
666     +
667     + <p><span class=label>
668     + %=l 'wh_MAXEXECUTIONTIME'
669     + </span><span class=data>
670     + % param 'maxexecutiontime' => $wh_datas->{maxexecutiontime} unless param 'maxexecutiontime';
671     + %= select_field 'maxexecutiontime' => $c->print_options('MaxExecutionTime'), class => 'input'
672     + <br></span></p>
673     +
674     + <p><span class=label>
675     + %=l 'wh_MAXINPUTTIME'
676     + </span><span class=data>
677     + % param 'maxinputtime' => $wh_datas->{maxinputtime} unless param 'maxinputtime';
678     + %= select_field 'maxinputtime' => $c->print_options('MaxInputTime'), class => 'input'
679     + <br></span></p>
680     +
681     + <p><span class=label>
682     + %=l 'wh_ALLOWPHTML'
683     + </span><span class=data>
684     + % param 'allowphtml' => $wh_datas->{allowphtml} unless param 'allowphtml';
685     + %= select_field 'allowphtml' => $c->print_options('AllowPHTML'), class => 'input'
686     + <br></span></p>
687     +
688     + <p><span class=label>
689     + %=l 'wh_MAILFORCESENDER'
690     + </span><span class=data>
691     + % param 'mailforcesender' => $wh_datas->{mailforcesender} unless param 'mailforcesender';
692     + %=text_field 'mailforcesender' => size => '60', class => 'input'
693     + <br></span></p>
694     +
695     + <p><span class=label>
696     + %=l 'wh_DISABLEDFUNCTIONS'
697     + </span><span class=data>
698     + % param 'disabledfunctions' => $wh_datas->{disabledfunctions} unless param 'disabledfunctions';
699     + %=text_field 'disabledfunctions' => size => '60', class => 'input'
700     + <br></span></p>
701     +
702     + <p><%= $c->print_disabledfunctions() %></p>
703     +
704     + <p><span class=label>
705     + %=l 'wh_PHPBASEDIR'
706     + </span><span class=data>
707     + % param 'phpbasedir' => $wh_datas->{phpbasedir} unless param 'phpbasedir';
708     + %=text_field 'phpbasedir' => size => '60', class => 'input'
709     + <br></span></p>
710     +
711     + <p><%= $c->print_phpbasedir() %></p>
712     +
713     + <div class='center'>
714     + %= submit_button l('SAVE'), class => 'action'
715     + </div>
716     +
717     + %= hidden_field 'trt' => $wh_datas->{trt}
718     + %= hidden_field 'ibay' => $wh_datas->{ibay}
719     +
720     + % end
721     +
722     +</div>
723     diff -urN smeserver-webhosting-0.0.9.old/root/usr/share/smanager/themes/default/templates/webhosting.html.ep smeserver-webhosting-0.0.9/root/usr/share/smanager/themes/default/templates/webhosting.html.ep
724     --- smeserver-webhosting-0.0.9.old/root/usr/share/smanager/themes/default/templates/webhosting.html.ep 1970-01-01 04:00:00.000000000 +0400
725     +++ smeserver-webhosting-0.0.9/root/usr/share/smanager/themes/default/templates/webhosting.html.ep 2021-11-28 22:14:28.000000000 +0400
726     @@ -0,0 +1,33 @@
727     +% layout 'default', title => "Sme server 2 - webhosting";
728     +
729     +% content_for 'module' => begin
730     +<div id="module">
731     +
732     + % if ($config->{debug} == 1) {
733     + <p>
734     + %= dumper $c->current_route
735     + %= dumper $wh_datas
736     + </p>
737     + % }
738     +
739     + % if ( stash 'error' ) {
740     + <br><div class=sme-error>
741     + %= $c->render_to_string(inline => stash 'error')
742     + </div>
743     + %}
744     +
745     + <h1><%= $title%></h1>
746     +
747     + % if ( stash 'modul' ) {
748     + %= $c->render_to_string(inline => stash 'modul' );
749     + % }
750     +
751     + % if ($wh_datas->{trt} eq 'UPD') {
752     + %= include 'partials/_wh_upd'
753     + %} else {
754     + %= include 'partials/_wh_list'
755     + %}
756     +
757     +</div>
758     +%end
759     +

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed