コード例 #1
0
ファイル: install.inc.php プロジェクト: adamfranco/concerto
     $arrayOfTokens[] = array("username" => "sleepy", "password" => "disney");
     $arrayOfTokens[] = array("username" => "doc", "password" => "disney");
     $arrayOfTokens[] = array("username" => "bashful", "password" => "disney");
     $arrayOfTokens[] = array("username" => "dopey", "password" => "disney");
     $arrayOfTokens[] = array("username" => "sneezy", "password" => "disney");
     $arrayOfTokens[] = array("username" => "grumpy", "password" => "disney");
     $arrayOfTokens[] = array("username" => "happy", "password" => "disney");
     $dwarfAuthNTokens = array();
     foreach ($arrayOfTokens as $key => $tokenArray) {
         $dwarfAuthNTokens[$key] = $dbAuthMethod->createTokens($tokenArray);
         // Add it to the system
         $dbAuthMethod->addTokens($dwarfAuthNTokens[$key]);
     }
     // the last 3 steps for the dwarves
     foreach ($arrayOfTokens as $key => $tokens) {
         $dwarfProperties = new NonReferenceProperties($agentType);
         $dwarfProperties->addProperty("name", $tokens['username']);
         $dwarfProperties->addProperty("first_name", $tokens['username']);
         $dwarfProperties->addProperty("email", $tokens['username'] . "@xxxxxxxxx.edu");
         $dwarfProperties->addProperty("status", "Not a real Dwarf");
         $dAgent = $agentManager->createAgent($tokens['username'], $agentType, $dwarfProperties);
         $agentTokenMappingManager->createMapping($dAgent->getId(), $dwarfAuthNTokens[$key], $dbAuthType);
         $dwarfGroup->add($dAgent);
     }
 }
 /*********************************************************
  * Script for setting up the AuthorizationFunctions that Concerto will use
  *********************************************************/
 if (file_exists(MYDIR . '/config/authorization.conf.php')) {
     require_once MYDIR . '/config/authorization.conf.php';
 } else {
コード例 #2
0
 /**
  * Create a historical agent with properties set from the agent element for referencing 
  * in asset histories.
  * 
  * @param object DOMElement $element
  * @return void
  * @access protected
  * @since 1/29/08
  */
 protected function createHistoricalAgent(DOMElement $element)
 {
     $agentManager = Services::getService("Agent");
     $agentType = new Type("History", "edu.middlebury.harmoni", "Historical Agent", "Historical Agents are created to serve as a record of an agent that was once in the system. These agents do not have authentication credentials and cannot act in the system.");
     $agentProperties = new NonReferenceProperties($agentType);
     $properties = $element->getElementsByTagName('property');
     foreach ($properties as $property) {
         $key = $this->getStringValue($this->getSingleElement('./key', $property));
         $value = $this->getStringValue($this->getSingleElement('./string', $property));
         $agentProperties->addProperty($key, $value);
     }
     $agentProperties->addProperty("status", "Expired");
     try {
         $displayName = $this->getStringValue($this->getSingleElement('./displayName', $element));
     } catch (Exception $e) {
         $displayName = $element->getAttribute('id');
     }
     $agent = $agentManager->createAgent($displayName . " - Historical", $agentType, $agentProperties);
     $element->setAttribute('new_id', $agent->getId()->getIdString());
 }