Private
Server IP : 195.201.23.43  /  Your IP : 13.59.203.127
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/useradmin_update.pl
do 'virtual-server-lib.pl';

# useradmin_create_user(&details)
# Does nothing
sub useradmin_create_user
{
}

# useradmin_delete_user(&details)
# Does nothing (though maybe could delete the domain)
sub useradmin_delete_user
{
}

# useradmin_modify_user(&details)
# If the domain user's password is being changed, update it in the domain's
# file as well
sub useradmin_modify_user
{
if ($_[0]->{'olduser'} && $_[0]->{'olduser'} ne $_[0]->{'user'}) {
	local $d = &get_user_domain($_[0]->{'user'});
	if ($d) {
		# User was renamed .. update mailbox plainpass
		local %plain;
		&read_file_cached("$plainpass_dir/$d->{'id'}", \%plain);
		if ($plain{$_[0]->{'olduser'}}) {
			$plain{$_[0]->{'user'}} = $plain{$_[0]->{'olduser'}};
			delete($plain{$_[0]->{'olduser'}});
			&write_file("$plainpass_dir/$d->{'id'}", \%plain);
			}

		# And hashed passwords
		local %hash;
		&read_file_cached("$hashpass_dir/$d->{'id'}", \%hash);
		if ($hash{$_[0]->{'olduser'}}) {
			foreach my $s (@hashpass_types) {
				$hash{$_[0]->{'user'}.' '.$s} =
					$hash{$_[0]->{'olduser'}.' '.$s};
				delete($hash{$_[0]->{'olduser'}.' '.$s});
				}
			&write_file("$hashpass_dir/$d->{'id'}", \%hash);
			}
		}
	}

if ($_[0]->{'passmode'} == 3) {
	&set_all_null_print();

	# Update passwords for domain owners
	foreach my $d (&get_domain_by("user", $_[0]->{'user'})) {
		$oldd = { %$d };
		$d->{'pass'} = $_[0]->{'plainpass'};
		$d->{'pass_set'} = 1;
		&generate_domain_password_hashes($d, 0);
		if ($d->{'disabled'}) {
			# Clear any saved passwords, as they should
			# be reset at this point
			$d->{'disabled_oldpass'} = $_[0]->{'pass'};
			$d->{'disabled_mysqlpass'} = undef;
			$d->{'disabled_postgrespass'} = undef;
			}
		# Update all features, except Unix which has already been
		# updated by caller
		foreach my $f (@features) {
			if ($f ne "unix" && $config{$f} && $d->{$f}) {
				local $mfunc = "modify_".$f;
				&$mfunc($d, $oldd);
				}
			}
		# Update all plugins
		foreach my $f (&list_feature_plugins()) {
			if ($d->{$f}) {
				&plugin_call($f, "feature_modify", $d, $oldd);
				}
			}
		&save_domain($d);
		}

	# Update mailbox user passwords
	local $d = &get_user_domain($_[0]->{'user'});
	if ($d && $d->{'user'} ne $_[0]->{'user'}) {
		local ($user) = grep { $_->{'user'} eq $_[0]->{'user'} }
				     &list_domain_users($d, 1, 0, 0, 0);
		if ($user) {
			$olduser = { %$user };
			$user->{'passmode'} = 3;
			$user->{'plainpass'} = $_[0]->{'plainpass'};
			$user->{'pass'} = &encrypt_user_password(
						$user, $_[0]->{'plainpass'});
			&modify_user($user, $olduser, $d);

			# Call plugin save functions
			foreach $f (&list_mail_plugins()) {
				&plugin_call($f, "mailbox_modify",
					     $user, $olduser, $d);
				}
			}
		}

	&run_post_actions();
	}
}

sub null_print
{
}

Private