aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2008-09-24 21:30:33 +0000
committerplegall <plg@piwigo.org>2008-09-24 21:30:33 +0000
commit5adad7565c9c169dd623bac6704121f7d6aba151 (patch)
tree7e944e6961dfaf736adcb2403e0b14f0e46b1a28 /include
parent6df515a54ff63812076dfbf8dc6514fa9416b08a (diff)
new: WebService method pwg.tags.getAdminList was added. The difference with
pwg.tags.getList is that this new method doesn't take permissions into account, and so is available only for administrator connected users. git-svn-id: http://piwigo.org/svn/trunk@2584 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/ws_functions.inc.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index 203367356..0e4b1a8c2 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -1192,6 +1192,33 @@ function ws_tags_getList($params, &$service)
return array('tags' => new PwgNamedArray($tags, 'tag', array('id','url_name','url', 'counter' )) );
}
+/**
+ * returns the list of tags as you can see them in administration (web
+ * service method).
+ *
+ * Only admin can run this method and permissions are not taken into
+ * account.
+ */
+function ws_tags_getAdminList($params, &$service)
+{
+ if (!is_admin())
+ {
+ return new PwgError(401, 'Access denied');
+ }
+
+ $tags = get_all_tags();
+ return array(
+ 'tags' => new PwgNamedArray(
+ $tags,
+ 'tag',
+ array(
+ 'name',
+ 'id',
+ 'url_name',
+ )
+ )
+ );
+}
/**
* returns a list of images for tags (web service method)