diff -urN smeserver-webhosting-0.0.9.old/createlinks smeserver-webhosting-0.0.9/createlinks --- smeserver-webhosting-0.0.9.old/createlinks 2021-12-01 22:52:01.000000000 +0400 +++ smeserver-webhosting-0.0.9/createlinks 2021-12-02 18:34:30.986000000 +0400 @@ -16,4 +16,8 @@ } $event="smeserver-webhosting-update"; event_link("navigation-conf", $event, "70"); - +# for smeserver-manager +safe_symlink('restart', "root/etc/e-smith/events/$event/services2adjust/smanager"); +event_link('navigation2-conf', "$event", '80'); +event_link('routes2-conf', "$event", '80'); +event_link('locales2-conf', "$event", '80'); 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 --- 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 +++ smeserver-webhosting-0.0.9/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/webhosting.pm 2021-12-02 18:36:29.629000000 +0400 @@ -396,7 +396,7 @@ FileUpload => 'fileupload', UploadMaxFilesize => 'uploadmaxfilesize', PostMaxSize => 'postmaxsize', - MaxExecTime => 'maxexecutiontime', + MaxExecutionTime => 'maxexecutiontime', MaxInputTime => 'maxinputtime', AllowPHTML => 'allowphtml', MailForceSender => 'mailforcesender', 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 --- smeserver-webhosting-0.0.9.old/root/usr/share/smanager/lib/SrvMngr/Controller/Webhosting.pm 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-webhosting-0.0.9/root/usr/share/smanager/lib/SrvMngr/Controller/Webhosting.pm 2021-12-01 21:52:12.000000000 +0400 @@ -0,0 +1,407 @@ +package SrvMngr::Controller::Webhosting; + +#---------------------------------------------------------------------- +# heading : Collaboration +# description : Webhosting +# navigation : 2000 2500 +# +# name : webhosting, method : get, url : /webhosting, ctlact : webhosting#main +# name : webhostingu, method : post, url : /webhosting, ctlact : webhosting#do_action +# name : webhostingr, method : get, url : /webhosting2, ctlact : webhosting#do_display +# +# routes : end +#---------------------------------------------------------------------- +use strict; +use warnings; +use Mojo::Base 'Mojolicious::Controller'; + +use Locale::gettext; +use SrvMngr::I18N; +use SrvMngr qw( theme_list init_session is_normal_password ); + +use esmith::AccountsDB; +use esmith::ConfigDB; +use esmith::DomainsDB; +use esmith::php; + +our $adb = esmith::AccountsDB->open() || die "Couldn't open accounts db"; +our $cdb = esmith::ConfigDB->open() || die "Couldn't open config db"; + +#TODO those 3 variables should be exported from esmith::php +our $defaultdisabledfunc='system,show_source,' . + 'symlink,exec,dl,shell_exec,' . + 'passthru,phpinfo,' . + 'escapeshellarg,escapeshellcmd'; + +our $BASEPHP = 54; + +our %defaultproperties = ( + MemoryLimit => '128M', + MaxExecutionTime => '30', + MaxInputTime => '60', + AllowUrlFopen => 'disabled', + PostMaxSize => '20M', + UploadMaxFilesize => '10M', + FileUpload => 'enabled', + PHPBaseDir => '/home/e-smith/files/ibays/$key:/var/lib/php/$key', + DisabledFunctions => $defaultdisabledfunc, + MailForceSender => "admin@".$cdb->get_value('DomainName'), + AllowPHTML => 'disabled', + + ModDav => "disabled", + AllowOverride => "None", + FollowSymLinks => "disabled", + Indexes => "enabled", + ); + +# those are ok to be defined here and not in core. +our %sizehash = ('20M' => 'S0020MB', '30M' => 'S0030MB', '40M' => 'S0040MB', '50M' => 'S0050MB', + '75M' => 'S0075MB', '100M' => 'S0100MB', '125M' => 'S0125MB', '150M' => 'S0150MB', '175M' => 'S0175MB', + '200M' => 'S0200MB', '300M' => 'S0300MB','400M' => 'S0400MB', '500M' => 'S0500MB', '600M' => 'S0600MB', + '700M' => 'S0700MB', '800M' => 'S0800MB', '900M' => 'S0900MB', '1000M' => 'S1000MB', '1250M' => 'S1250MB', + '1500M' => 'S1500MB', '1750M' => 'S1750MB', '1999M' => 'S2000MB'); + +our %binary = ('disabled' => 'DISABLED', 'enabled' => 'ENABLED'); + +our %timehash = ( '60' => 'T001m', '120' => 'T002m', '180' => 'T003m', '240' => 'T004m', '300' => 'T005m', + '360' => 'T006m', '420' => 'T007m', '480' => 'T008m', '540' => 'T009m', '600' => 'T010m', '900' => 'T015m', + '1800' => 'T030m', '2700' => 'T045m', '3600' => 'T060m', '7200' => 'T120m', '0' => 'UNLIMITED'); + +our %optionsproperties =( + MemoryLimit => {'64M' => 'M0064MB', '128M' => 'M0128MB', + '256M' => 'M0256MB', '512M' => 'M0512MB', '768M' => 'M0768MB','1024M' => 'M1024MB'}, + MaxExecutionTime => {%timehash}, + MaxInputTime => {%timehash}, + AllowUrlFopen => {%binary}, + PostMaxSize => {%sizehash}, + UploadMaxFilesize => {%sizehash}, + FileUpload => {%binary}, + DisabledFunctions => $defaultdisabledfunc, + AllowPHTML => {%binary}, + ModDav => {%binary}, + AllowOverride => { None =>'None' , + All => 'All', + AuthConfig => 'AuthConfig', + FileInfo => 'FileInfo', + Indexes => 'Indexes', + Limit => 'Limit', + 'FileInfo Indexes' => 'FileInfo Indexes', + }, + FollowSymLinks => {%binary}, + Indexes => {%binary}, +); + +sub main { + + my $c = shift; + $c->app->log->info($c->log_req); + + my %wh_datas = (); + my $title = $c->l('wh_FORM_TITLE'); + + $wh_datas{'trt'} = 'LIST'; + + my @ibays = $adb->ibays(); + + $c->stash( title => $title, wh_datas => \%wh_datas, ibays => \@ibays ); + $c->render(template => 'webhosting'); + +}; + + +sub do_display { + + my $c = shift; + $c->app->log->info($c->log_req); + + my $rt = $c->current_route; + my $trt = ($c->param('trt') || ''); + my $ibay = $c->param('ibay') || ''; + + my %wh_datas = (); + my $title = $c->l('wh_FORM_TITLE'); + my $modul = ''; + + $wh_datas{'trt'} = $trt; + + if ( $trt eq 'UPD' ) { + + my $rec = $adb->get($ibay); + if ($rec and $rec->prop('type') eq 'ibay') { + $wh_datas{ibay} = $ibay; + $wh_datas{description} = $rec->prop('Name'); + $wh_datas{indexes} = get_current_value($c, $ibay, 'Indexes'); + $wh_datas{followsymLinks} = get_current_value($c, $ibay, 'FollowSymLinks'); + $wh_datas{allowoverride} = get_current_value($c, $ibay, 'AllowOverride'); + $wh_datas{allowurlfopen} = get_current_value($c, $ibay, 'AllowUrlFopen'); + $wh_datas{memorylimit} = get_current_value($c, $ibay, 'MemoryLimit'); + $wh_datas{uploadmaxfilesize} = get_current_value($c, $ibay, 'UploadMaxFilesize'); + $wh_datas{postmaxsize} = get_current_value($c, $ibay, 'PostMaxSize'); + $wh_datas{maxexecutiontime} = get_current_value($c, $ibay, 'MaxExecutionTime'); + $wh_datas{maxinputtime} = get_current_value($c, $ibay, 'MaxInputTime'); + $wh_datas{fileupload} = get_current_value($c, $ibay, 'FileUpload'); + $wh_datas{allowphtml} = get_current_value($c, $ibay, 'AllowPHTML'); + $wh_datas{mailforcesender} = $rec->prop('MailForceSender'); + my $df = ($rec->prop('DisabledFunctions'))? $rec->prop('DisabledFunctions') : $defaultdisabledfunc; + $wh_datas{disabledfunctions} = $df; # yes we want todo this one this way. + $wh_datas{phpbasedir} = $rec->prop('PHPBaseDir'); # yes we keep this one simple + $wh_datas{moddav} = get_current_value($c, $ibay, 'ModDav'); + $wh_datas{phpversion} = get_current_php_value($c, $ibay, 'PHPVersion'); + # we set phpversion using function called by cgi file + } + + } + + if ( $trt eq 'LIST' ) { + my @ibays = $adb->ibays(); + $c->stash( ibays => \@ibays ); + } + + $c->stash( title => $title, modul => $modul, wh_datas => \%wh_datas ); + $c->render( template => 'webhosting' ); + +}; + + +sub do_action { + + my $c = shift; + $c->app->log->info($c->log_req); + + my $rt = $c->current_route; + my $trt = ($c->param('trt') || ''); + + my %wh_datas = (); + my $title = $c->l('wh_FORM_TITLE'); + + $wh_datas{'trt'} = $trt; + + my $result = ''; + my $res; + + + if ( $trt eq 'UPD' ) { + + my $name = ($c->param('ibay') || ''); + + # controls + $res = validate_up_post( $c ); + $result .= $res unless $res eq 'OK'; + + if ( ! $result ) { + $res = modify_ibay( $c, $name ); + $result .= $res unless $res eq 'OK'; + if ( ! $result ) { + $result = $c->l('wh_SUCCESSFULLY_MODIFIED_IBAY') . ' ' . $name; + $wh_datas{trt} = 'LST'; + } + } + } + + + # common parts + + if ($res ne 'OK') { + $c->stash( error => $result ); + $c->stash( title => $title, wh_datas => \%wh_datas ); + return $c->render('webhosting'); + } + + my $message = "'Ibays' updates ($trt) DONE"; + $c->app->log->info($message); + $c->flash( success => $result ); + + $c->redirect_to('/webhosting'); +}; + + +sub modify_ibay { + + my ($c, $name) = @_; + + my $msg; + my $acct = $adb->get($name); + if ( ! $acct or $acct->prop('type') ne 'ibay') { + return $c->l('wh_CANT_FIND_IBAY') if $msg ne 'OK'; + } + + # real & current ibay + my %doing=( Indexes => 'indexes', + FollowSymLinks => 'followSymLinks', + AllowOverride => 'allowOverride', + ModDav => 'modDav', + PHPVersion => 'phpVersion', + AllowUrlFopen => 'allowUrlFopen', + MemoryLimit => 'memorylimit', + FileUpload => 'fileupload', + UploadMaxFilesize => 'uploadmaxfilesize', + PostMaxSize => 'postmaxsize', + MaxExecutionTime => 'maxexecutiontime', + MaxInputTime => 'maxinputtime', + AllowPHTML => 'allowphtml', + MailForceSender => 'mailforcesender', + DisabledFunctions => 'disabledfunctions', + PHPBaseDir => 'phpbasedir', + ); + foreach my $prop (keys %doing) { + my $value = $c->param($doing{$prop}); + $value = "" if ( $value eq "$BASEPHP" && $prop eq 'PHPVersion'); + my $default = $defaultproperties{$prop} || ""; + # exceptions to handle + # DisabledFunctions if equal def delprop + if ($prop eq 'DisabledFunctions' && $value eq $default) { + $acct->delete_prop($prop) ; + next; + } + # MailForceSender if empty delprop + if ($prop eq 'MailForceSender' && $value eq "" ) { + $acct->delete_prop($prop) ; + next + } + # PHPBaseDir if empty delprop + if ($prop eq 'PHPBaseDir' && $value eq "" ) { + $acct->delete_prop($prop) ; + next + } + # others if == default delprop + if ($value eq "default") { + $acct->delete_prop($prop) ; + next; + } + $acct->merge_props($prop => $value); + #TODO store them in a hash and call merge_props once + } + + # Untaint $name before use in system() + $name =~ /(.+)/; $name = $1; + if (system ("/sbin/e-smith/signal-event", "webhosting-modify", + $name) == 0) + { + $msg = 'OK'; + } else { + $msg = $c->l('wh_ERROR_WHILE_MODIFYING_IBAY'); + } + + return $msg; + +} + + +sub get_current_value{ + my ($c, $name, $property) = @_; + my $ibay = $adb->get($name); + my $key = $ibay->key; + my $default = $defaultproperties{$property} || ""; + $default =~ s/\$key/$key/g if $property eq "PHPBaseDir"; + my $value = ($ibay->prop($property))? $ibay->prop($property) : "default" ; + return $value; + +} + + +=head2 validate_up_post + +verify that the upload_max_filesize value is not greater than the post_max_size value. If yes then display an error message. + +=cut + +sub validate_up_post{ + + my $c = shift; + my $upmaxfilesize = $c->param('uploadmaxfilesize'); + my $postmaxsizeform = $c->param('postmaxsize'); +##set value to "0M" if disabled in order to compare uploadmaxfilesize and postmaxsize + $upmaxfilesize = "0M" if $upmaxfilesize eq 'disabled'; + $upmaxfilesize = $defaultproperties{'UploadMaxFilesize'} if $upmaxfilesize eq 'default'; + $postmaxsizeform = "0M" if $postmaxsizeform eq 'disabled'; + $postmaxsizeform =$defaultproperties{'PostMaxSize'} if $postmaxsizeform eq 'default'; +##remove the 'M' unit + my $upmaxfilesizechop = chop($upmaxfilesize); + my $postmaxsizeformchop = chop($postmaxsizeform); +##test the condition + if ( $upmaxfilesize > $postmaxsizeform ) { + return $c->l('wh_UPLOADMAXFILESIZE_IS_GREATER_THAN_POSTMAXSIZE'); + } else { + return "OK"; + } +} + + +sub get_current_php_value { + + my ($c, $name) = @_; + my $ibay= $adb->get($name); + return "default" unless defined $ibay->prop('PHPVersion'); + return VersionToUse($adb->get($name)); + +} + + +sub get_php_options { + + my ($c) = @_; + my $translate = $c->l('wh_DEFAULT'); + my %opts= listPHPVersionHash(); + # transform options list + my @opts = [ "$translate: ".PHPdefault(), 'default' ]; + foreach my $key ( sort keys %opts ) { + push @opts, [ $opts{$key}, $key ]; + } +# push @opts, [ "$translate: ".PHPdefault(), 'default' ]; + + return \@opts; + +} + + +sub print_options { + + my ($c, $property) = @_; + + my $translate = $c->l('wh_DEFAULT'); + my $name = $c->param('ibay'); + my $ibay = $adb->get($name); + my $key = $ibay->key; + my $default = $defaultproperties{$property} || ""; + $default =~ s/\$key/$key/g if $property eq "PHPBaseDir"; + $default=$c->l(uc("$default")) unless ($property eq 'AllowOverride'); + + # transform options list + my @opts; + foreach my $key ( sort keys %{$optionsproperties{$property}} ) { + push @opts, [ $c->l($optionsproperties{$property}{$key}), $key ]; + } + push @opts, ["$translate: ".$default => 'default']; + + return \@opts + +} + + +sub print_disabledfunctions { + + my ($c) = @_; + my $translate = $c->l('wh_DESC_DISABLEDFUNCTIONS'); + my $name = $c->param('ibay'); + my $ibay= $adb->get($name); # ?? + return "$translate : ". $defaultdisabledfunc ; + +} + + +sub print_phpbasedir { + + my ($c) = @_; + my $translate = $c->l('wh_DESC_PHPBASEDIR'); + my $name = $c->param('ibay'); + my $ibay= $adb->get($name); + my $key = $ibay->key; + my $default = $defaultproperties{'PHPBaseDir'} ||''; + $default =~ s/\$key/$key/g; + my $basedir = ($ibay->prop('PHPBaseDir')) ? $ibay->prop('PHPBaseDir') : $defaultproperties{'PHPBaseDir'}; + return "$translate : ". $default ; + +} + + +1 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 --- 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 +++ 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 @@ -0,0 +1,80 @@ +'wh_FORM_TITLE' => 'Web Hosting Contrib', +'wh_webhosting' => 'I-bays - Web Hosting', +'wh_FIRSTPAGE_DESC' => 'Manage Apache and PHP settings', +'wh_ADD_TITLE' => 'Modify Apache and PHP Settings.', +'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.', +'wh_NAME_LABEL' => 'Information bay name', +'wh_NO_IBAYS' => 'There are no I-bays currently configured.', +'wh_CANT_FIND_IBAY' => 'Can\'t find account for {$name} (does it exist?)', +'wh_ERROR_WHILE_MODIFYING_IBAY' => 'An error occurred while modifying the I-bay.', +'wh_SUCCESSFULLY_MODIFIED_IBAY' => 'Successfully modified I-bay.', +'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).', +'wh_VHOST_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):

