本文整理汇总了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');
}