Private
Server IP : 195.201.23.43  /  Your IP : 3.141.40.192
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/webmin/virtual-server/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/webmin/virtual-server/save_pass.cgi
#!/usr/bin/perl
# Change a domain or reseller password

require './virtual-server-lib.pl';
&ReadParse();
&error_setup($text{'pass_err'});
&foreign_require("acl");

# Get and validate the domain
if ($in{'dom'}) {
	$in{'dom'} || &error($text{'pass_ecannot2'});
	$d = &get_domain($in{'dom'});
	&can_passwd() && &can_edit_domain($d) || &error($text{'pass_ecannot'});
	}
elsif (!&reseller_admin() && !&extra_admin()) {
	&error($text{'pass_ecannot2'});
	}

# Check passwords
$in{'new1'} || &error($text{'pass_enew1'});
$in{'new1'} eq $in{'new2'} || error($text{'pass_enew2'});

# Check password quality for virtual servers
if ($d) {
	local $fakeuser = { 'user' => $d->{'user'},
			    'plainpass' => $in{'new1'} };
	$err = &check_password_restrictions($fakeuser, $d->{'webmin'});
	&error($err) if ($err);
	}

&ui_print_header($d ? &domain_in($d) : undef, $text{'pass_title'}, "");
if ($d) {
	# Update domain's password
	$oldd = { %$d };
	if ($d->{'disabled'}) {
		# Clear any saved passwords, as they should
		# be reset at this point
		$d->{'disabled_mysqlpass'} = undef;
		$d->{'disabled_postgrespass'} = undef;
		}
	if (&master_admin()) {
		$d->{'hashpass'} = $in{'hashpass'};
		}
	$d->{'pass'} = $in{'new1'};
	$d->{'pass_set'} = 1;
	&generate_domain_password_hashes($d, 0);

	# Run the before command
	&set_domain_envs(\%oldd, "MODIFY_DOMAIN", $d);
	$merr = &making_changes();
	&reset_domain_envs(\%oldd);
	&error(&text('save_emaking', "<tt>$merr</tt>")) if (defined($merr));

	# Call all save functions
	foreach $f (@features) {
		local $mfunc = "modify_$f";
		if ($config{$f} && $d->{$f}) {
			&try_function($f, $mfunc, $d, $oldd);
			}
		}
	foreach $f (&list_feature_plugins()) {
		if ($d->{$f}) {
			&plugin_call($f, "feature_modify", $d, $oldd);
			}
		}

	# Save new domain details
	print $text{'save_domain'},"<br>\n";
	&save_domain($d);
	&$second_print($text{'setup_done'});

	# Run the after command
	&run_post_actions();
	&set_domain_envs($d, "MODIFY_DOMAIN", undef, \%oldd);
	local $merr = &made_changes();
	&$second_print(&text('setup_emade', "<tt>$merr</tt>"))
		if (defined($merr));
	&reset_domain_envs($d);
	&webmin_log("pass", "domain", $d->{'dom'}, $d);
	}
elsif (&reseller_admin()) {
	# Update current reseller
	&$first_print($text{'pass_changing'});
	@resels = &list_resellers();
	($resel) = grep { $_->{'name'} eq $base_remote_user } @resels;
	$resel || &error($text{'pass_eresel'});
	$oldresel = { %$resel };
	$resel->{'pass'} = &acl::encrypt_password($in{'new1'});
	&modify_reseller($resel, $oldresel);
	&$second_print($text{'setup_done'});
	&run_post_actions();
	&webmin_log("pass", "resel", $resel->{'name'});
	}
elsif (&extra_admin()) {
	# Update current extra admin
	# XXX also, exits at syscall
	&$first_print($text{'pass_changing2'});
	$myd = &get_domain($access{'admin'});
	@admins = &list_extra_admins($myd);
	($admin) = grep { $_->{'name'} eq $base_remote_user } @admins;
	$admin || &error($text{'pass_eadmin'});
	$oldadmin = { %$admin };
	$admin->{'pass'} = $in{'new1'};
	&modify_extra_admin($admin, $oldadmin, $myd);
	&$second_print($text{'setup_done'});
        &webmin_log("pass", "admin", $admin->{'name'});
	}

if ($d) {
	&ui_print_footer(&domain_footer_link($d),
			 "", $text{'index_return'});
	}
else {
	&ui_print_footer("", $text{'index_return'});
	}

Private