コード例 #1
0
 /**
  * Constructor
  */
 function HarmoniRepository(RepositoryManager $manager, Hierarchy $hierarchy, Id $id, ConfigurationProperties $configuration)
 {
     $this->manager = $manager;
     // Get the node coresponding to our id
     $this->_hierarchy = $hierarchy;
     $this->_node = $this->_hierarchy->getNode($id);
     // Cache any created Assets so that we can pass out references to them.
     $this->_createdAssets = array();
     $this->_assetValidFlags = array();
     //		$this->_assetDataSets = array();
     // Set up an array of searchTypes that this DR supports
     $this->_registerSearchTypes();
     // Define the type to use as a key for Identifying DRs
     $this->_repositoryKeyType = new HarmoniType("Repository", "edu.middlebury.harmoni", "Repository", "Nodes with this type are by definition Repositories.");
     // Set up an array of created RecordStructures so we can pass out references to them.
     $this->_createdRecordStructures = array();
     // Add the file RecordStructure to the DR
     $this->_createdRecordStructures['FILE'] = new HarmoniFileRecordStructure();
     $this->_createdRecordStructures['REMOTE_FILE'] = new RemoteFileRecordStructure();
     // Built-in Types
     // Keys of the array are the RecordStructure Ids,
     // Vals of the array are the record class-names to instantiate.
     $this->_builtInTypes = array();
     if ($configuration->getProperty('use_filesystem_for_files')) {
         $this->_builtInTypes['FILE'] = 'FileSystemFileRecord';
     } else {
         $this->_builtInTypes['FILE'] = 'FileRecord';
     }
     $this->_builtInTypes['REMOTE_FILE'] = 'RemoteFileRecord';
     // Store our configuration
     $this->_configuration = $configuration;
 }
コード例 #2
0
 /**
  *	  Sets up unit test wide variables at the start
  *	  of each test method.
  *	  @access public
  */
 function setUp()
 {
     // Set up the database connection
     $dbHandler =& Services::getService("DatabaseManager");
     $dbIndex = $dbHandler->addDatabase(new MySQLDatabase("devo", "doboHarmoniTest", "test", "test"));
     $dbHandler->pConnect($dbIndex);
     unset($dbHandler);
     // done with that for now
     $context = new OsidContext();
     $configuration = new ConfigurationProperties();
     $configuration->addProperty('database_index', $dbIndex);
     $configuration->addProperty('database_name', $arg0 = "doboHarmoniTest");
     unset($arg0);
     $this->manager = new HarmoniHierarchyManager();
     $this->manager->assignConfiguration($configuration);
 }
コード例 #3
0
 /**
  * Constructor
  */
 function HarmoniAsset(RepositoryManager $manager, Hierarchy $hierarchy, Repository $repository, Id $id, ConfigurationProperties $configuration)
 {
     // Get the node coresponding to our id
     $this->manager = $manager;
     $this->_hierarchy = $hierarchy;
     $this->_node = $this->_hierarchy->getNode($id);
     $this->_repository = $repository;
     $this->_recordIDs = array();
     $this->_createdRecords = array();
     $this->_createdRecordStructures = array();
     // Store our configuration
     $this->_configuration = $configuration;
     $this->_versionControlAll = $configuration->getProperty('version_control_all') ? TRUE : FALSE;
     if (is_array($configuration->getProperty('version_control_types'))) {
         ArgumentValidator::validate($configuration->getProperty('version_control_types'), ArrayValidatorRuleWithRule::getRule(ExtendsValidatorRule::getRule("Type")));
         $this->_versionControlTypes = $configuration->getProperty('version_control_types');
     } else {
         $this->_versionControlTypes = array();
     }
     $this->_dbIndex = $configuration->getProperty('database_index');
 }
コード例 #4
0
 *			);
 *
 * USAGE: Copy this file to authentication_manager.conf.php to set custom values.
 *
 * @package segue.config
 * 
 * @copyright Copyright © 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 */
require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/LDAPAuthNMethod.class.php";
require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/LDAPAuthNTokens.class.php";
/*********************************************************
 * Create and configure the authentication method
 *********************************************************/
$authNMethod = new LDAPAuthNMethod();
$configuration = new ConfigurationProperties();
$configuration->addProperty('tokens_class', 'LDAPAuthNTokens');
$configuration->addProperty("LDAPHost", "ad.middlebury.edu");
$configuration->addProperty("UserBaseDN", "cn=users,dc=middlebury,dc=edu");
$configuration->addProperty("ClassesBaseDN", "ou=classes,ou=groups,dc=middlebury,dc=edu");
$configuration->addProperty("GroupBaseDN", "ou=groups,dc=middlebury,dc=edu");
$configuration->addProperty("bindDN", "readonly_username");
$configuration->addProperty("bindDNPassword", "password");
$propertiesFields = array('username' => 'samaccountname', 'name' => 'displayname', 'first name' => 'givenname', 'last name' => 'sn', 'department' => 'department', 'email' => 'mail');
$configuration->addProperty('properties_fields', $propertiesFields);
$loginFields = array('samaccountname', 'mail', 'cn');
$configuration->addProperty('login_fields', $loginFields);
$configuration->addProperty("display_name_property", "name");
$authNMethod->assignConfiguration($configuration);
/*********************************************************
 * Enable the authentication method
コード例 #5
0
 *			);
 *
 * USAGE: Copy this file to authentication-db.conf.php to set custom values.
 *
 * @package segue.config
 * 
 * @copyright Copyright © 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 */
require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/SQLDatabaseAuthNMethod.class.php";
require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/SQLDatabaseMD5UsernamePasswordAuthNTokens.class.php";
/*********************************************************
 * Create and configure the authentication method
 *********************************************************/
$authNMethod = new SQLDatabaseAuthNMethod();
$configuration = new ConfigurationProperties();
$configuration->addProperty('tokens_class', 'SQLDatabaseMD5UsernamePasswordAuthNTokens');
$configuration->addProperty('database_id', $dbID);
$configuration->addProperty('authentication_table', 'auth_db_user');
$configuration->addProperty('username_field', 'username');
$configuration->addProperty('password_field', 'password');
$propertiesFields = array('username' => 'username');
$configuration->addProperty('properties_fields', $propertiesFields);
$authNMethod->assignConfiguration($configuration);
/*********************************************************
 * Enable the authentication method
 *********************************************************/