', +'wh_Information bays' => 'Information bays', +'wh_DESC_HTTP_SETTINGS' => 'The following settings control the access of this I-bay using the HTTP/HTTPS protocol.', +'wh_DESC_PHP_SETTINGS' => 'The following settings control the PHP values of this I-bay.', +'wh_INDEXES' => 'Allow directory listing (+Indexes)', +'wh_FOLLOWSYMLINKS' => 'Follow symbolic links (FollowSymLinks)', +'wh_ALLOWOVERRIDE' => 'Allow .htaccess policy (AllowOverride)', +'wh_ALLOWURLFOPEN' => 'Allow access to remote files (Allow_url_fopen)', +'wh_DEFAULT' => 'Default value', +'M0064MB' => '64MB', +'M0128MB' => '128MB', +'M0256MB' => '256MB', +'M0512MB' => '512MB', +'M0768MB' => '768MB', +'M1024MB' => '1024MB', +'T001m' => '1 minute', +'T002m' => '2 minutes', +'T003m' => '3 minutes', +'T004m' => '4 minutes', +'T005m' => '5 minutes', +'T006m' => '6 minutes', +'T007m' => '7 minutes', +'T008m' => '8 minutes', +'T009m' => '9 minutes', +'T010m' => '10 minutes', +'T015m' => '15 minutes ', +'T030m' => '30 minutes', +'T045m' => '45 minutes', +'T060m' => 'One hour', +'T120m' => 'Two hours', +'wh_UNLIMITED' => 'Unlimited', +'S0020MB' => '20MB', +'S0030MB' => '30MB', +'S0040MB' => '40MB', +'S0050MB' => '50MB', +'S0075MB' => '75MB', +'S0100MB' => '100MB', +'S0125MB' => '125MB', +'S0150MB' => '150MB', +'S0175MB' => '175MB', +'S0200MB' => '200MB', +'S0300MB' => '300MB', +'S0400MB' => '400MB', +'S0500MB' => '500MB', +'S0600MB' => '600MB', +'S0700MB' => '700MB', +'S0800MB' => '800MB', +'S0900MB' => '900MB', +'S1000MB' => '1000MB', +'S1250MB' => '1250MB', +'S1500MB' => '1500MB ', +'S1750MB' => '1750MB', +'S2000MB' => '2000MB', +'wh_MEMORYLIMIT' => 'Php memory limit (memory_limit)', +'wh_UPLOADMAXFILESIZE' => 'Maximum upload size (upload_max_filesize)', +'wh_POSTMAXSIZE' => 'Maximum post size (post_max_size)', +'wh_MAXEXECUTIONTIME' => 'Maximum execution time (max_execution_time)', +'wh_UPLOADMAXFILESIZE_IS_GREATER_THAN_POSTMAXSIZE' => ' The maximum upload file size is greater than the maximum post size form ', +'wh_PHPBASEDIR' => 'Enter Path(s) for PHP Scripts (PHPBasedir) ', +'wh_DESC_PHPBASEDIR' => 'You must specify the full path to the I-bay or remove the content to get back to default value ', +'wh_DESC_DAV_SETTINGS' => 'The following settings control the WebDav files transfer protocol of this I-bay.', +'wh_ENABLE_MOD_DAV' => 'Allow WebDav', +'wh_PHPVERSION' => 'Select the php-fpm version you want to use with this I-bay', +'wh_FILEUPLOAD' => 'Whether or not to allow HTTP file uploads (file_upload)', +'wh_MAXINPUTTIME' => 'Maximum time in seconds a script is allowed to parse input data (max_input_time)', +'wh_ALLOWPHTML' => 'Allow parsing php code inside html, phtml, htm and xml files.', +'wh_MAILFORCESENDER' => 'Force an email sender address for the script in this I-bay.', +'wh_DISABLEDFUNCTIONS' => 'List of php disabled functions (disable_functions)', +'wh_DESC_DISABLEDFUNCTIONS' => 'Leave empty or with a random string to disable. Copy and paste the following default list to reset to default', 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 --- 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 +++ 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 @@ -0,0 +1,45 @@ +
+ +

