Commit 01e7af08 authored by David Surville's avatar David Surville
Browse files

Quelques corrections de code

parent ce3cc221
Loading
Loading
Loading
Loading
+0 −5
Changes for src/UnicaenZimbra/Entity/Grant.php: 0 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -131,11 +131,6 @@ class Grant
        if (! in_array($name, $this->publicFields) && 'changed' != $name)
            throw new Exception('La propriété '.$name.' est inconnue ou n\'est pas modifiable');

        /* Mise à jour de l'ID */
        if ('granteeId' == $name) $this->id = $value;
        /* Mise à jour du nom */
        if ('granteeName' == $name) $this->name = $value;
        
        $this->$name = $value;
        if ('changed' != $name) $this->changed = true;
    }
+3 −6
Changes for src/UnicaenZimbra/Service/Folder.php: 3 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -318,16 +318,13 @@ class Folder extends Service {
        switch( $action ){
        case self::GRANT_ACTION_SENDMAIL:
            /* Envoi d'un mail au destinataire pour le partage */
            if ($grant->granteeType != GrantEntity::TYPE_USR){
                throw new Exception('L\'envoi de mail de notification ne fonctionne que si le partage se fait à un utilisateur');
            if (!in_array($grant->granteeType, array(GrantEntity::TYPE_USR, GrantEntity::TYPE_GRP))) {
                throw new Exception('L\'envoi de mail de notification ne fonctionne que si le partage se fait avec un utilisateur (GrantEntity::TYPE_USR) ou une liste de distribution (GrantEntity::TYPE_GRP)');
            }
            $this->sendGrantNotification($id, $grant->granteeName);
        break;
        case self::GRANT_ACTION_LINK:
            /* Ajout automatique du lien vers le dossier partagé sur le destinataire */
            if ($grant->granteeType != GrantEntity::TYPE_USR){
                throw new Exception('L\'envoi de mail de notification ne fonctionne que si le partage se fait à un utilisateur');
            }
	    if (empty($folder)) $folder = $this->get($id,'id');
            $this->createMountPoint($id, $grant->granteeName, '/'.$folder->getName().' de '.$this->getAccount()->displayName);
        break;
        }