version 1.1334, 2017/01/28 03:49:00
|
version 1.1335, 2017/01/28 21:35:54
|
Line 4550 sub get_my_adhocroles {
|
Line 4550 sub get_my_adhocroles {
|
if (($env{"user.role.dh./$cdom/"}) || ($env{"user.role.da./$cdom/"})) { |
if (($env{"user.role.dh./$cdom/"}) || ($env{"user.role.da./$cdom/"})) { |
my $then=$env{'user.login.time'}; |
my $then=$env{'user.login.time'}; |
my $update=$env{'user.update.time'}; |
my $update=$env{'user.update.time'}; |
my $liverole = 1; |
if (!$update) { |
|
$update = $then; |
|
} |
|
my @liveroles; |
foreach my $role ('dh','da') { |
foreach my $role ('dh','da') { |
if ($env{"user.role.$role./$cdom/"}) { |
if ($env{"user.role.$role./$cdom/"}) { |
my ($tstart,$tend)=split(/\./,$env{"user.role.$role./$cdom"}); |
my ($tstart,$tend)=split(/\./,$env{"user.role.$role./$cdom/"}); |
my $limit = $update; |
my $limit = $update; |
if ($env{'request.role'} eq "$role./$cdom/") { |
if ($env{'request.role'} eq "$role./$cdom/") { |
$limit = $then; |
$limit = $then; |
} |
} |
if ($tstart && $tstart>$limit) { $liverole = 0; } |
my $activerole = 1; |
if ($tend && $tend <$limit) { $liverole = 0; } |
if ($tstart && $tstart>$limit) { $activerole = 0; } |
last if ($liverole); |
if ($tend && $tend <$limit) { $activerole = 0; } |
|
if ($activerole) { |
|
push(@liveroles,$role); |
|
} |
} |
} |
} |
} |
if ($liverole) { |
if (@liveroles) { |
if (&homeserver($cnum,$cdom) ne 'no_host') { |
if (&homeserver($cnum,$cdom) ne 'no_host') { |
my ($accessref,$accessinfo,%access_in_dom); |
my ($accessref,$accessinfo,%access_in_dom); |
($roles_by_num,$description,$accessref,$accessinfo) = &get_all_adhocroles($cdom); |
($roles_by_num,$description,$accessref,$accessinfo) = &get_all_adhocroles($cdom); |
Line 4618 sub get_my_adhocroles {
|
Line 4624 sub get_my_adhocroles {
|
next; |
next; |
} elsif ($curraccess eq 'all') { |
} elsif ($curraccess eq 'all') { |
push(@possroles,$role); |
push(@possroles,$role); |
|
} elsif ($curraccess eq 'anydh') { |
|
if (grep(/^dh$/,@liveroles)) { |
|
push(@possroles,$role); |
|
} else { |
|
next; |
|
} |
|
} elsif ($curraccess eq 'anyda') { |
|
if (grep(/^da$/,@liveroles)) { |
|
push(@possroles,$role); |
|
} else { |
|
next; |
|
} |
} elsif ($curraccess eq 'status') { |
} elsif ($curraccess eq 'status') { |
if (@okstatus) { |
if (@okstatus) { |
if (!@statuses) { |
if (!@statuses) { |