+ %=l 'wh_FIRSTPAGE_DESC' +

+

+ + % my $numIbays = @$ibays; + % if ($numIbays == 0){ + %=l 'wh_NO_IBAYS' + % } else { + + + + + + + % foreach my $ibay (@$ibays) + % { + % my $modifiable = $ibay->prop('Modifiable') || 'yes'; + + %= t td => (class => 'sme-border') => $ibay->key + %= t td => (class => 'sme-border') => $ibay->prop('Name') + % my $actionModify = ' '; + % if ($modifiable eq 'yes') { + % $actionModify = "" . l('MODIFY') . ""; + % } + + + + % } + +
+ %=l 'NAME' + + %=l 'DESCRIPTION' + + %=l 'ACTION' +
<%= $c->render_to_string(inline => $actionModify) %>
+ + <%} %> + + %= hidden_field 'trt' => $wh_datas->{trt} + +
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 --- 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 +++ 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 @@ -0,0 +1,149 @@ +
+ + %= form_for '/webhosting' => (method => 'POST') => begin +

+

+ %=l 'wh_ADD_TITLE' +

+
+ %=l 'wh_NAME_FIELD_DESC' +

+ +

+ + %=l 'wh_NAME_LABEL', class => 'label' + + %= $wh_datas->{ibay}, class => 'data' + +

