Commit f19b49bd authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Merge branch 'master' into creed

parents 6402551d 5fc53a1f
Loading
Loading
Loading
Loading
+4 −0
Changes for config/autoload/global.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -25,6 +25,10 @@ return array(
        ///
        'oscar_num_separator' => 'DRI',

        ////////////////////////////////////////////////////////////////////////////////// authPersonNormalize [boolean]
        /// Permet d'ignorer la casse lors de la jonction entre les personnes et l'authentification
        'authPersonNormalize' => false,


        'export' => [
            'payments' => [
+16 −0
Changes for doc/install-prod.md: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -536,7 +536,23 @@ return array(
);
```

### Relation Person / Authentification

Une option a été ajouté pour force Oscar à ignorer la casse lorsque il établit la relation entre l'indentifiant de connexion et le login de la fiche personne. Par défaut cette option est ignorée, pour l'activier, éditer le fichier de configuration local : 

```php
<?php
// config/autoload.local.php
// ...
return array(
    // ...
    // Oscar
    'oscar' => [
        // ...
        'authPersonNormalize' => true,
    ]
);
```

### Usurpation

+12 −2
Changes for module/Oscar/src/Oscar/Controller/EnrollController.php: 12 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -89,6 +89,15 @@ class EnrollController extends AbstractOscarController
            throw new OscarException("Erreur, données manquantes, veuillez reessayer");
        }

        switch ($class) {
            case OrganizationPerson::class :
                $route = 'organization/show';
                $routeOpt = ['id' => $enroll->getOrganization()->getId()];
                break;
            default:
                return $this->getResponseInternalError("Objet $class non pris en charge");
        }

        try {
            $datet = new \DateTime($date);
        } catch (\Exception $e ){
@@ -98,13 +107,14 @@ class EnrollController extends AbstractOscarController
        try {
            $enroll->setDateEnd($datet);
            $this->getEntityManager()->flush($enroll);

            $this->redirect()->toRoute($route, $routeOpt);

        } catch (\Exception $e ){
            $msg = sprinf("Impossible de mettre le rôle de la person à jour : %s", $e->getMessage());
            $this->getActivityLogService()->addUserInfo($msg, "organizationperson", $enroll->getId());
            throw new OscarException($msg);
        }
        var_dump($datet);
        die(" / " . $date);
    }

    /**
+3 −0
Changes for module/Oscar/src/Oscar/Controller/ProjectGrantController.php: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -1602,6 +1602,9 @@ class ProjectGrantController extends AbstractOscarController
    {
        $this->organizationsPerimeter = $this->getOscarUserContext()->getOrganisationsPersonPrincipal($this->getOscarUserContext()->getCurrentPerson(),
            true);
        if( count($this->organizationsPerimeter) <= 0 ){
            throw new UnAuthorizedException();
        }

        return $this->advancedSearchAction();
    }
+2 −4
Changes for module/Oscar/src/Oscar/Service/OscarUserContext.php: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -283,7 +283,7 @@ class OscarUserContext extends UserContext
        $person = $person == null ? $this->getCurrentPerson() : $person;
        /** @var OrganizationPerson $affectation */
        foreach ($person->getOrganizations() as $affectation) {
            if( $affectation->isPrincipal() )
            if( !$affectation->isOutOfDate() && $affectation->isPrincipal() )
                $organizations[] = $id === true ? $affectation->getOrganization()->getId() : $affectation->getOrganization();
        }

@@ -304,7 +304,7 @@ class OscarUserContext extends UserContext
        $rolesLead = $this->getRoleIdPrimary();
        /** @var OrganizationPerson $affectation */
        foreach ($person->getOrganizations() as $affectation) {
            if (in_array($affectation->getRole(), $rolesLead)) {
            if (!$affectation->isOutOfDate() && in_array($affectation->getRole(), $rolesLead)) {
                return true;
            }
        }
@@ -349,7 +349,6 @@ class OscarUserContext extends UserContext

        try {
            if ($this->getLdapUser()) {

                // PATCH Limoges
                // au cas ou le supannAliasLogin n'est pas fournis...
                $pseudo = $this->getLdapUser()->getSupannAliasLogin();
@@ -363,7 +362,6 @@ class OscarUserContext extends UserContext
        } catch (NoResultException $ex) {
            // ... can happening with users stored in database directly
        }

        return null;
    }

Loading