From 9f8068d2077ef7add4108b4a8593764a39518d8d Mon Sep 17 00:00:00 2001 From: Mohamed Amine BERGAOUI Date: Tue, 30 Jul 2013 11:21:18 +0200 Subject: moving ACL remote functions to the ACL plugin --- lib/plugins/acl/remote.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/plugins/acl/remote.php (limited to 'lib/plugins/acl') diff --git a/lib/plugins/acl/remote.php b/lib/plugins/acl/remote.php new file mode 100644 index 000000000..8210e5414 --- /dev/null +++ b/lib/plugins/acl/remote.php @@ -0,0 +1,32 @@ + array( + 'args' => array('string','string','int'), + 'return' => 'int', + 'name' => 'addAcl', + 'doc' => 'Adds a new ACL rule.' + ), 'plugin.delAcl' => array( + 'args' => array('string','string'), + 'return' => 'int', + 'name' => 'delAcl', + 'doc' => 'Delete an existing ACL rule.' + ), + ); + } + + + function addAcl($scope, $user, $level){ + $apa = new admin_plugin_acl(); + return $apa->_acl_add($scope, $user, $level); + } + + function delAcl($scope, $user){ + $apa = new admin_plugin_acl(); + return $apa->_acl_del($scope, $user); + } +} + +?> -- cgit v1.2.3 From 1b7fc214a838c5f460f865cc7712364a8ec8f3e7 Mon Sep 17 00:00:00 2001 From: Mohamed Amine BERGAOUI Date: Tue, 30 Jul 2013 12:03:23 +0200 Subject: corrected coding style, deleted ?>, renamed function keys and used plugin_load --- lib/plugins/acl/remote.php | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'lib/plugins/acl') diff --git a/lib/plugins/acl/remote.php b/lib/plugins/acl/remote.php index 8210e5414..8f6dfbcd9 100644 --- a/lib/plugins/acl/remote.php +++ b/lib/plugins/acl/remote.php @@ -1,32 +1,30 @@ array( + 'addAcl' => array( 'args' => array('string','string','int'), 'return' => 'int', 'name' => 'addAcl', 'doc' => 'Adds a new ACL rule.' - ), 'plugin.delAcl' => array( + ), 'delAcl' => array( 'args' => array('string','string'), 'return' => 'int', 'name' => 'delAcl', 'doc' => 'Delete an existing ACL rule.' - ), + ), ); } - - function addAcl($scope, $user, $level){ - $apa = new admin_plugin_acl(); - return $apa->_acl_add($scope, $user, $level); - } + function addAcl($scope, $user, $level){ + $apa = plugin_load('admin', 'acl'); + return $apa->_acl_add($scope, $user, $level); + } - function delAcl($scope, $user){ - $apa = new admin_plugin_acl(); - return $apa->_acl_del($scope, $user); - } + function delAcl($scope, $user){ + $apa = plugin_load('admin', 'acl'); + return $apa->_acl_del($scope, $user); + } } -?> -- cgit v1.2.3