+ +

+ %=l 'wh_INDEXES' + + % param 'indexes' => $wh_datas->{indexes} unless param 'indexes'; + %= select_field 'indexes' => $c->print_options('Indexes'), class => 'input' +

+ +

+ %=l 'wh_FOLLOWSYMLINKS' + + % param 'followSymLinks' => $wh_datas->{followsymLinks} unless param 'followSymLinks'; + %= select_field 'followSymLinks' => $c->print_options('FollowSymLinks'), class => 'input' +

+ +

+ %=l 'wh_ALLOWOVERRIDE' + + % param 'allowOverride' => $wh_datas->{allowoverride} unless param 'allowOverride'; + %= select_field 'allowOverride' => $c->print_options('AllowOverride'), class => 'input' +

+ +

<%=l 'wh_DESC_DAV_SETTINGS', class => 'label'%>

+ +

+ %=l 'wh_ENABLE_MOD_DAV' + + % param 'modDav' => $wh_datas->{moddav} unless param 'modDav'; + %= select_field 'modDav' => $c->print_options('ModDav'), class => 'input' +

+ +

<%=l 'wh_DESC_PHP_SETTINGS', class => 'label'%>

+ +

+ %=l 'wh_PHPVERSION' + + % param 'phpVersion' => $wh_datas->{phpversion} unless param 'phpVersion'; + %= select_field 'phpVersion' => $c->get_php_options(), class => 'input' +

