本文整理汇总了PHP中Ldap::save_config方法的典型用法代码示例。如果您正苦于以下问题:PHP Ldap::save_config方法的具体用法?PHP Ldap::save_config怎么用?PHP Ldap::save_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ldap
的用法示例。
在下文中一共展示了Ldap::save_config方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
/**
* plugin installation
*
* perform here all needed step for the plugin installation
* such as create default config, add database tables,
* add fields to existing tables, create local folders...
*/
function install($plugin_version, &$errors = array())
{
global $conf;
$config = new Ldap();
if (file_exists(LDAP_LOGIN_PATH . 'data.dat')) {
$config->load_config();
} else {
$config->load_default_config();
}
$config->save_config();
$this->installed = true;
}
示例2:
$template->assign('ALLOW_NEWUSERS', $me->config['allow_newusers']);
// do we send a mail to admins in case of new users ?
$template->assign('ADVERTISE_ADMINS', $me->config['advertise_admin_new_ldapuser']);
// do we send the piwigo (!) password to the mail address provided by ldap ?
$template->assign('SEND_CASUAL_MAIL', $me->config['send_password_by_mail_ldap']);
// Is there a restriction in the ldap users group ?
// Only members of this ldap group can log in !
$template->assign('USERS_GROUP', $me->config['users_group']);
if (isset($_POST['save'])) {
$me->config['users_group'] = $_POST['USERS_GROUP'];
if (isset($_POST['ALLOW_NEWUSERS'])) {
$me->config['allow_newusers'] = True;
} else {
$me->config['allow_newusers'] = False;
}
if (isset($_POST['ADVERTISE_ADMINS'])) {
$me->config['advertise_admin_new_ldapuser'] = True;
} else {
$me->config['advertise_admin_new_ldapuser'] = False;
}
if (isset($_POST['SEND_CASUAL_MAIL'])) {
$me->config['send_password_by_mail_ldap'] = True;
} else {
$me->config['send_password_by_mail_ldap'] = False;
}
}
// Save LDAP configuration
if (isset($_POST['save'])) {
$me->save_config();
}
$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');