source: extensions/Ldap_Login/admin/newusers.php @ 27036

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

version 1.0.1

add main function : ability to add new piwigo users when ldap is successful.
add danish language, must be reviewed

this version is not yet considered stable, as needed to be reviewed and commented by beta-testers

File size: 1.5 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
19if (isset($_POST['save'])){
20
21        if (isset($_POST['ALLOW_NEWUSERS'])){
22                $me->config['allow_newusers'] = True;
23        } else {
24                $me->config['allow_newusers'] = False;
25        }
26       
27        if (isset($_POST['ADVERTISE_ADMINS'])){
28                $me->config['advertise_admin_new_ldapuser'] = True;
29        } else {
30                $me->config['advertise_admin_new_ldapuser'] = False;
31        }
32       
33        if (isset($_POST['SEND_CASUAL_MAIL'])){
34                $me->config['send_password_by_mail_ldap'] = True;
35        } else {
36                $me->config['send_password_by_mail_ldap'] = False;
37        }
38}
39
40// Save LDAP configuration
41if (isset($_POST['save'])){
42        $me->save_config();
43}
44
45// do we allow to create new piwigo users in case of auth along the ldap ?
46// does he have to belong an ldap group ?
47// does ldap groups give some power ?
48// what do we do when there's no mail in the ldap ?
49// do we send mail to admins ?
50
51$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
52?>
Note: See TracBrowser for help on using the repository browser.