Skip to content

Commit 1aaade0

Browse files
mikoscmadmin
miko
authored and
scmadmin
committed
includes/default_variables.php:
# BitKeeper file /home/ddf/xaraya.com/miko/clone/authldap/includes/default_variables.php xaradmin/manuallysyncgroups.php: # BitKeeper file /home/ddf/xaraya.com/miko/clone/authldap/xaradmin/manuallysyncgroups.php xaradminapi/syncgroups.php: # BitKeeper file /home/ddf/xaraya.com/miko/clone/authldap/xaradminapi/syncgroups.php xartables.php: # BitKeeper file /home/ddf/xaraya.com/miko/clone/authldap/xartables.php xartemplates/admin-manuallysyncgroups.xd: # BitKeeper file /home/ddf/xaraya.com/miko/clone/authldap/xartemplates/admin-manuallysyncgroups.xd xaradmin/modifyconfig.php: # add support for ldap groups xaradmin/updateconfig.php: # add support for ldap groups xaradminapi/getmenulinks.php: # add support for ldap groups xarinit.php: # add support for ldap groups xartemplates/admin-main.xd: # add support for ldap groups xartemplates/admin-modifyconfig.xd: # add support for ldap groups xarversion.php: # add support for ldap groups BitKeeper/etc/logging_ok: # Logging to logging@openlogging.org accepted
1 parent 3245d0a commit 1aaade0

13 files changed

+690
-55
lines changed

BitKeeper/etc/logging_ok

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ mikespub@sasquatch.pulpcontent.com
102102
mikespub@someone.bru.fsc.net
103103
miko@chris-dudleys-computer.local
104104
miko@miko.homelinux.org
105+
miko@newton.xaraya.com
105106
miko@power.dudleynet
106107
miko@server.(none)
107108
miko@xaraya.com

includes/default_variables.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?
2+
$default_groups_variables
3+
= Array('defaultgroup4groups_id' => 1, // Xaraya group ID to attach LDAP groups to (1 = tree root)
4+
'ldap_groups_to_import' => '', // Comma-separated list of groups to look for and import
5+
'group_name_attrname' => 'cn', // Attribute name of the group's human-readable name
6+
'group_ref_attrname' => 'uniquegroup', // Attribute name that references children groups
7+
'group_ref_attrtype' => 'dn', // Attribute type of children groups references
8+
'user_ref_attrname' => 'uniquemember', // Attribute name that references group members
9+
'user_ref_attrtype' => 'dn', // Attribute type of member references
10+
'ldap_base4groups' => 'ou=memberlist,ou=groups,o=corp.com' // Base of group search
11+
);

xaradmin/manuallysyncgroups.php

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?
2+
/**
3+
* File: $Id: manuallysyncgroups.php,v 1.2 2005/06/23 05:58:53 root Exp $
4+
*
5+
* AuthLDAP
6+
*
7+
* @package authentication
8+
* @copyright (C) 2002 by the Xaraya Development Team.
9+
* @license GPL <http://www.gnu.org/licenses/gpl.html>
10+
* @link http://www.xaraya.com
11+
*
12+
* @subpackage authldap
13+
* @author Chris Dudley <miko@xaraya.com> | Richard Cave <rcave@xaraya.com> | Sylvain Beucler <beuc@beuc.net>
14+
*/
15+
16+
/**
17+
* Calls the groups synchronization On Demand (tm), rather than
18+
* waiting for the cron job.
19+
*/
20+
function authldap_admin_manuallysyncgroups()
21+
{
22+
// Security check
23+
if(!xarSecurityCheck('AdminAuthLDAP')) return false;
24+
25+
$success = xarModAPIFunc('authldap', 'admin', 'syncgroups', array());
26+
return array('success' => $success);
27+
}
28+
?>

xaradmin/modifyconfig.php

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* File: $Id$
3+
* File: $Id: modifyconfig.php,v 1.1 2005/06/23 05:58:58 root Exp $
44
*
55
* AuthLDAP Administrative Display Functions
66
*
@@ -12,6 +12,7 @@
1212
* @subpackage authldap
1313
* @author Chris Dudley <miko@xaraya.com>
1414
* @author Richard Cave <rcave@xaraya.com>
15+
* @author Sylvain Beucler <beuc@beuc.net>
1516
*/
1617

