Skip to content

Commit

Permalink
searchUser with profile_eduPersonAffiliation (to ignore staff employe…
Browse files Browse the repository at this point in the history
…eType, GLPI UP1#140683)
  • Loading branch information
prigaux committed Jan 29, 2024
1 parent d4ef0dd commit dccda06
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/supannPerson.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,11 @@ function attrRestrictions($allowExtendedInfo = -1) {
array('allowListeRouge' => allowListeRouge($allowExtendedInfo),
'allowMailForwardingAddress' => $allowExtendedInfo > 1,
'allowExtendedInfo' => $allowExtendedInfo,
'forceProfile' => (isset($_GET["profile_supannEntiteAffectation"]) ? '/\[supannEntiteAffectation=(\w+;)*' . preg_quote($_GET["profile_supannEntiteAffectation"], '/') . '[;\]]/' : null),
'forceProfile' =>
(isset($_GET["profile_supannEntiteAffectation"]) ? '/\[supannEntiteAffectation=(\w+;)*' . preg_quote($_GET["profile_supannEntiteAffectation"], '/') . '[;\]]/' :
(isset($_GET["profile_eduPersonAffiliation"]) ? '/\[eduPersonAffiliation=(\w+;)*' . preg_quote($_GET["profile_eduPersonAffiliation"], '/') . '[;\]]/' :
null)
),
);
}

Expand Down Expand Up @@ -587,7 +591,8 @@ function forceProfile(&$user, $forceProfile, $allowExtendedInfo, $wanted_attrs)
foreach ($user['up1Profile'] as $profile_s) {
if (preg_match($forceProfile, $profile_s)) {
$full_profile = parse_up1Profile_one_raw($profile_s);
if ($full_profile['supannEntiteAffectationPrincipale'] !== $_GET["profile_supannEntiteAffectation"] &&
if ($_GET["profile_supannEntiteAffectation"] &&
$full_profile['supannEntiteAffectationPrincipale'] !== $_GET["profile_supannEntiteAffectation"] &&
$full_profile['eduPersonPrimaryAffiliation'] === 'staff' &&
in_array('teacher', $full_profile['eduPersonAffiliation'])) {
// "cuisine" mélange plusieurs contrats. Les supannActivite RIFSEEP sont forcément associés au contrat staff, donc les ignorer pour les chargés d'enseignement
Expand Down

0 comments on commit dccda06

Please sign in to comment.