diff options
author | John Dennis <jdennis@redhat.com> | 2007-11-13 13:06:18 -0500 |
---|---|---|
committer | John Dennis <jdennis@redhat.com> | 2007-11-13 13:06:18 -0500 |
commit | 152f8e33928d9222257a272fb573aa9ce7d37578 (patch) | |
tree | c646bddf3b3c1031b5838b2cebe439f34d79b0f0 /ipa-server/xmlrpc-server/funcs.py | |
parent | f36872383c51da0453d5387e0e1180ba47e19649 (diff) | |
parent | 24d5777bd682636b36b96193c2ec2c8bcb6f684f (diff) | |
download | freeipa-152f8e33928d9222257a272fb573aa9ce7d37578.tar.gz freeipa-152f8e33928d9222257a272fb573aa9ce7d37578.tar.xz freeipa-152f8e33928d9222257a272fb573aa9ce7d37578.zip |
checkpoint radius client work
Diffstat (limited to 'ipa-server/xmlrpc-server/funcs.py')
-rw-r--r-- | ipa-server/xmlrpc-server/funcs.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py index 6fdaaca51..8169b4463 100644 --- a/ipa-server/xmlrpc-server/funcs.py +++ b/ipa-server/xmlrpc-server/funcs.py @@ -456,6 +456,31 @@ class IPAServer: self.releaseConnection(conn) return res + def add_radius_client (self, client, opts=None): + client_container = 'cn=clients,cn=radius,cn=services,cn=etc' # FIXME, should not be hardcoded + if self.__is_client_unique(client['radiusClientNASIpAddress'], opts) == 0: + raise ipaerror.gen_exception(ipaerror.LDAP_DUPLICATE) + + dn="radiusClientNASIpAddress=%s,%s,%s" % (ldap.dn.escape_dn_chars(client['radiusClientNASIpAddress']), + client_container,self.basedn) + entry = ipaserver.ipaldap.Entry(dn) + + # FIXME: This should be dynamic and can include just about anything + + # some required objectclasses + entry.setValues('objectClass', 'top', 'radiusClientProfile') + + # fill in our new entry with everything sent by the client + for u in client: + entry.setValues(u, client[u]) + + conn = self.getConnection(opts) + try: + res = conn.addEntry(entry) + finally: + self.releaseConnection(conn) + return res + def get_add_schema (self): """Get the list of fields to be used when adding users in the GUI.""" |