+ +

+ %=l 'wh_ALLOWURLFOPEN' + + % param 'allowUrlFopen' => $wh_datas->{allowurlfopen} unless param 'allowUrlFopen'; + %= select_field 'allowUrlFopen' => $c->print_options('AllowUrlFopen'), class => 'input' +

+ +

+ %=l 'wh_MEMORYLIMIT' + + % param 'memorylimit' => $wh_datas->{memorylimit} unless param 'memorylimit'; + %= select_field 'memorylimit' => $c->print_options('MemoryLimit'), class => 'input' +

+ +

+ %=l 'wh_FILEUPLOAD' + + % param 'fileupload' => $wh_datas->{fileupload} unless param 'fileupload'; + %= select_field 'fileupload' => $c->print_options('FileUpload'), class => 'input' +

+ +

+ %=l 'wh_UPLOADMAXFILESIZE' + + % param 'uploadmaxfilesize' => $wh_datas->{uploadmaxfilesize} unless param 'uploadmaxfilesize'; + %= select_field 'uploadmaxfilesize' => $c->print_options('UploadMaxFilesize'), class => 'input' +

+ +

+ %=l 'wh_POSTMAXSIZE' + + % param 'postmaxsize' => $wh_datas->{postmaxsize} unless param 'postmaxsize'; + %= select_field 'postmaxsize' => $c->print_options('PostMaxSize'), class => 'input' +

