本文整理匯總了PHP中Tinebase_User::getBackendConfigurationDefaults方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tinebase_User::getBackendConfigurationDefaults方法的具體用法?PHP Tinebase_User::getBackendConfigurationDefaults怎麽用?PHP Tinebase_User::getBackendConfigurationDefaults使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tinebase_User
的用法示例。
在下文中一共展示了Tinebase_User::getBackendConfigurationDefaults方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetBackendConfigurationDefaults
/**
* get backend cfg defaults
*/
public function testGetBackendConfigurationDefaults()
{
$defaults = Tinebase_User::getBackendConfigurationDefaults();
$this->assertTrue(isset($defaults[Tinebase_User::SQL]) || array_key_exists(Tinebase_User::SQL, $defaults));
$this->assertTrue(isset($defaults[Tinebase_User::LDAP]) || array_key_exists(Tinebase_User::LDAP, $defaults));
$this->assertTrue(is_array($defaults[Tinebase_User::LDAP]));
$this->assertFalse(isset($defaults['host']) || array_key_exists('host', $defaults));
$defaults = Tinebase_User::getBackendConfigurationDefaults(Tinebase_User::LDAP);
$this->assertTrue(isset($defaults['host']) || array_key_exists('host', $defaults));
$this->assertFalse(isset($defaults[Tinebase_User::LDAP]) || array_key_exists(Tinebase_User::LDAP, $defaults));
}
示例2: update_2
/**
* update to 2.3
* - move accounts storage configuration from config.inc.php to config db table
* - changed the way the configuration for default user group name and default admin group name is stored
*
*/
public function update_2()
{
$config = Setup_Controller::getInstance()->getConfigData();
if (!empty($config['accounts'])) {
if (empty($config['accounts']['backend'])) {
$config['accounts']['backend'] = 'Sql';
}
$backendType = ucfirst($config['accounts']['backend']);
Tinebase_User::setBackendType($backendType);
//add default settings
$defaultConfig = Tinebase_User::getBackendConfigurationDefaults($backendType);
Tinebase_User::setBackendConfiguration($defaultConfig);
//override default settings with config.inc.php settings
if (!empty($config['accounts'][$config['accounts']['backend']])) {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Setting config: ' . print_r($config['accounts'][$config['accounts']['backend']], TRUE));
}
Tinebase_User::setBackendConfiguration($config['accounts'][$config['accounts']['backend']]);
}
//delete old config settings from config.inc.php
unset($config['accounts']);
}
$defaultUserGroupName = Tinebase_Config::getInstance()->get('Default User Group', 'Users');
$defaultAdminGroupName = Tinebase_Config::getInstance()->get('Default Admin Group', 'Administrators');
Tinebase_User::setBackendConfiguration($defaultUserGroupName->value, Tinebase_User::DEFAULT_USER_GROUP_NAME_KEY);
Tinebase_User::setBackendConfiguration($defaultAdminGroupName->value, Tinebase_User::DEFAULT_ADMIN_GROUP_NAME_KEY);
//write changes to config table
Tinebase_User::saveBackendConfiguration();
Tinebase_Config::getInstance()->delete('Default User Group');
Tinebase_Config::getInstance()->delete('Default Admin Group');
$this->setApplicationVersion('Tinebase', '2.3');
}