本文整理汇总了PHP中Setup::setDefaults方法的典型用法代码示例。如果您正苦于以下问题:PHP Setup::setDefaults方法的具体用法?PHP Setup::setDefaults怎么用?PHP Setup::setDefaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setup
的用法示例。
在下文中一共展示了Setup::setDefaults方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_REPORTER) {
Misc::setMessage('Sorry, you are not allowed to access this page.', Misc::MSG_ERROR);
$tpl->displayTemplate();
exit;
}
if (@$_POST['cat'] == 'update') {
$setup['host'] = $_POST['host'];
$setup['port'] = $_POST['port'];
$setup['binddn'] = $_POST['binddn'];
$setup['bindpw'] = $_POST['bindpw'];
$setup['basedn'] = $_POST['basedn'];
$setup['userdn'] = $_POST['userdn'];
$setup['user_filter'] = $_POST['user_filter'];
$setup['customer_id_attribute'] = $_POST['customer_id_attribute'];
$setup['contact_id_attribute'] = $_POST['contact_id_attribute'];
$setup['create_users'] = $_POST['create_users'];
$setup['default_role'] = $_POST['default_role'];
$res = Setup::save(array('ldap' => $setup));
Misc::mapMessages($res, array(1 => array('Thank you, the setup information was saved successfully.', Misc::MSG_INFO), -1 => array("ERROR: The system doesn't have the appropriate permissions to create the configuration file\n in the setup directory (" . APP_CONFIG_PATH . '). Please contact your local system
administrator and ask for write privileges on the provided path.', Misc::MSG_HTML_BOX), -2 => array("ERROR: The system doesn't have the appropriate permissions to update the configuration file\n in the setup directory (" . APP_CONFIG_PATH . '/ldap.php). Please contact your local system
administrator and ask for write privileges on the provided filename.', Misc::MSG_HTML_BOX)));
$tpl->assign('result', $res);
}
$setup = Setup::setDefaults('ldap', LDAP_Auth_Backend::getDefaults());
$tpl->assign('setup', $setup);
$tpl->assign('project_list', Project::getAll());
$tpl->assign('project_roles', array(0 => 'No Access') + User::getRoles());
$tpl->assign('user_roles', User::getRoles(array('Customer')));
$tpl->displayTemplate();