Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
xkostka2 committed Sep 23, 2021
2 parents 771593b + 0bb9576 commit 704ad49
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 344 deletions.
18 changes: 15 additions & 3 deletions gen/ad_user_vsup
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sub calculateExpiration;

local $::SERVICE_NAME = "ad_user_vsup";
local $::PROTOCOL_VERSION = "3.0.1";
my $SCRIPT_VERSION = "3.0.7";
my $SCRIPT_VERSION = "3.0.8";

perunServicesInit::init;
my $DIRECTORY = perunServicesInit::getDirectory;
Expand Down Expand Up @@ -42,6 +42,8 @@ our $A_EXPIRATION_DC2; *A_EXPIRATION_DC2 = \'urn:perun:user:attribute-def:def:e
our $A_EXPIRATION_MANUAL; *A_EXPIRATION_MANUAL = \'urn:perun:user:attribute-def:def:expirationManual';
our $A_VSUP_PREF_MAIL; *A_VSUP_PREF_MAIL = \'urn:perun:user:attribute-def:def:vsupPreferredMail';
our $A_VSUP_SSH_KEYS; *A_VSUP_SSH_KEYS = \'urn:perun:user:attribute-def:def:sshPublicKey';
our $A_VSUP_EXCHANGE_MAIL_ALIASES; *A_VSUP_EXCHANGE_MAIL_ALIASES = \'urn:perun:user:attribute-def:def:vsupExchangeMailAliases';
our $A_VSUP_EXCHANGE_MAIL; *A_VSUP_EXCHANGE_MAIL = \'urn:perun:user:attribute-def:def:vsupExchangeMail';