// Define a unique Type for this method
$type = new Type("Authentication", "edu.middlebury.harmoni", "Harmoni DB");
// Add the method to our AuthenticationMethodManagerConfiguration
$authenticationMethodManagerConfiguration->addProperty($type, $authNMethod);
コード例 #6
0
<?php

/**
 * Set up the SetsManager
 *
 * USAGE: Copy this file to sets.conf.php to set custom values.
 *
 * @package concerto.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id$
 */
// :: Set up the Sets Manager ::
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_index', $dbID);
Services::startManagerAsService("SetManager", $context, $configuration);
コード例 #7
0
<?php

/**
 * Set up the PluginManager
 *
 * USAGE: Copy this file to plugins.conf.php to set custom values.
 *
 * @package segue.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id: plugins_default.conf.php,v 1.8 2008/04/04 20:23:13 achapin Exp $
 */
require_once MYDIR . "/main/library/PluginManager/PluginManager.class.php";
Services::registerService("PluginManager", "PluginManager");
Services::createServiceAlias("PluginManager", "Plugs");
$configuration = new ConfigurationProperties();
$configuration->addProperty('plugin_dir', $dir = MYDIR . "/plugins");
$configuration->addProperty('plugin_path', $path = MYPATH . "/plugins");
$configuration->addProperty('authN_priority', $prior = 'Middlebury LDAP');
Services::startManagerAsService("PluginManager", $context, $configuration);
//   	$pluginManager = Services::getService("PluginManager");
//  	$pluginManager->enablePlugin(new Type ('SeguePlugins', 'edu.middlebury', 'Tags'));
// 	$pluginManager->installPlugin(new Type ('SeguePlugins', 'edu.middlebury', 'Download'));
// 	$pluginManager->installPlugin(new Type ('SeguePlugins', 'edu.middlebury', 'Assignment'));
コード例 #8
0
ファイル: test.php プロジェクト: adamfranco/harmoni
 * @package harmoni.osid_v2.simple_table_repository
 * 
 * @copyright Copyright &copy; 2007, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id: test.php,v 1.1 2007/10/05 14:02:58 adamfranco Exp $
 */