+ +

+ %=l 'wh_MAXEXECUTIONTIME' + + % param 'maxexecutiontime' => $wh_datas->{maxexecutiontime} unless param 'maxexecutiontime'; + %= select_field 'maxexecutiontime' => $c->print_options('MaxExecutionTime'), class => 'input' +

+ +

+ %=l 'wh_MAXINPUTTIME' + + % param 'maxinputtime' => $wh_datas->{maxinputtime} unless param 'maxinputtime'; + %= select_field 'maxinputtime' => $c->print_options('MaxInputTime'), class => 'input' +

+ +

+ %=l 'wh_ALLOWPHTML' + + % param 'allowphtml' => $wh_datas->{allowphtml} unless param 'allowphtml'; + %= select_field 'allowphtml' => $c->print_options('AllowPHTML'), class => 'input' +

+ +

+ %=l 'wh_MAILFORCESENDER' + + % param 'mailforcesender' => $wh_datas->{mailforcesender} unless param 'mailforcesender'; + %=text_field 'mailforcesender' => size => '60', class => 'input' +

+ +

+ %=l 'wh_DISABLEDFUNCTIONS' + + % param 'disabledfunctions' => $wh_datas->{disabledfunctions} unless param 'disabledfunctions'; + %=text_field 'disabledfunctions' => size => '60', class => 'input' +