1718
/**
@@ -92,13 +93,20 @@ function authldap_admin_modifyconfig()
9293
// Get the list of groups
9394
if (!$groupRoles = xarGetGroups()) return; // throw back
9495

95-
$i = 0;
96-
while (list($key,$group) = each($groupRoles)) {
97-
$groups[$i]['name'] = xarVarPrepForDisplay($group['name']);
98-
$i++;
96+
$group = array();
97+
foreach ($groupRoles as $group) {
98+
$groups[] = array('name' => xarVarPrepForDisplay($group['name']),
99+
'id' => $group['uid']);
99100
}
100101
$data['groups'] = $groups;
101-
102+
103+
104+
/** LDAP Groups parameters **/
105+
106+
include_once('modules/authldap/includes/default_variables.php');
107+
foreach(array_keys($default_groups_variables) as $variable)
108+
$data[$variable] = xarVarPrepForDisplay(xarModGetVar('authldap', $variable));
109+
102110
// everything else happens in Template for now
103111
return $data;
104112
}

xaradmin/updateconfig.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* File: $Id$
3+
* File: $Id: updateconfig.php,v 1.1 2005/06/23 05:59:02 root Exp $
44
*
55
* AuthLDAP Administrative Display Functions
66
*
@@ -10,7 +10,9 @@
1010
* @link http://www.xaraya.com
1111
*
1212
* @subpackage authldap
13-
* @author Chris Dudley <miko@xaraya.com> | Richard Cave <rcave@xaraya.com>
13+
* @author Chris Dudley <miko@xaraya.com>
14+
* @author Richard Cave <rcave@xaraya.com>
15+
* @author Sylvain Beucler <beuc@beuc.net>
1416
*/
1517

1618
/**
@@ -131,6 +133,13 @@ function authldap_admin_updateconfig()
131133
}
132134
xarModSetVar('authldap', 'defaultgroup', $defaultgroup);
133135

136+
137+
// Groups variables
138+
include_once('modules/authldap/includes/default_variables.php');
139+
foreach (array_keys($default_groups_variables) as $variable)
140+
xarModSetVar('authldap', $variable, xarVarCleanFromInput($variable));
141+
142+
134143
$authmodules = xarConfigGetVar('Site.User.AuthenticationModules');
135144
if (empty($activate) && in_array('authldap', $authmodules)) {
136145
$newauth = array();

xaradminapi/getmenulinks.php

+18-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* File: $Id$
3+
* File: $Id: getmenulinks.php,v 1.1 2005/06/23 05:57:00 root Exp $
44
*
55
* AuthLDAP Administrative Display Functions
66
*
@@ -22,18 +22,22 @@
2222
*/
2323
function authldap_adminapi_getmenulinks()
2424
{
25-
// Security check
26-
if(xarSecurityCheck('AdminAuthLDAP')) {
27-
$menulinks[] = Array('url' => xarModURL('authldap',
28-
'admin',
29-
'modifyconfig'),
30-
'title' => xarML('Modify the configuration for the module'),
31-
'label' => xarML('Modify Config'));
32-
} else {
33-
$menulinks = '';
34-
}
35-
36-
return $menulinks;
25+
// Security check
26+
if(xarSecurityCheck('AdminAuthLDAP')) {
27+
$menulinks[] = Array('url' => xarModURL('authldap',
28+
'admin',
29+
'modifyconfig'),
30+
'title' => xarML('Modify the configuration for the module'),
31+
'label' => xarML('Modify Config'));
32+
$menulinks[] = Array('url' => xarModURL('authldap',
33+
'admin',
34+
'manuallysyncgroups'),
35+
'title' => xarML('Forces group synchronization with LDAP'),
36+
'label' => xarML('Manually Sync Groups'));
37+
} else {
38+
$menulinks = '';
39+
}
40+
41+
return $menulinks;
3742
}
38-
3943
?>

0 commit comments

Comments
 (0)