require_once '../../../harmoni.inc.php';
require_once dirname(__FILE__) . '/SimpleTableRepositoryManager.class.php';
print "\n<html>\n<head>\n\t<title>Simple Table Repository Test</title>\n\t<style type='text/css'>\n\t\t.recstruct {\n\t\t\tfloat: left;\n\t\t\tmargin: 5px;\n\t\t\tbackground-color: #AFA;\n\t\t\tborder: 1px dotted;\n\t\t\tpadding: 5px;\n\t\t}\n\t\tdt {\n\t\t\tmargin-left: 10px;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\tdd {\n\t\t\tmargin-left: 20px;\n\t\t}\n\t\tdiv.desc {\n\t\t\tfont-style: italic;\n\t\t}\n\t\th2 {\n\t\t\tborder-top: 1px dotted;\n\t\t\tclear: both;\n\t\t}\n\t</style>\n</head>\n<body>\n\t<form action='" . $_SERVER['PHP_SELF'] . "' method='post'>\n\t\tDatabase Type:\n\t\t<select name='db_type'>\n\t\t\t<option value='MYSQL' " . (isset($_REQUEST['db_type']) && $_REQUEST['db_type'] == 'MYSQL' ? " selected='selected'" : '') . ">MySQL</option>\n\t\t\t<option value='POSTGRESQL' " . (isset($_REQUEST['db_type']) && $_REQUEST['db_type'] == 'POSTGRESQL' ? " selected='selected'" : '') . ">PostgreSQL</option>\n\t\t</select>\n\t\t<br/>Host: <input type='text' name='host' value='" . (isset($_REQUEST['host']) ? $_REQUEST['host'] : '') . "'/>\n\t\t<br/>Database: <input type='text' name='db' value='" . (isset($_REQUEST['db']) ? $_REQUEST['db'] : '') . "'/>\n\t\t<br/>Table: <input type='text' name='table' value='" . (isset($_REQUEST['table']) ? $_REQUEST['table'] : '') . "'/>\n\t\t<br/>User: <input type='text' name='user' value='" . (isset($_REQUEST['user']) ? $_REQUEST['user'] : '') . "'/>\n\t\t<br/>Password: <input type='password' name='password' value='" . (isset($_REQUEST['password']) ? $_REQUEST['password'] : '') . "'/>\n\t\t<br/>Asset Id Column: <input type='text' name='id_column' value='" . (isset($_REQUEST['id_column']) ? $_REQUEST['id_column'] : '') . "'/>\n\t\t<br/>Order Column: <input type='text' name='order_column' value='" . (isset($_REQUEST['order_column']) ? $_REQUEST['order_column'] : '') . "'/>\n\t\t\n\t\t<br/>Order Direction:\n\t\t<select name='order_direction'>\n\t\t\t<option value='ASCENDING' " . (isset($_REQUEST['order_direction']) && $_REQUEST['order_direction'] == 'ASCENDING' ? " selected='selected'" : '') . ">Ascending</option>\n\t\t\t<option value='DESCENDING' " . (isset($_REQUEST['order_direction']) && $_REQUEST['order_direction'] == 'DESCENDING' ? " selected='selected'" : '') . ">Descending</option>\n\t\t</select>\n\t\t\n\t\t<br/>Columns to use (one per line): \n\t\t<br/><textarea name='columns' rows='10' cols='80'>" . (isset($_REQUEST['columns']) ? $_REQUEST['columns'] : '') . "</textarea>\n\t\t<br/>Columns mapped to Dublin Core (one per line): \n\t\t<br/><textarea name='dc_mapping' rows='10' cols='80'>" . (isset($_REQUEST['dc_mapping']) ? $_REQUEST['dc_mapping'] : '') . "</textarea>\n\t\t<br/><input type='submit'/>\n";
if (isset($_REQUEST['host'])) {
    $manager = new SimpleTableRepositoryManager();
    /*********************************************************
     * Configuration
     *********************************************************/
    $configuration = new ConfigurationProperties();
    switch ($_REQUEST['db_type']) {
        case 'MYSQL':
            $configuration->addProperty('db_type', MYSQL);
            break;
        case 'POSTGRESQL':
            $configuration->addProperty('db_type', POSTGRESQL);
            break;
    }
    $configuration->addProperty('host', $_REQUEST['host']);
    $configuration->addProperty('db', $_REQUEST['db']);
    $configuration->addProperty('table', $_REQUEST['table']);
    $configuration->addProperty('user', $_REQUEST['user']);
    $configuration->addProperty('password', $_REQUEST['password']);
    $configuration->addProperty('id_column', $_REQUEST['id_column']);
    $configuration->addProperty('order_column', $_REQUEST['order_column']);
コード例 #9
0
ファイル: migration.php プロジェクト: adamfranco/harmoni
 /**
  * Run the update
  * 
  * @return boolean
  * @access public
  * @since 3/24/08
  */
 function runUpdate($dbIndex)
 {
     $prepStatus = new StatusStars("Preparing Migration");
     $prepStatus->initializeStatistics(3);
     // Configure the original Hierarchy and AZ services
     $context = new OsidContext();
     $configuration = new ConfigurationProperties();
     $configuration->addProperty('database_index', $dbIndex);
     $configuration->addProperty('database_name', $_REQUEST['db_name']);
     $configuration->addProperty('harmoni_db_name', 'migration_db');
     Services::startManagerAsService("IdManager", $context, $configuration);
     Services::startManagerAsService("HierarchyManager", $context, $configuration);
     Services::startManagerAsService("AuthorizationManager", $context, $configuration);
     // Agent Manager
     $configuration = new ConfigurationProperties();
     // default agent Flavor is one that can be editted
     $agentFlavor = "HarmoniEditableAgent";
     $agentHierarchyId = "edu.middlebury.authorization.hierarchy";
     $configuration->addProperty('hierarchy_id', $agentHierarchyId);
     $configuration->addProperty('defaultAgentFlavor', $agentFlavor);
     $configuration->addProperty('database_index', $dbIndex);
     $configuration->addProperty('database_name', $_REQUEST['db_name']);
     Services::startManagerAsService("AgentManager", $context, $configuration);
     // :: Set up PropertyManager ::
     //the property manager operates in the same context as the AgentManager and is more or less an adjunct to it
     $configuration->addProperty('database_index', $dbIndex);
     $configuration->addProperty('database_name', $_REQUEST['db_name']);
     Services::startManagerAsService("PropertyManager", $context, $configuration);
     // :: Start the AuthenticationManager OSID Impl.
     $configuration = new ConfigurationProperties();
     $tokenCollectors = array(serialize(new Type("Authentication", "edu.middlebury.harmoni", "Harmoni DB")) => new FormActionNamePassTokenCollector('does not exist'));
     $configuration->addProperty('token_collectors', $tokenCollectors);
     Services::startManagerAsService("AuthenticationManager", $context, $configuration);
     // :: Start and configure the AuthenticationMethodManager
     $configuration = new ConfigurationProperties();
     // set up a Database Authentication Method
     require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/SQLDatabaseAuthNMethod.class.php";
     require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/SQLDatabaseMD5UsernamePasswordAuthNTokens.class.php";
     $dbAuthType = new Type("Authentication", "edu.middlebury.harmoni", "Harmoni DB");
     $dbMethodConfiguration = new ConfigurationProperties();
     $dbMethodConfiguration->addProperty('tokens_class', 'SQLDatabaseMD5UsernamePasswordAuthNTokens');
     $dbMethodConfiguration->addProperty('database_id', $dbIndex);
     $dbMethodConfiguration->addProperty('authentication_table', 'auth_db_user');
     $dbMethodConfiguration->addProperty('username_field', 'username');
     $dbMethodConfiguration->addProperty('password_field', 'password');
     $propertiesFields = array('username' => 'username');
     $dbMethodConfiguration->addProperty('properties_fields', $propertiesFields);
     $dbAuthNMethod = new SQLDatabaseAuthNMethod();
     $dbAuthNMethod->assignConfiguration($dbMethodConfiguration);
     $configuration->addProperty($dbAuthType, $dbAuthNMethod);
     Services::startManagerAsService("AuthNMethodManager", $context, $configuration);
     // :: Agent-Token Mapping Manager ::
     $configuration = new ConfigurationProperties();
     $configuration->addProperty('database_id', $dbIndex);
     $configuration->addProperty('harmoni_db_name', 'migration_db');
     Services::startManagerAsService("AgentTokenMappingManager", $context, $configuration);
     $prepStatus->updateStatistics();
     $dbc = Services::getService("DatabaseManager");
     try {
         /*********************************************************
          * Check for the old tables. They must exist for us to run
          *********************************************************/
         $azTables = array('az_authorization', 'az_function', 'hierarchy', 'j_node_node', 'node', 'node_ancestry');
         // Check for old tables
         $tables = $dbc->getTableList($dbIndex);
         foreach ($azTables as $table) {
             if (!in_array($table, $tables)) {
                 throw new Exception("Old AZ table, {$table}, is missing. Can not run Update.");
             }
         }
         /*********************************************************
          * Create the new tables
          *********************************************************/
         $type = $dbc->getDatabaseType($dbIndex);
         switch ($type) {
             case MYSQL:
                 SQLUtils::runSQLfile(HARMONI_BASE . "/SQL/MySQL/AuthZ2.sql", $dbIndex);
                 break;
             case POSTGRESQL:
                 SQLUtils::runSQLfile(HARMONI_BASE . "/SQL/PostgreSQL/AuthZ2.sql", $dbIndex);
                 break;
             case ORACLE:
                 SQLUtils::runSQLfile(HARMONI_BASE . "/SQL/PostgreSQL/AuthZ2.sql", $dbIndex);
                 break;
             default:
                 throw new Exception("Database schemas are not defined for specified database type.");
         }
         /*********************************************************
          * Hierarchy
          *********************************************************/
         $hierarchyMgr1 = Services::getService("Hierarchy");
         if (get_class($hierarchyMgr1) == "AuthZ2_HierarchyManager") {
             throw new OperationFailedException("Original HierarchyManager not configured.");
         }
         $hierarchyMgr2 = new AuthZ2_HierarchyManager();
         $azMgr2 = new AuthZ2_AuthorizationManager();
         $azMgr2->setHierarchyManager($hierarchyMgr2);
         $hierarchyMgr2->assignConfiguration($hierarchyMgr1->_configuration);
         /*********************************************************
          * Authorization
          *********************************************************/
         $azMgr1 = Services::getService("AuthZ");
         if (get_class($hierarchyMgr1) == "AuthZ2_AuthorizationManager") {
             throw new OperationFailedException("Original HierarchyManager not configured.");
         }
         $azMgr2->assignConfiguration($azMgr1->_configuration);
         $prepStatus->updateStatistics();
         /*********************************************************
          * Hierarchies
          *********************************************************/
         $hierarchies = $hierarchyMgr1->getHierarchies();
         $prepStatus->updateStatistics();
         while ($hierarchies->hasNext()) {
             $hierarchy = $hierarchies->next();
             try {
                 $newHierarchy = $hierarchyMgr2->getHierarchy($hierarchy->getId());
             } catch (UnknownIdException $e) {
                 $newHierarchy = $hierarchyMgr2->createHierarchy($hierarchy->getDisplayName(), array(), $hierarchy->getDescription(), $hierarchy->allowsMultipleParents(), $hierarchy->allowsRecursion(), $hierarchy->getId());
             }
             $query = new SelectQuery();
             $query->addTable("node");
             $query->addColumn("COUNT(*)", "num");
             $query->addWhereEqual("fk_hierarchy", $hierarchy->getId()->getIdString());
             $dbc = Services::getService("DatabaseManager");
             $result = $dbc->query($query);
             $this->nodeStatus = new StatusStars("Migrating nodes in the '" . $hierarchy->getDisplayName() . "' Hierarchy.");
             $this->nodeStatus->initializeStatistics($result->field("num"));
             // Add all of the nodes
             $nodes = $hierarchy->getRootNodes();
             while ($nodes->hasNext()) {
                 $this->addNode($newHierarchy, $nodes->next());
             }
         }
         /*********************************************************
          * Authorizations
          *********************************************************/
         $azMgr1 = Services::getService("AuthZ");
         if (get_class($hierarchyMgr1) == "AuthZ2_AuthorizationManager") {
             throw new OperationFailedException("Original HierarchyManager not configured.");
         }
         // Add all of the Authorization functions
         $functionTypes = $azMgr1->getFunctionTypes();
         while ($functionTypes->hasNext()) {
             $oldFunctions = $azMgr1->getFunctions($functionTypes->next());
             while ($oldFunctions->hasNext()) {
                 $oldFunction = $oldFunctions->next();
                 // Get or create the function
                 try {
                     $newFunction = $azMgr2->getFunction($oldFunction->getId());
                 } catch (UnknownIdException $e) {
                     $newFunction = $azMgr2->createFunction($oldFunction->getId(), $oldFunction->getReferenceName(), $oldFunction->getDescription(), $oldFunction->getFunctionType(), $oldFunction->getQualifierHierarchyId());
                 }
                 // Get all authorizations for this function.
                 $oldAZs = $azMgr1->getExplicitAZs(null, $oldFunction->getId(), null, false);
                 $status = new StatusStars("Migrating '" . $newFunction->getReferenceName() . "' Authorizations (" . $oldAZs->count() . ")");
                 $status->initializeStatistics($oldAZs->count());
                 while ($oldAZs->hasNext()) {
                     $oldAZ = $oldAZs->next();
                     $status->updateStatistics();
                     try {
                         $oldQualifier = $oldAZ->getQualifier();
                     } catch (UnknownIdException $e) {
                         // continue if the qualifier no longer exists.
                         continue;
                     }
                     // Add the new authorization
                     try {
                         $newAZ = $azMgr2->createAuthorization($oldAZ->getAgentId(), $oldAZ->getFunction()->getId(), $oldQualifier->getId());
                         if ($oldAZ->getExpirationDate()) {
                             $newAZ->updateExpirationDate($oldAZ->getExpirationDate());
                         }
                         if ($oldAZ->getEffectiveDate()) {
                             $newAZ->updateEffectiveDate($oldAZ->getEffectiveDate());
                         }
                     } catch (OperationFailedException $e) {
                     }
                 }
             }
         }
     } catch (Exception $e) {
         printpre($e->getMessage());
         HarmoniErrorHandler::printDebugBacktrace($e->getTrace());
         printpre("An error has occurred. Removing new tables.");
         try {
             $query = new GenericSQLQuery('TRUNCATE az2_implicit_az');
         } catch (DatabaseException $e) {
         }
         try {
             $query = new GenericSQLQuery('TRUNCATE az2_explicit_az');
         } catch (DatabaseException $e) {
         }
         try {
             $query = new GenericSQLQuery('TRUNCATE az2_node_ancestry');
         } catch (DatabaseException $e) {
         }
         try {
             $query = new GenericSQLQuery('TRUNCATE az2_j_node_node');
         } catch (DatabaseException $e) {
         }
         try {
             $query = new GenericSQLQuery('TRUNCATE az2_function');
         } catch (DatabaseException $e) {
         }
         try {
             $query = new GenericSQLQuery('TRUNCATE az2_function_type');
         } catch (DatabaseException $e) {
         }
         try {
             $query = new GenericSQLQuery('TRUNCATE az2_node');
         } catch (DatabaseException $e) {
         }
         try {
             $query = new GenericSQLQuery('TRUNCATE az2_node_type');
         } catch (DatabaseException $e) {
         }
         try {
             $query = new GenericSQLQuery('TRUNCATE az2_hierarchy');
         } catch (DatabaseException $e) {
         }
         $query = new GenericSQLQuery('DROP TABLE az2_implicit_az, az2_explicit_az, az2_function, az2_function_type, az2_node_ancestry, az2_j_node_node, az2_node, az2_node_type,  az2_hierarchy;');
         $dbc->query($query, $dbIndex);
         return false;
     }
     /*********************************************************
      * If we have successfully gotten this far, drop the old 
      * hierarchy and AuthZ tables to prevent confusion.
      *********************************************************/
     $query = new GenericSQLQuery('DROP TABLE az_authorization, az_function, hierarchy, j_node_node, node, node_ancestry;');
     $dbc->query($query, $dbIndex);
     print "Success!";
     return true;
 }
コード例 #10
0
<?php

/**
* Set up the SchedulingManager
*
* USAGE: Copy this file to coursemanagament.conf.php to set custom values.
*
* @package segue.config
*
* @copyright Copyright &copy; 2006, Middlebury College
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
*
* @version $Id: scheduling_default.conf.php,v 1.2 2007/09/04 18:00:43 adamfranco Exp $
*/
// :: Set up the SchedulingManager ::
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_index', $dbID);
$defaultAuthority = "edu.middlebury.authorization.hierarchy";
$configuration->addProperty('default_authority', $defaultAuthority);
/*
$courseManagamentHierarchyId = "edu.middlebury.authorization.hierarchy";
$courseManagamentRootId = "edu.middlebury.authorization.root";
$courseManagementId ="edu.middlebury.coursemanagement";
$canonicalCoursesId="edu.middlebury.coursemanagement.canonicalcourses";
$courseGroupsId ="edu.middlebury.coursemanagement.coursegroups";

$configuration->addProperty('hierarchy_id', $courseManagamentHierarchyId);
$configuration->addProperty('root_id', $courseManagamentHierarchyId);
$configuration->addProperty('course_management_id', $courseManagementId);
$configuration->addProperty('canonical_courses_id', $canonicalCoursesId);
$configuration->addProperty('course_groups_id', $courseGroupsId);
コード例 #11
0
<?php

/**
 * Set up the AuthorizationManager
 *
 * USAGE: Copy this file to authorization.conf.php to set custom values.
 *
 * @package concerto.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id$
 */
// :: Set up the Authorization System ::
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_index', $dbID);
$configuration->addProperty('database_name', $dbName);
Services::startManagerAsService("AuthorizationManager", $context, $configuration);
コード例 #12
0
 * USAGE: Copy this file to authentication_manager.conf.php to set custom values.
 *
 * @package segue.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 */
require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/CASAuthNMethod.class.php";
require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/CASAuthNTokens.class.php";
require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/CASGroup.class.php";
require_once HARMONI . "/oki2/authentication/CasTokenCollector.class.php";
/*********************************************************
 * Create and configure the authentication method
 *********************************************************/
$authNMethod = new CASAuthNMethod();
$configuration = new ConfigurationProperties();
$configuration->addProperty('CAS_DEBUG_PATH', '/tmp/harmoni_cas.out');
$configuration->addProperty("CAS_HOST", "login.middlebury.edu");
$configuration->addProperty("CAS_PORT", "443");
$configuration->addProperty("CAS_PATH", "/cas/");
$configuration->addProperty("CAS_CERT", "/etc/pki/tls/certs/ca-bundle.crt");
$configuration->addProperty("CALLBACK_URL", "https://chisel.middlebury.edu/~afranco/directory_client_test/storePGT.php");
$configuration->addProperty("CASDIRECTORY_BASE_URL", "http://login.middlebury.edu/directory/");
$configuration->addProperty("CASDIRECTORY_ADMIN_ACCESS", "qwertyuiop");
$configuration->addProperty("DISPLAY_NAME_FORMAT", "[[FirstName]] [[LastName]]");
$rootGroups = array('OU=web data,DC=middlebury,DC=edu');
$configuration->addProperty("ROOT_GROUPS", $rootGroups);
$configuration->addProperty("CASDIRECTORY_CLASS_ROOT", "OU=Classes,OU=Groups,DC=middlebury,DC=edu");
$configuration->addProperty("CASDIRECTORY_GROUP_ID_REGEX", "/^(OU|CN)=.*,DC=[a-z]+\$/i");
$authNMethod->assignConfiguration($configuration);
/*********************************************************
コード例 #13
0
}
/*********************************************************
 * Load each authentication source configuration files
 *********************************************************/
foreach ($authenticationSources as $source) {
    if (file_exists(MYDIR . '/config/authentication-' . $source . '.conf.php')) {
        require_once MYDIR . '/config/authentication-' . $source . '.conf.php';
    } else {
        require_once MYDIR . '/config/authentication-' . $source . '_default.conf.php';
    }
}
/*********************************************************
 * Start the AuthenticationMethodManager
 *********************************************************/
Services::startManagerAsService("AuthNMethodManager", $context, $authenticationMethodManagerConfiguration);
/*********************************************************
 * Agent-Token Mapping Manager
 *********************************************************/
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_id', $dbID);
$configuration->addProperty('harmoni_db_name', 'segue_db');
Services::startManagerAsService("AgentTokenMappingManager", $context, $configuration);
/*********************************************************
 * Start the AuthenticationManager OSID Impl.
 *********************************************************/
$configuration = new ConfigurationProperties();
$configuration->addProperty('token_collectors', $tokenCollectors);
$configuration->addProperty('jquery_src', POLYPHONY_PATH . "/javascript/jquery.min.js");
$configuration->addProperty('jquery_autocomplete_src', POLYPHONY_PATH . "/javascript/jquery.autocomplete.min.js");
$configuration->addProperty('jquery_autocomplete_css', POLYPHONY_PATH . "/javascript/jquery.autocomplete.css");
Services::startManagerAsService("AuthenticationManager", $context, $configuration);
コード例 #14
0
/**
 * Set up the parameters needed for OAI harvisting of metadata
 *
 * USAGE: Copy this file to oai.conf.php to set custom values.
 *
 * @package concerto.config
 * 
 * @copyright Copyright &copy; 2007, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id$
 */
// Specify the include path for the PEAR libraries
ini_set('include_path', ini_get('include_path') . ':/usr/local/lib/php/PEAR');
$config = new ConfigurationProperties();
$config->addProperty('ENABLE_OAI', false);
$config->addProperty('OAI_REPOSITORY_NAME', 'Concerto at Example University');
$config->addProperty('OAI_REPOSITORY_ID', 'concerto.example.edu');
$config->addProperty('OAI_ADMIN_EMAIL', '*****@*****.**');
$config->addProperty('OAI_DBID', $dbID);
$config->addProperty('OAI_DB_HOST', $dbHost);
$config->addProperty('OAI_DB_USER', $dbUser);
$config->addProperty('OAI_DB_PASSWD', $dbPass);
$config->addProperty('OAI_DB_NAME', $dbName);
$config->addProperty('OAI_TOKEN_DIR', '/tmp/concerto-oai_tokens');
// The search order is the array order. I.e, if the IP of the harvester matches the
// first entry, then that entry will be used and later ones ignored.
$harvesterConfig = array(array("name" => 'any_harvester', "ips_allowed" => array(), "repository_ids" => array(), "auth_group_ids" => array('edu.middlebury.agents.everyone')));
$config->addProperty('OAI_HARVESTER_CONFIG', $harvesterConfig);
$harmoni = Harmoni::instance();
コード例 #15
0
// 			$ldapConfiguration->addProperty("ClassesBaseDN", $arg2a = "ou=classes,ou=groups,dc=middlebury,dc=edu");
//  		$ldapConfiguration->addProperty("GroupBaseDN", $arg3 = "ou=groups,dc=middlebury,dc=edu");
//  		$ldapConfiguration->addProperty("bindDN", $arg4 = "juser");
//  		$ldapConfiguration->addProperty("bindDNPassword", $arg5 = "password");
//  		$propertiesFields = array (
//  			'username' => 'samaccountname',
//  			'name' =>  'displayname',
//  			'first name' =>  'givenname',
//  			'last name' =>  'sn',
//  			'department' =>  'department',
//  			'email' =>  'mail',
//  		);
//  		$ldapConfiguration->addProperty('properties_fields', $propertiesFields);
//  		$loginFields = array (
//  			'samaccountname',
//  			'mail',
//  			'cn',
//  		);
//  		$ldapConfiguration->addProperty('login_fields', $loginFields);
//  		$ldapConfiguration->addProperty("display_name_property", $arg6 = "name");
//
//  		$ldapAuthNMethod = new LDAPAuthNMethod;
//  		$ldapAuthNMethod->assignConfiguration($ldapConfiguration);
//  		unset($arg0, $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $propertiesFields, $loginFields, $ldapConfiguration);
//
//  	$configuration->addProperty($ldapAuthType, $ldapAuthNMethod);
Services::startManagerAsService("AuthNMethodManager", $context, $configuration);
// :: Agent-Token Mapping Manager ::
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_id', $dbID);
Services::startManagerAsService("AgentTokenMappingManager", $context, $configuration);
コード例 #16
0
<?php

/**
 * Set up the AuthorizationManager
 *
 * USAGE: Copy this file to authorization.conf.php to set custom values.
 *
 * @package segue.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id: authorization_default.conf.php,v 1.3 2007/09/04 18:00:42 adamfranco Exp $
 */
// :: Set up the Authorization System ::
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_index', $dbID);
$configuration->addProperty('database_name', $dbName);
$configuration->addProperty('harmoni_db_name', 'segue_db');
try {
    require_once HARMONI . "/oki2/AuthZ2/authz/AuthorizationManager.class.php";
    $azMgr = new AuthZ2_AuthorizationManager();
    $azMgr->assignConfiguration($configuration);
    Services::registerObjectAsService("AuthorizationManager", $azMgr);
} catch (ConfigurationErrorException $e) {
    Services::startManagerAsService("AuthorizationManager", $context, $configuration);
    print "<div class='config_error'>" . _("Please run the Segue Updates under Admin Tools") . "</div>";
}
コード例 #17
0
<?php

/**
 * Set up the LanguageLocalization system
 *
 * USAGE: Copy this file to language.conf.php to set custom values.
 *
 * @package concerto.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id$
 */
// :: Set up language directories ::
$configuration = new ConfigurationProperties();
$configuration->addProperty('default_language', $arg0 = 'en_US');
$configuration->addProperty('applications', $arg1 = array('concerto' => MYDIR . '/main/languages', 'polyphony' => POLYPHONY . '/main/languages'));
unset($arg0, $arg1);
Services::startManagerAsService("LanguageManager", $context, $configuration);
コード例 #18
0
<?php

/**
 * Set up the IdManager as this is required for the ID service
 *
 * USAGE: Copy this file to id.conf.php to set custom values.
 *
 * @package concerto.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id: tagging_default.conf.php,v 1.2 2008/04/08 20:57:37 achapin Exp $
 */
$configuration = new ConfigurationProperties();
$configuration->addProperty('DatabaseIndex', $dbID);
$systems = array('concerto' => array('ItemClass' => 'HarmoniNodeTaggedItem', 'HierarchyId' => 'edu.middlebury.authorization.hierarchy', 'UrlCallback' => 'getConcertoNodeUrl', 'ThumbUrlCallback' => 'getConcertoNodeThumbnailUrl'), 'segue' => array('ItemClass' => 'HarmoniNodeTaggedItem', 'HierarchyId' => 'edu.middlebury.authorization.hierarchy', 'UrlCallback' => 'getSegueNodeUrl'));
$configuration->addProperty('Systems', $systems);
Services::startManagerAsService("TagManager", $context, $configuration);
define('POLYPHONY_TAGGEDITEM_PRINTING_CALLBACK', 'concertoPrintTaggedItem');
/**
 * Print out an Item
 * 
 * @param object $item
 * @return object GuiComponent
 * @access public
 * @since 11/8/06
 */
function concertoPrintTaggedItem($item, $viewAction)
{
    printTaggedItem($item, $viewAction);
コード例 #19
0
<?php

/**
 * Set up the ImageProcessor service for generating thumbnails
 *
 * USAGE: Copy this file to imageprocessor.conf.php to set custom values.
 *
 * @package segue.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id: imageprocessor_default.conf.php,v 1.4 2007/09/25 19:46:17 adamfranco Exp $
 */
// :: Set up the ImageProcessor service for generating thumbnails ::
$configuration = new ConfigurationProperties();
$configuration->addProperty('thumbnail_format', "image/jpeg");
$configuration->addProperty('use_gd', FALSE);
$configuration->addProperty('gd_formats', array());
$configuration->addProperty('use_imagemagick', TRUE);
$configuration->addProperty('imagemagick_path', "/usr/local/bin");
$configuration->addProperty('imagemagick_temp_dir', "/tmp");
$configuration->addProperty('imagemagick_formats', array());
Services::startManagerAsService("ImageProcessingManager", $context, $configuration);
コード例 #20
0
ファイル: test.act.php プロジェクト: adamfranco/segue
 /**
  * Display a plugin.
  * 
  * @param string $id
  * @return void
  * @access public
  * @since 1/16/06
  */
 function displayPlugin($id)
 {
     $repositoryManager = Services::getService("Repository");
     $idManager = Services::getService("Id");
     $repository = $repositoryManager->getRepository($idManager->getId("edu.middlebury.segue.sites_repository"));
     $asset = $repository->getAsset($idManager->getId($id));
     $configuration = new ConfigurationProperties();
     $configuration->addProperty('plugin_dir', $dir = MYDIR . "/plugins");
     $configuration->addProperty('plugin_path', $path = MYPATH . "/plugins");
     $plugin = Plugin::newInstance($asset, $configuration);
     $actionRows = $this->getActionRows();
     ob_start();
     print AjaxPlugin::getPluginSystemJavascript();
     if (!is_object($plugin)) {
         print $plugin;
     } else {
         print "\n<div id='plugin:" . $plugin->getId() . "'>";
         print $plugin->executeAndGetMarkup();
         print "\n</div>";
     }
     $actionRows->add(new Block(ob_get_clean(), STANDARD_BLOCK), "100%", null, CENTER, CENTER);
 }
コード例 #21
0
*
* USAGE: Copy this file to coursemanagament.conf.php to set custom values.
*
* @package concerto.config
*
* @copyright Copyright &copy; 2006, Middlebury College
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
*
* @version $Id: coursemanagement_default.conf.php,v 1.2 2007/09/04 18:00:42 adamfranco Exp $
*/
/************************************************
/ Set this to true to create defualt terms
**********************************************/
$CREATE_TERMS = true;
// :: Set up the CourseManagementManager ::
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_index', $dbID);
$courseManagamentHierarchyId = "edu.middlebury.authorization.hierarchy";
$courseManagementId = "edu.middlebury.coursemanagement";
$configuration->addProperty('hierarchy_id', $courseManagamentHierarchyId);
$configuration->addProperty('course_management_id', $courseManagementId);
$configuration->addProperty('whether_to_add_terms', $CREATE_TERMS);
for ($year = 2004; $year < 2010; $year++) {
    $array = array();
    $array['name'] = "Winter " . $year;
    $array['start'] = Timestamp::fromString($year . "-01-01T00:00:00");
    $array['end'] = Timestamp::fromString($year . "-02-01T00:00:00");
    $array['type'] = new Type("TermType", "edu.middlebury", "Winter");
    $terms[] = $array;
    $array = array();
    $array['name'] = "Spring " . $year;
コード例 #22
0
 *
 * @package segue.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 */
if (!defined('RECAPTCHA_PUBLIC_KEY') || !defined('RECAPTCHA_PRIVATE_KEY')) {
    throw new ConfigurationErrorException("You must configure reCAPTCHA API keys in segue/config/recaptcha.conf.php to enable visitor registration.");
}
require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/VisitorSQLDatabaseAuthNMethod.class.php";
require_once HARMONI . "/oki2/agentmanagement/AuthNMethods/SQLDatabaseMD5UsernamePasswordAuthNTokens.class.php";
/*********************************************************
 * Create and configure the authentication method
 *********************************************************/
$authNMethod = new VisitorSQLDatabaseAuthNMethod();
$configuration = new ConfigurationProperties();
$configuration->addProperty('tokens_class', 'SQLDatabaseMD5UsernamePasswordAuthNTokens');
$configuration->addProperty('database_id', $dbID);
// These values can be changed if needed.
$configuration->addProperty('email_from_name', 'Segue Administrator');
$configuration->addProperty('email_from_address', $_SERVER['SERVER_ADMIN']);
// Visitors with emails from these domains will not be able  to register.
$configuration->addProperty('domain_blacklist', array('example.com', 'example.org', 'example.net', 'example.edu'));
// If specified, only visitors with emails from these domains will be allowed
// to register. Blacklist and existance checks will still apply.
// 	$configuration->addProperty('domain_whitelist', array(
// 		'example.edu'
// 	));
$authNMethod->assignConfiguration($configuration);
/*********************************************************
 * Enable the authentication method
コード例 #23
0
ファイル: test.php プロジェクト: adamfranco/harmoni
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id: test.php,v 1.8 2007/09/04 20:25:41 adamfranco Exp $
 */
require_once dirname(__FILE__) . "/../../../../core/utilities/Timer.class.php";
$timer = new Timer();
$timer->start();
$harmonyLoadupTimer = new Timer();
$harmonyLoadupTimer->start();
define("LOAD_HIERARCHY", false);
require_once dirname(__FILE__) . "/../../../../harmoni.inc.php";
$harmonyLoadupTimer->end();
require_once SIMPLE_TEST . 'simple_unit.php';
require_once SIMPLE_TEST . 'dobo_simple_html_test.php';
$context = new OsidContext();
$configuration = new ConfigurationProperties();
Services::startManagerAsService("DatabaseManager");
require_once HARMONI . "errorHandler/ErrorHandler.class.php";
$errorHandler = Services::getService("ErrorHandler", true);
$dbHandler = Services::getService("DBHandler", true);
$dbIndex = $dbHandler->addDatabase(new MySQLDatabase("devo", "doboHarmoniTest", "test", "test"));
$dbHandler->pConnect($dbIndex);
$configuration->addProperty('database_index', $dbIndex);
$configuration->addProperty('database_name', $arg0 = "doboHarmoniTest");
unset($arg0);
Services::startManagerAsService("IdManager", $context, $configuration);
$errorHandler->setDebugMode(TRUE);
$test = new GroupTest('Hierarchy Tests');
$test->addTestFile(HARMONI . '/oki2/hierarchy/tests/NodeTestCase.class.php');
$test->addTestFile(HARMONI . '/oki2/hierarchy/tests/HierarchyTestCase.class.php');
$test->addTestFile(HARMONI . '/oki2/hierarchy/tests/HierarchyManagerTestCase.class.php');
コード例 #24
0
ファイル: id_default.conf.php プロジェクト: adamfranco/segue
<?php

/**
 * Set up the IdManager as this is required for the ID service
 *
 * USAGE: Copy this file to id.conf.php to set custom values.
 *
 * @package segue.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id: id_default.conf.php,v 1.5 2008/04/21 18:07:35 adamfranco Exp $
 */
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_index', $dbID);
$configuration->addProperty('database_name', $dbName);
// 	$configuration->addProperty('id_prefix', 'dev_id-');
$configuration->addProperty('harmoni_db_name', 'segue_db');
Services::startManagerAsService("IdManager", $context, $configuration);
コード例 #25
0
ファイル: gui_default.conf.php プロジェクト: adamfranco/segue
 *
 * USAGE: Copy this file to gui.conf.php to set custom values.
 *
 * @package segue.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id: gui_default.conf.php,v 1.7 2007/09/21 15:49:24 adamfranco Exp $
 */
require_once HARMONI . 'Gui2/GuiManager.class.php';
require_once MYDIR . '/main/library/Gui2/SiteThemeSource.class.php';
require_once MYDIR . '/main/modules/view/SiteDispatcher.class.php';
// :: GUIManager setup ::
define("LOGO_URL", MYPATH . "/images/logo.gif");
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_index', $dbID);
$configuration->addProperty('database_name', $dbName);
$configuration->addProperty('default_theme', 'RoundedCorners');
$configuration->addProperty('character_set', 'utf-8');
$configuration->addProperty('document_type', 'text/html');
$configuration->addProperty('document_type_definition', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
$configuration->addProperty('xmlns', 'http://www.w3.org/1999/xhtml');
// Enable linked theme CSS
$configuration->addProperty('css_url', $harmoni->request->mkURL('gui2', 'theme_css'));
$configuration->addProperty('css_url_theme_property', 'theme');
// Theme sources
$sources = array();
$sources[] = new Segue_Gui2_SiteThemeSource(array('database_index' => $dbID));
// Read-only themes
$sources[] = array('type' => 'directory', 'path' => MYDIR . '/themes-dist');
コード例 #26
0
<?php

/**
 * Set up the RepositoryManager
 *
 * USAGE: Copy this file to repository.conf.php to set custom values.
 *
 * @package segue.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id: repository_default.conf.php,v 1.6 2007/09/04 18:00:43 adamfranco Exp $
 */
// :: Set up the RepositoryManager ::
$repositoryHierarchyId = "edu.middlebury.authorization.hierarchy";
$defaultParentId = "edu.middlebury.repositories_root";
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_index', $dbID);
$configuration->addProperty('hierarchy_id', $repositoryHierarchyId);
$configuration->addProperty('default_parent_id', $defaultParentId);
$configuration->addProperty('version_control_all', $arg2 = TRUE);
$configuration->addProperty('use_filesystem_for_files', $arg3 = FALSE);
// 	$configuration->addProperty('file_data_path', $arg4 = MYPATH."/../segue_data");
Services::startManagerAsService("RepositoryManager", $context, $configuration);
unset($arg0, $arg1, $arg2, $arg3, $arg4);
コード例 #27
0
<?php

/**
 * Set up the AgentManager
 *
 * USAGE: Copy this file to agent.conf.php to set custom values.
 *
 * @package concerto.config
 * 
 * @copyright Copyright &copy; 2005, Middlebury College
 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
 *
 * @version $Id$
 */
// :: Set up the AgentManager ::
$configuration = new ConfigurationProperties();
// default agent Flavor is one that can be editted
$agentFlavor = "HarmoniEditableAgent";
$agentHierarchyId = "edu.middlebury.authorization.hierarchy";
$configuration->addProperty('hierarchy_id', $agentHierarchyId);
$configuration->addProperty('defaultAgentFlavor', $agentFlavor);
$configuration->addProperty('database_index', $dbID);
$configuration->addProperty('database_name', $dbName);
Services::startManagerAsService("AgentManager", $context, $configuration);
// :: Set up PropertyManager ::
//the property manager operates in the same context as the AgentManager and is more or less an adjunct to it
$configuration->addProperty('database_index', $dbID);
$configuration->addProperty('database_name', $dbName);
Services::startManagerAsService("PropertyManager", $context, $configuration);
コード例 #28
0
// 	define("LOGO_URL", MYPATH."/themes/SimpleThemeWhite/images/logo.gif");
//
// 	$configuration = new ConfigurationProperties;
// 	$configuration->addProperty('database_index', $dbID);
// 	$configuration->addProperty('database_name', $dbName);
// 	$configuration->addProperty('default_theme', new SimpleThemeWhite);
// 	$configuration->addProperty('character_set', $arg0 = 'utf-8');
// 	$configuration->addProperty('document_type', $arg1 = 'text/html');
// 	$configuration->addProperty('document_type_definition', $arg2 = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
// 	unset($arg0, $arg1, $arg2);
// 	Services::startManagerAsService("GUIManager", $context, $configuration);
require_once HARMONI . "GUIManager/Themes/GenericTheme.class.php";
require_once HARMONI . "GUIManager/Themes/SimpleTheme.class.php";
require_once HARMONI . "GUIManager/Themes/SimpleTheme1.class.php";
require_once HARMONI . "GUIManager/Themes/SimpleLinesTheme.class.php";
require_once dirname(__FILE__) . "/../themes/SimpleThemeBlack/SimpleThemeBlack.class.php";
define("LOGO_URL", MYPATH . "/themes/SimpleThemeBlack/images/logo.gif");
$configuration = new ConfigurationProperties();
$configuration->addProperty('database_index', $dbID);
$configuration->addProperty('database_name', $dbName);
$configuration->addProperty('default_theme', new SimpleThemeBlack());
$configuration->addProperty('character_set', 'utf-8');
$configuration->addProperty('document_type', 'text/html');
$configuration->addProperty('document_type_definition', '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
$configuration->addProperty('xmlns', 'http://www.w3.org/1999/xhtml');
$arrayOfThemes[] = array("Generic Theme", "GenericTheme");
$arrayOfThemes[] = array("Simple Theme", "SimpleTheme");
$arrayOfThemes[] = array("Simple Lines Theme", "SimpleLinesTheme");
$arrayOfThemes[] = array("Simple Black Theme", "SimpleThemeBlack");
$configuration->addProperty('array_of_default_themes', $arrayOfThemes);
Services::startManagerAsService("GUIManager", $context, $configuration);