Файл: EasyHost v2.0/system/htdocs/admin/packages/package/config.pl
Строк: 31
<?php
$system->error('This feature has been disabled in demo mode') if $system->config('demo');
my $need_update = ($package->config('includes_header') != $system->param('data_includes_header') || $package->config('includes_footer') != $system->param('data_includes_footer')) ? 1 : 0;
$system->db->do('DELETE FROM packages_config WHERE id = ?',undef,$package->id);
my $insert = $system->db->prepare('INSERT INTO packages_config VALUES (?,?,?)');
my %blocks = ('TB' => 1099511627776,'GB' => 1073741824,'MB' => 1048576,'KB' => 1024,'B' => 1);
foreach (grep { $_ =~ /^data_/i } $system->param)
{
my ($number,$block) = $system->param($_) =~ /([d,.]+)s*(w*)/;
$number =~ s/,//g;
$number = int($number * ($blocks{uc($block)} || $blocks{uc($block).'B'}));
$insert->execute($package->id,($_ =~ /^data_(.+)$/i)[0],$number);
}
$insert->finish;
if ($need_update == 1)
{
$package->{'config'}{'includes_header'} = $system->param('data_includes_header');
$package->{'config'}{'includes_footer'} = $system->param('data_includes_footer');
$package->users->execute;
while (my $user = $package->users->fetch)
{
$user->update;
}
}
$system->redirect;
?>