+ +

<%= $c->print_disabledfunctions() %>

+ +

+ %=l 'wh_PHPBASEDIR' + + % param 'phpbasedir' => $wh_datas->{phpbasedir} unless param 'phpbasedir'; + %=text_field 'phpbasedir' => size => '60', class => 'input' +

+ +

<%= $c->print_phpbasedir() %>

+ +
+ %= submit_button l('SAVE'), class => 'action' +
+ + %= hidden_field 'trt' => $wh_datas->{trt} + %= hidden_field 'ibay' => $wh_datas->{ibay} + + % end + +
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 --- smeserver-webhosting-0.0.9.old/root/usr/share/smanager/themes/default/templates/webhosting.html.ep 1970-01-01 04:00:00.000000000 +0400 +++ smeserver-webhosting-0.0.9/root/usr/share/smanager/themes/default/templates/webhosting.html.ep 2021-11-28 22:14:28.000000000 +0400 @@ -0,0 +1,33 @@ +% layout 'default', title => "Sme server 2 - webhosting"; + +% content_for 'module' => begin +
+ + % if ($config->{debug} == 1) { +

+ %= dumper $c->current_route + %= dumper $wh_datas +

+ % } + + % if ( stash 'error' ) { +
+ %= $c->render_to_string(inline => stash 'error') +
+ %} + +

<%= $title%>

+ + % if ( stash 'modul' ) { + %= $c->render_to_string(inline => stash 'modul' ); + % } + + % if ($wh_datas->{trt} eq 'UPD') { + %= include 'partials/_wh_upd' + %} else { + %= include 'partials/_wh_list' + %} + +
+%end +