summaryrefslogtreecommitdiffstats
path: root/ipa-server/xmlrpc-server
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2007-11-13 13:06:18 -0500
committerJohn Dennis <jdennis@redhat.com>2007-11-13 13:06:18 -0500
commit152f8e33928d9222257a272fb573aa9ce7d37578 (patch)
treec646bddf3b3c1031b5838b2cebe439f34d79b0f0 /ipa-server/xmlrpc-server
parentf36872383c51da0453d5387e0e1180ba47e19649 (diff)
parent24d5777bd682636b36b96193c2ec2c8bcb6f684f (diff)
downloadfreeipa-152f8e33928d9222257a272fb573aa9ce7d37578.tar.gz
freeipa-152f8e33928d9222257a272fb573aa9ce7d37578.tar.xz
freeipa-152f8e33928d9222257a272fb573aa9ce7d37578.zip
checkpoint radius client work
Diffstat (limited to 'ipa-server/xmlrpc-server')
-rw-r--r--ipa-server/xmlrpc-server/funcs.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py
index 6fdaaca5..8169b446 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."""