Loading src/UnicaenZimbra/Entity/Right.php +63 −1 Changes for src/UnicaenZimbra/Entity/Right.php: 63 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace UnicaenZimbra\Entity; use SimpleXMLElement; use UnicaenZimbra\Entity\Entity as ZimbraEntity; use Application\Exception; Loading Loading @@ -45,6 +46,22 @@ class Right */ private $target; /** * id Zimbra de la cible * utilisé lors de la récupération de la réponse du web services * * @var string */ private $targetId; /** * nom de la cible * utilisé lors de la récupération de la réponse du web services * * @var string */ private $targetName; /** * type de la cible * Loading @@ -62,12 +79,29 @@ class Right /** * id Zimbra ou nom du bénéficiaire (requis pour : usr grp egp dom gst key email) * id Zimbra ou nom du bénéficiaire * requis pour : usr grp egp dom gst key email * * @var string */ private $grantee; /** * id Zimbra du bénéficiaire * utilisé lors de la récupération de la réponse du web services * * @var string */ private $granteeId; /** * nom du bénéficiaire * utilisé lors de la récupération de la réponse du web services * * @var string */ private $granteeName; /** * type du bénéficiaire * Loading Loading @@ -135,9 +169,13 @@ class Right */ private $publicFields = array( 'target', 'targetId', 'targetName', 'targetType', 'targetBy', 'grantee', 'granteeId', 'granteeName', 'granteeType', 'granteeBy', 'granteeSecret', Loading Loading @@ -257,6 +295,30 @@ class Right ); } public function populate(SimpleXMLElement $object) { if($object->target->count() > 0) { $attributes = $object->target->attributes(); if(isset($attributes->type)) $this->targetType = $attributes->type; if(isset($attributes->id)) $this->targetId = $attributes->id; if(isset($attributes->name)) $this->targetName = $attributes->name; } if($object->grantee->count() > 0) { $attributes = $object->grantee->attributes(); if(isset($attributes->type)) $this->granteeType = $attributes->type; if(isset($attributes->id)) $this->granteeId = $attributes->id; if(isset($attributes->name)) $this->granteeName = $attributes->name; } if($object->right->count() > 0) { $this->right = $object->right; $attributes = $object->right->attributes(); if(isset($attributes->deny)) $this->rightDeny = $attributes->deny; if(isset($attributes->canDelegate)) $this->rightCanDelegate = $attributes->canDelegate; if(isset($attributes->disinheritSubGroups)) $this->rightDisinheritSubGroups = $attributes->disinheritSubGroups; if(isset($attributes->subDomain)) $this->rightSubDomain = $attributes->subDomain; } } /** * L'entité transmise devient la cible du droit * Loading src/UnicaenZimbra/Processus/BoiteGenerique.php +26 −7 Changes for src/UnicaenZimbra/Processus/BoiteGenerique.php: 26 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class BoiteGenerique extends Processus { /** * Création d'une boite générique * Créer une boite générique * * @param string $mail Adresse mail de la boite générique * @param string $password Mot de passe de la boite Loading @@ -46,6 +46,7 @@ class BoiteGenerique extends Processus } /** * Renommer une boîte générique * * @param string $mail adresse mail de la boîte générique * @param string $newName nouveau nom Loading @@ -59,7 +60,7 @@ class BoiteGenerique extends Processus } /** * Destruction de la boite générique * Supprimer une boite générique * * @param string $mail Adresse mail de la boite générique * @return self Loading @@ -72,7 +73,7 @@ class BoiteGenerique extends Processus } /** * Crée une adresse fonctionnelle par rapport à la boite générique (paramètre $mail) * Créer une adresse fonctionnelle par rapport à la boite générique (paramètre $mail) * * @param string $mail Adresse mail de la boite générique * @param string $adresseFonctionnelle Adresse mail de l'adresse fonctionnelle Loading Loading @@ -123,7 +124,7 @@ class BoiteGenerique extends Processus } /** * Renomme une adresse fonctionnelle * Renommer une adresse fonctionnelle * * @param string $mail Adresse mail de la boite générique * @param string $adresseFonctionnelle adresse mail de l'adresse fonctionnelle Loading Loading @@ -174,7 +175,7 @@ class BoiteGenerique extends Processus } /** * Supprime une adresse fonctionnelle par rapport à la boite générique (paramètre $mail) * Supprimer une adresse fonctionnelle par rapport à la boite générique (paramètre $mail) * * @param string $mail Adresse mail de la boite générique * @param string $adresseFonctionnelle Adresse mail de l'adresse fonctionnelle Loading Loading @@ -209,7 +210,24 @@ class BoiteGenerique extends Processus } /** * Donne accès à une boite fonctionnelle pour un utilisateur * Retourner les droits sur une adresse fonctionnelle * Permet notamment de récupérer les utilisateurs qui ont un accès à l'adresse fonctionnelle * * @param type $adresseFonctionnelle Adresse mail de l'adresse fonctionnelle * @return Right[] */ public function getGrantsOfAdresseFonctionnelle( $adresseFonctionnelle ) { $distribListService = $this->getServiceManager()->get('zimbraServiceDistributionList'); $rightService = $this->getServiceManager()->get('zimbraServiceRight'); $ace = new Right; $ace->setTarget($distribListService->get($adresseFonctionnelle)); return $rightService->getGrants($ace); } /** * Donner accès à une adresse fonctionnelle pour un utilisateur * * @param string $adresseFonctionnelle Adresse mail de l'adresse fonctionnelle * @param string $userMail Adresse mail de l'utilisateur Loading Loading @@ -287,7 +305,7 @@ class BoiteGenerique extends Processus } /** * Retire l'accès à une boite fonctionnelle pour un utilisateur * Retirer l'accès à une adresse fonctionnelle pour un utilisateur * * @param string $adresseFonctionnelle Adresse mail de l'adresse fonctionnelle * @param string $userMail Adresse mail de l'utilisateur Loading Loading @@ -336,6 +354,7 @@ class BoiteGenerique extends Processus } /** * Renommer une adresse fonctionnelle pour un utilisateur * * @param string $adresseFonctionnelle adresse mail de l'adresse fonctionnelle * @param type $userMail adresse mail de l'utilisateur Loading src/UnicaenZimbra/Service/Right.php +22 −0 Changes for src/UnicaenZimbra/Service/Right.php: 22 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -13,6 +13,28 @@ use UnicaenZimbra\Entity\Right as RightEntity; */ class Right extends Service { /** * Returns all grants on the specified target entry, or all grants granted * to the specified grantee entry. * * @param \UnicaenZimbra\Entity\Right $right * @return RightEntity[] */ public function getGrants(RightEntity $right) { $params = $right->getConvertedToXml(); $response = $this->getZimbra()->request('GetGrantsRequest', array(), $params); $results = array(); foreach ($response->children()->GetGrantsResponse->children() as $rightXml) { $right = new RightEntity; $right->populate($rightXml); $results[] = $right; } $this->count = count($results); return $results; } /** * Grant a right on a target to an individual or group grantee. * Loading Loading
src/UnicaenZimbra/Entity/Right.php +63 −1 Changes for src/UnicaenZimbra/Entity/Right.php: 63 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace UnicaenZimbra\Entity; use SimpleXMLElement; use UnicaenZimbra\Entity\Entity as ZimbraEntity; use Application\Exception; Loading Loading @@ -45,6 +46,22 @@ class Right */ private $target; /** * id Zimbra de la cible * utilisé lors de la récupération de la réponse du web services * * @var string */ private $targetId; /** * nom de la cible * utilisé lors de la récupération de la réponse du web services * * @var string */ private $targetName; /** * type de la cible * Loading @@ -62,12 +79,29 @@ class Right /** * id Zimbra ou nom du bénéficiaire (requis pour : usr grp egp dom gst key email) * id Zimbra ou nom du bénéficiaire * requis pour : usr grp egp dom gst key email * * @var string */ private $grantee; /** * id Zimbra du bénéficiaire * utilisé lors de la récupération de la réponse du web services * * @var string */ private $granteeId; /** * nom du bénéficiaire * utilisé lors de la récupération de la réponse du web services * * @var string */ private $granteeName; /** * type du bénéficiaire * Loading Loading @@ -135,9 +169,13 @@ class Right */ private $publicFields = array( 'target', 'targetId', 'targetName', 'targetType', 'targetBy', 'grantee', 'granteeId', 'granteeName', 'granteeType', 'granteeBy', 'granteeSecret', Loading Loading @@ -257,6 +295,30 @@ class Right ); } public function populate(SimpleXMLElement $object) { if($object->target->count() > 0) { $attributes = $object->target->attributes(); if(isset($attributes->type)) $this->targetType = $attributes->type; if(isset($attributes->id)) $this->targetId = $attributes->id; if(isset($attributes->name)) $this->targetName = $attributes->name; } if($object->grantee->count() > 0) { $attributes = $object->grantee->attributes(); if(isset($attributes->type)) $this->granteeType = $attributes->type; if(isset($attributes->id)) $this->granteeId = $attributes->id; if(isset($attributes->name)) $this->granteeName = $attributes->name; } if($object->right->count() > 0) { $this->right = $object->right; $attributes = $object->right->attributes(); if(isset($attributes->deny)) $this->rightDeny = $attributes->deny; if(isset($attributes->canDelegate)) $this->rightCanDelegate = $attributes->canDelegate; if(isset($attributes->disinheritSubGroups)) $this->rightDisinheritSubGroups = $attributes->disinheritSubGroups; if(isset($attributes->subDomain)) $this->rightSubDomain = $attributes->subDomain; } } /** * L'entité transmise devient la cible du droit * Loading
src/UnicaenZimbra/Processus/BoiteGenerique.php +26 −7 Changes for src/UnicaenZimbra/Processus/BoiteGenerique.php: 26 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class BoiteGenerique extends Processus { /** * Création d'une boite générique * Créer une boite générique * * @param string $mail Adresse mail de la boite générique * @param string $password Mot de passe de la boite Loading @@ -46,6 +46,7 @@ class BoiteGenerique extends Processus } /** * Renommer une boîte générique * * @param string $mail adresse mail de la boîte générique * @param string $newName nouveau nom Loading @@ -59,7 +60,7 @@ class BoiteGenerique extends Processus } /** * Destruction de la boite générique * Supprimer une boite générique * * @param string $mail Adresse mail de la boite générique * @return self Loading @@ -72,7 +73,7 @@ class BoiteGenerique extends Processus } /** * Crée une adresse fonctionnelle par rapport à la boite générique (paramètre $mail) * Créer une adresse fonctionnelle par rapport à la boite générique (paramètre $mail) * * @param string $mail Adresse mail de la boite générique * @param string $adresseFonctionnelle Adresse mail de l'adresse fonctionnelle Loading Loading @@ -123,7 +124,7 @@ class BoiteGenerique extends Processus } /** * Renomme une adresse fonctionnelle * Renommer une adresse fonctionnelle * * @param string $mail Adresse mail de la boite générique * @param string $adresseFonctionnelle adresse mail de l'adresse fonctionnelle Loading Loading @@ -174,7 +175,7 @@ class BoiteGenerique extends Processus } /** * Supprime une adresse fonctionnelle par rapport à la boite générique (paramètre $mail) * Supprimer une adresse fonctionnelle par rapport à la boite générique (paramètre $mail) * * @param string $mail Adresse mail de la boite générique * @param string $adresseFonctionnelle Adresse mail de l'adresse fonctionnelle Loading Loading @@ -209,7 +210,24 @@ class BoiteGenerique extends Processus } /** * Donne accès à une boite fonctionnelle pour un utilisateur * Retourner les droits sur une adresse fonctionnelle * Permet notamment de récupérer les utilisateurs qui ont un accès à l'adresse fonctionnelle * * @param type $adresseFonctionnelle Adresse mail de l'adresse fonctionnelle * @return Right[] */ public function getGrantsOfAdresseFonctionnelle( $adresseFonctionnelle ) { $distribListService = $this->getServiceManager()->get('zimbraServiceDistributionList'); $rightService = $this->getServiceManager()->get('zimbraServiceRight'); $ace = new Right; $ace->setTarget($distribListService->get($adresseFonctionnelle)); return $rightService->getGrants($ace); } /** * Donner accès à une adresse fonctionnelle pour un utilisateur * * @param string $adresseFonctionnelle Adresse mail de l'adresse fonctionnelle * @param string $userMail Adresse mail de l'utilisateur Loading Loading @@ -287,7 +305,7 @@ class BoiteGenerique extends Processus } /** * Retire l'accès à une boite fonctionnelle pour un utilisateur * Retirer l'accès à une adresse fonctionnelle pour un utilisateur * * @param string $adresseFonctionnelle Adresse mail de l'adresse fonctionnelle * @param string $userMail Adresse mail de l'utilisateur Loading Loading @@ -336,6 +354,7 @@ class BoiteGenerique extends Processus } /** * Renommer une adresse fonctionnelle pour un utilisateur * * @param string $adresseFonctionnelle adresse mail de l'adresse fonctionnelle * @param type $userMail adresse mail de l'utilisateur Loading
src/UnicaenZimbra/Service/Right.php +22 −0 Changes for src/UnicaenZimbra/Service/Right.php: 22 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -13,6 +13,28 @@ use UnicaenZimbra\Entity\Right as RightEntity; */ class Right extends Service { /** * Returns all grants on the specified target entry, or all grants granted * to the specified grantee entry. * * @param \UnicaenZimbra\Entity\Right $right * @return RightEntity[] */ public function getGrants(RightEntity $right) { $params = $right->getConvertedToXml(); $response = $this->getZimbra()->request('GetGrantsRequest', array(), $params); $results = array(); foreach ($response->children()->GetGrantsResponse->children() as $rightXml) { $right = new RightEntity; $right->populate($rightXml); $results[] = $right; } $this->count = count($results); return $results; } /** * Grant a right on a target to an individual or group grantee. * Loading