Author: rhafer
Date: Fri Aug 22 11:55:36 2008
New Revision: 50320
URL: http://svn.opensuse.org/viewcvs/yast?rev=50320&view=rev
Log:
Preparing ACL hashes for handover from UI to LdapServer.pm
Modified:
trunk/ldap-server/src/LdapDatabase.ycp
trunk/ldap-server/src/tree_structure.ycp
Modified: trunk/ldap-server/src/LdapDatabase.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapDatabase.ycp?rev=50320&r1=50319&r2=50320&view=diff
==============================================================================
--- trunk/ldap-server/src/LdapDatabase.ycp (original)
+++ trunk/ldap-server/src/LdapDatabase.ycp Fri Aug 22 11:55:36 2008
@@ -519,8 +519,8 @@
map whatId2String = $[
`dn_all : [ _("All Entries"), "*" ],
- `dn_subtree : [ _("All Entries in the subtree"), "dn.subtree" ],
- `dn_base : [ _("The Entry with the DN"), "dn.base" ]
+ `dn_subtree : [ _("All Entries in the subtree"), "subtree" ],
+ `dn_base : [ _("The Entry with the DN"), "base" ]
];
map whoId2String = $[
@@ -948,6 +948,46 @@
return true;
}
+ global list<map> DbAclWrite( integer dbindex )
+ {
+ list<map> outlist = [];
+ foreach( map acl, acllist,
+ {
+ y2milestone( "------------------------------" );
+ y2milestone( "ACL Target: %1", acl["target","what"]:`nil );
+ map targetmap = $[];
+ if ( acl["target","what"]:`dn_all != `dn_all )
+ {
+ map dn = $[
+ "style" : whatId2String[ acl["target","what"]:`dn_base,1 ]:"",
+ "value" : acl["target","dn"]:""
+ ];
+ targetmap["dn"] = dn;
+ }
+ if ( acl["target","filter"]:"" != "" )
+ {
+ targetmap["filter"] = acl["target","filter"]:"";
+ }
+ if ( acl["target","attrs"]:"" != "" )
+ {
+ targetmap["attrs"] = acl["target","attrs"]:"";
+ }
+ y2milestone( "ACL Target: %1", targetmap );
+ list<map> outlist_access = [];
+ foreach( map access, acl["access"]:[],
+ {
+ access["level"] = accessId2String[access["level"]:`nil,1]:"none";
+ access["type"] = whoId2String[access["type"]:`nil,1]:"";
+ y2milestone( "ACL Access: %1", access );
+ outlist_access = add(outlist_access, access );
+ }
+ );
+ outlist = add(outlist, $[ "target" : targetmap, "access" : outlist_access ] );
+ }
+ );
+ return outlist;
+ }
+
global boolean DbAclInput( symbol handler_cmd, integer dbindex )
{
map db = $[];
Modified: trunk/ldap-server/src/tree_structure.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/tree_structure.ycp?rev=50320&r1=50319&r2=50320&view=diff
==============================================================================
--- trunk/ldap-server/src/tree_structure.ycp (original)
+++ trunk/ldap-server/src/tree_structure.ycp Fri Aug 22 11:55:36 2008
@@ -765,6 +765,16 @@
return LdapDatabase::DbAclInput( handler_cmd, index );
}
+define boolean cb_write_acl()
+{
+ y2milestone("cb_write_acl()");
+ string treeItem = current_tree_item;
+ integer index = (integer)widget_map[current_tree_item,"index"]:nil;
+ list<map> changedAcls = LdapDatabase::DbAclWrite( index );
+ y2milestone("Changed ACLs: %1", changedAcls );
+ return true;
+}
+
define boolean cb_input_ppolicy()
{
y2milestone("cb_input_ppolicy()");
@@ -902,6 +912,7 @@
"widget" : LdapDatabase::GetAclWidget(),
"index" : index,
"cb_read" : ``(cb_read_acl() ),
+ "cb_write" : ``(cb_write_acl() ),
"cb_input" : ``(cb_input_acl() )
];
map item_map = $[
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org