Blame view

admin/newusers.php 1.49 KB
spelth authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?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);
Frederik Lindenaar authored
15
// Save LDAP configuration when submitted
spelth authored
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
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;

	$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 ?
Frederik Lindenaar authored
44
45
46
47
48
// And build up the form with the new values
$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']);
spelth authored
49
$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
Frederik Lindenaar authored
50
?>