newusers.php
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
global $template;
$template->set_filenames( array('plugin_admin_content' => dirname(__FILE__).'/newusers.tpl') );
$template->assign(
array(
'PLUGIN_NEWUSERS' => get_root_url().'admin.php?page=plugin-Ldap_Login-newusers',
));
$me = new Ldap();
$me->load_config();
//$me = get_plugin_data($plugin_id);
$template->assign('ALLOW_NEWUSERS', $me->config['allow_newusers']);
$template->assign('ADVERTISE_ADMINS', $me->config['advertise_admin_new_ldapuser']);
$template->assign('SEND_CASUAL_MAIL', $me->config['send_password_by_mail_ldap']);
if (isset($_POST['save'])){
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();
}
// do we allow to create new piwigo users in case of auth along the ldap ?
// does he have to belong an ldap group ?
// does ldap groups give some power ?
// what do we do when there's no mail in the ldap ?
// do we send mail to admins ?
$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
?>