Back to index

plone3  3.1.7
Classes | Functions | Variables
GroupUserFolder.LDAPGroupFolder Namespace Reference

Classes

class  LDAPGroupFolder
class  GroupUser

Functions

def manage_addLDAPGroupFolder

Variables

string __version__ = "$Revision: $"
 GroupUserFolder Copyright (C)2006 Ingeniweb.
string __docformat__ = 'restructuredtext'
tuple addLDAPGroupFolderForm = DTMLFile('dtml/addLDAPGroupFolder', globals())
list role_dns = []
 if name in self.aq_parent.valid_roles():

This is, in fact, a role

self.getLUF().manage_addGroupMapping(name, name) else:

This is a group -> we set it as a group

self.getLUF().manage_addGroupMapping(name, self.getGroupPrefix() + name)
tuple all_groups = luf.getGroups()
tuple all_roles = luf.valid_roles()
dictionary groups = {}
list role = role[GROUP_PREFIX_LEN:]
tuple r = groups.get(role, None)

Function Documentation

def GroupUserFolder.LDAPGroupFolder.manage_addLDAPGroupFolder (   self,
  title = '',
  luf = '',
  REQUEST = None 
)

Definition at line 349 of file LDAPGroupFolder.py.

00349 
00350 def manage_addLDAPGroupFolder( self, title = '', luf='', REQUEST=None):
00351     """ """
00352     this_folder = self.this()
00353 
00354     if hasattr(aq_base(this_folder), 'acl_users') and REQUEST is not None:
00355         msg = 'This+object+already+contains+a+User+Folder'
00356 
00357     else:
00358         # Try to guess where is LUF
00359         if not luf:
00360             for src in this_folder.listUserSources():
00361                 if src.meta_type == "LDAPUserFolder":
00362                     luf = src.aq_parent.getId()
00363 
00364         # No LUF found : error
00365         if not luf:
00366             raise KeyError, "You must be within GRUF with a LDAPUserFolder as one of your user sources."
00367             
00368         n = LDAPGroupFolder( title, luf )
00369 
00370         this_folder._setObject('acl_users', n)
00371         this_folder.__allow_groups__ = self.acl_users
00372         
00373         msg = 'Added+LDAPGroupFolder'
00374  
00375     # return to the parent object's manage_main
00376     if REQUEST:
00377         url = REQUEST['URL1']
00378         qs = 'manage_tabs_message=%s' % msg
00379         REQUEST.RESPONSE.redirect('%s/manage_main?%s' % (url, qs))
00380 
00381 
00382 InitializeClass(LDAPGroupFolder)
00383 


Variable Documentation

string GroupUserFolder.LDAPGroupFolder.__docformat__ = 'restructuredtext'

Definition at line 24 of file LDAPGroupFolder.py.

GroupUserFolder Copyright (C)2006 Ingeniweb.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Definition at line 21 of file LDAPGroupFolder.py.

tuple GroupUserFolder.LDAPGroupFolder.addLDAPGroupFolderForm = DTMLFile('dtml/addLDAPGroupFolder', globals())

Definition at line 45 of file LDAPGroupFolder.py.

Definition at line 316 of file LDAPGroupFolder.py.

tuple GroupUserFolder.LDAPGroupFolder.all_roles = luf.valid_roles()

Definition at line 317 of file LDAPGroupFolder.py.

Definition at line 318 of file LDAPGroupFolder.py.

tuple GroupUserFolder.LDAPGroupFolder.r = groups.get(role, None)

Definition at line 338 of file LDAPGroupFolder.py.

list GroupUserFolder.LDAPGroupFolder.role = role[GROUP_PREFIX_LEN:]

Definition at line 335 of file LDAPGroupFolder.py.

if name in self.aq_parent.valid_roles():

This is, in fact, a role

self.getLUF().manage_addGroupMapping(name, name) else:

This is a group -> we set it as a group

self.getLUF().manage_addGroupMapping(name, self.getGroupPrefix() + name)

Definition at line 315 of file LDAPGroupFolder.py.