⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.93
Server IP:
65.108.141.171
Server:
Linux server.heloix.com 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
webmin
/
virtual-server
/
View File Name :
save_defaults.cgi
#!/usr/bin/perl # Save the defaults for new users in this virtual server require './virtual-server-lib.pl'; &ReadParse(); $d = &get_domain($in{'dom'}); &error_setup($text{'defaults_err'}); &can_edit_domain($d) || &error($text{'users_ecannot'}); &can_edit_users() || &error($text{'users_ecannot'}); $user = &create_initial_user($d, 1); # Save disk quotas if (&has_home_quotas()) { if ($in{'quota_def'} == 1) { delete($user->{'quota'}); } elsif ($in{'quota_def'} == 2) { $user->{'quota'} = "none"; } else { $in{'quota'} =~ /^[0-9\.]+$/ || &error($text{'defaults_equota'}); $user->{'quota'} = "a_parse("quota", "home"); } } if (&has_mail_quotas()) { if ($in{'mquota_def'} == 1) { delete($user->{'mquota'}); } elsif ($in{'mquota_def'} == 2) { $user->{'mquota'} = "none"; } else { $in{'mquota'} =~ /^[0-9\.]+$/ || &error($text{'defaults_emquota'}); $user->{'mquota'} = "a_parse("mquota", "mail"); } } # Save mail server quota if (&has_server_quotas()) { if ($in{'qquota_def'} == 1) { $user->{'qquota'} = "none"; } else { $in{'qquota'} =~ /^\d+$/ || &error($text{'defaults_eqquota'}); $user->{'qquota'} = $in{'qquota'}; } } # Save default shell if (&can_mailbox_ftp()) { &check_available_shell($in{'shell'}, 'mailbox', $user->{'shell'}) || &error($text{'user_eshell'}); $user->{'shell'} = $in{'shell'}; } # Save mail forwarding if ($in{'aliases_def'}) { delete($user->{'to'}); } else { @values = &parse_alias(undef, "NEWUSER", [ ], "user", $d); $user->{'to'} = \@values; } # Save databases foreach $db (split(/\r?\n/, $in{'dbs'})) { local ($type, $name) = split(/_/, $db, 2); push(@dbs, { 'type' => $type, 'name' => $name }); } $user->{'dbs'} = \@dbs; # Save secondary groups %cangroups = map { $_, 1 } (&allowed_secondary_groups($d), @{$user->{'secs'}}); @secs = split(/\0/, $in{'groups'}); foreach my $g (@secs) { $cangroups{$g} || &error(&text('user_egroup', $g)); } $user->{'secs'} = [ @secs ]; # Primary address is not done yet delete($user->{'email'}); # Save plugin defaults foreach $f (&list_mail_plugins()) { &plugin_call($f, "mailbox_defaults_parse", $user, $d, \%in); } &save_initial_user($user, $d); &run_post_actions_silently(); &webmin_log("initial", "domain", $d->{'dom'}); &redirect("list_users.cgi?dom=$in{'dom'}");