source: extensions/Ldap_Login/admin/newusers.php

Last change on this file was 28534, checked in by 22decembre, 10 years ago

add function to sync ldap and piwigo groups
ldap groups correspond to webmasters and admin roles

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