if (!isset($agent)) { $id = 'show' == $action ? $sf_params->get('id') : $paramId; if ($id) { $agent = AgentPeer::retrieveByPK($id); } } $objectId = $agent ? $agent->getID() : ""; break; case 'agentuser': $showBc = true; $showAgentBc = true; $showAgentUserBc = true; if (!isset($agent_has_user)) { $id = 'show' == $action ? $sf_params->get('id') : $paramId; if ($id) { $agent_has_user = AgentHasUserPeer::retrieveByPK($id); } } $objectId = $agent_has_user->getID(); if (!isset($agent)) { $agent = $agent_has_user->getAgent(); } $tab = false; break; case 'vocabulary': $showBc = true; $showVocabularyBc = true; if ('import' == $filter) { $import = FileImportHistoryPeer::retrieveByPK($paramId); if ($import) { $id = $import->getSchemaId();
public function getAgentCredentials($agentId = false) { //$agentId = sfContext::getInstance()->getRequest()->getParameter('id'); if ($this->isAuthenticated()) { if ($agentId) { //make sure we've revoked the credentials -- we revoke, then set them every time the agent is accessed $this->removeCredential('agentcontact'); $this->removeCredential('agentregistrar'); $this->removeCredential('agentadmin'); $agentContact = AgentHasUserPeer::retrieveByPK($agentId, $this->getSubscriberId()); if (isset($agentContact)) { $this->addCredential('agentcontact'); if ($agentContact->getIsRegistrarFor()) { $this->addCredential('agentregistrar'); } if ($agentContact->getIsAdminFor()) { $this->addCredential('agentadmin'); } } } elseif ('create' == sfContext::getInstance()->getRequest()->getParameter('action')) { $this->addCredential('agentcontact'); $this->addCredential('agentregistrar'); $this->addCredential('agentadmin'); } } return; }