# CHECK ON FACILITY ATTRIBUTES
if (!defined($data->getFacilityAttributeValue( attrName => $A_F_BASE_DN ))) {
Expand Down Expand Up @@ -115,6 +117,8 @@ foreach my $memberId ($data->getMemberIdsForFacility()) {
$users->{$login}->{$A_EXPIRATION_MANUAL} = $data->getUserAttributeValue( member => $memberId, attrName => $A_EXPIRATION_MANUAL );
$users->{$login}->{$A_VSUP_PREF_MAIL} = $data->getUserAttributeValue( member => $memberId, attrName => $A_VSUP_PREF_MAIL );
$users->{$login}->{$A_VSUP_SSH_KEYS} = $data->getUserAttributeValue( member => $memberId, attrName => $A_VSUP_SSH_KEYS );
$users->{$login}->{$A_VSUP_EXCHANGE_MAIL_ALIASES} = $data->getUserAttributeValue( member => $memberId, attrName => $A_VSUP_EXCHANGE_MAIL_ALIASES );
$users->{$login}->{$A_VSUP_EXCHANGE_MAIL} = $data->getUserAttributeValue( member => $memberId, attrName => $A_VSUP_EXCHANGE_MAIL );

}

Expand All @@ -135,7 +139,7 @@ for my $login (@logins) {

print FILE "cn: " . $login . "\n";
print FILE "samAccountName: " . $login . "\n";
print FILE "userPrincipalName: " . $login . "\@" . $domain . "\n";
print FILE "userPrincipalName: " . $login . "\@umprum.cz" . "\n";
# enable accounts (if not) using service propagation
print FILE "userAccountControl: " . $uac . "\n";

Expand All @@ -153,6 +157,8 @@ for my $login (@logins) {
my $chipNumbers = $users->{$login}->{$A_CARD_CHIP_NUMBERS};
my $vsupPrefMail = $users->{$login}->{$A_VSUP_PREF_MAIL};
my $sshKeys = $users->{$login}->{$A_VSUP_SSH_KEYS};
my $exchangeMailAliases = $users->{$login}->{$A_VSUP_EXCHANGE_MAIL_ALIASES};
my $exchangeMail = $users->{$login}->{$A_VSUP_EXCHANGE_MAIL};

# print display name from firstName/lastName only
my $printedDisplayName = undef;
Expand All @@ -177,8 +183,10 @@ for my $login (@logins) {

if (defined $vsupPrefMail and length $vsupPrefMail) {
print FILE "mail: " . $vsupPrefMail . "\n";
} elsif (defined $exchangeMail and length $exchangeMail) {
print FILE "mail: " . $exchangeMail . "\n";
} else {
print FILE "mail: " . $login . "\@" . $domain . "\n";
print FILE "mail: " . $login . "\@vsup.cz" . "\n";
}

if (defined $uco and length $uco) {
Expand Down Expand Up @@ -209,6 +217,10 @@ for my $login (@logins) {
print FILE "altSecurityIdentities: " . $val . "\n";
}

foreach my $val (@$exchangeMailAliases) {
print FILE "proxyAddresses: smtp:" . $val . "\n";
}

# print classes
print FILE "objectclass: top\n";
print FILE "objectclass: person\n";
Expand Down
11 changes: 9 additions & 2 deletions gen/ad_user_vsup_service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use perunServicesUtils;

local $::SERVICE_NAME = "ad_user_vsup_service";
local $::PROTOCOL_VERSION = "3.0.1";
my $SCRIPT_VERSION = "3.0.5";
my $SCRIPT_VERSION = "3.0.6";

perunServicesInit::init;
my $DIRECTORY = perunServicesInit::getDirectory;
Expand Down Expand Up @@ -36,6 +36,7 @@ our $A_CARD_BARCODES; *A_CARD_BARCODES = \'urn:perun:user:attribute-def:def:car
our $A_CARD_CHIP_NUMBERS; *A_CARD_CHIP_NUMBERS = \'urn:perun:user:attribute-def:def:cardCodes';
our $A_VSUP_PREF_MAIL; *A_VSUP_PREF_MAIL = \'urn:perun:user:attribute-def:def:vsupPreferredMail';
our $A_VSUP_SSH_KEYS; *A_VSUP_SSH_KEYS = \'urn:perun:user:attribute-def:def:sshPublicKey';
our $A_VSUP_EXCHANGE_MAIL_ALIASES; *A_VSUP_EXCHANGE_MAIL_ALIASES = \'urn:perun:user:attribute-def:def:vsupExchangeMailAliases';

# CHECK ON FACILITY ATTRIBUTES
if (!defined($data->getFacilityAttributeValue( attrName => $A_F_BASE_DN ))) {
Expand Down Expand Up @@ -106,6 +107,7 @@ foreach my $memberId ($data->getMemberIdsForFacility()) {
$users->{$login}->{$A_CARD_CHIP_NUMBERS} = $data->getUserAttributeValue( member => $memberId, attrName => $A_CARD_CHIP_NUMBERS );
$users->{$login}->{$A_VSUP_PREF_MAIL} = $data->getUserAttributeValue( member => $memberId, attrName => $A_VSUP_PREF_MAIL );
$users->{$login}->{$A_VSUP_SSH_KEYS} = $data->getUserAttributeValue( member => $memberId, attrName => $A_VSUP_SSH_KEYS );
$users->{$login}->{$A_VSUP_EXCHANGE_MAIL_ALIASES} = $data->getUserAttributeValue( member => $memberId, attrName => $A_VSUP_EXCHANGE_MAIL_ALIASES );

}

Expand All @@ -126,7 +128,7 @@ for my $login (@logins) {

print FILE "cn: " . $login . "\n";
print FILE "samAccountName: " . $login . "\n";
print FILE "userPrincipalName: " . $login . "\@" . $domain . "\n";
print FILE "userPrincipalName: " . $login . "\@umprum.cz" . "\n";
# enable accounts (if not) using service propagation
print FILE "userAccountControl: " . $uac . "\n";

Expand All @@ -141,6 +143,7 @@ for my $login (@logins) {
my $chipNumbers = $users->{$login}->{$A_CARD_CHIP_NUMBERS};
my $vsupPrefMail = $users->{$login}->{$A_VSUP_PREF_MAIL};
my $sshKeys = $users->{$login}->{$A_VSUP_SSH_KEYS};
my $exchangeMailAliases = $users->{$login}->{$A_VSUP_EXCHANGE_MAIL_ALIASES};

# print display name from firstName/lastName only
my $printedDisplayName = undef;
Expand Down Expand Up @@ -197,6 +200,10 @@ for my $login (@logins) {
print FILE "altSecurityIdentities: " . $val . "\n";
}

foreach my $val (@$exchangeMailAliases) {
print FILE "proxyAddresses: smtp:" . $val . "\n";
}

# print classes
print FILE "objectclass: top\n";
print FILE "objectclass: person\n";
Expand Down
42 changes: 0 additions & 42 deletions gen/openvpn

This file was deleted.

50 changes: 0 additions & 50 deletions gen/owncloud_vo_mapping

This file was deleted.

114 changes: 0 additions & 114 deletions gen/samba_du

This file was deleted.

12 changes: 6 additions & 6 deletions gen/tinia
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use utf8;

local $::SERVICE_NAME = "tinia";
local $::PROTOCOL_VERSION = "3.0.0";
my $SCRIPT_VERSION = "3.0.1";
my $SCRIPT_VERSION = "3.0.2";

perunServicesInit::init;
my $DIRECTORY = perunServicesInit::getDirectory;
Expand Down Expand Up @@ -66,11 +66,6 @@ foreach my $resourceId ( $data->getResourceIds() ) {
$dataByChip->{$chipNumber}->{$GOLD} = $resourceGold ? 1 : 0;
$dataByChip->{$chipNumber}->{$ARMING} = $resourceArming ? 1 : 0;
$dataByChip->{$chipNumber}->{$TYPE} = $type;
if($isBanned eq 1) {
$dataByChip->{$chipNumber}->{$ACC_GROUPS}->{$resourceAccGroup . "-BAN"} = 1;
} else {
$dataByChip->{$chipNumber}->{$ACC_GROUPS}->{$resourceAccGroup} = 1;
}
$dataByChip->{$chipNumber}->{$LOGIN} = $loginMU;
} else {
if($dataByChip->{$chipNumber}->{$LOGIN} ne $loginMU) {
Expand All @@ -79,6 +74,11 @@ foreach my $resourceId ( $data->getResourceIds() ) {

if($resourceGold) { $dataByChip->{$chipNumber}->{$GOLD} = 1; }
if($resourceArming) { $dataByChip->{$chipNumber}->{$ARMING} = 1; };
}

if($isBanned eq 1) {
$dataByChip->{$chipNumber}->{$ACC_GROUPS}->{$resourceAccGroup . "-BAN"} = 1;
} else {
$dataByChip->{$chipNumber}->{$ACC_GROUPS}->{$resourceAccGroup} = 1;
}
}
Expand Down
Loading

0 comments on commit 704ad49

Please sign in to comment.