From 67d18edbbae6950794ce4ae4ae75fbfb560416c4 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Tue, 5 Apr 2011 13:10:52 +0000 Subject: ws_getInfos is restricted to admins git-svn-id: http://piwigo.org/svn/trunk@10061 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/ws_functions.inc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php index b69da5826..a0982becb 100644 --- a/include/ws_functions.inc.php +++ b/include/ws_functions.inc.php @@ -186,12 +186,12 @@ function ws_getVersion($params, &$service) */ function ws_getInfos($params, &$service) { - global $conf; - - if ($conf['show_version'] or is_admin()) + if (!is_admin()) { - $infos['version'] = PHPWG_VERSION; + return new PwgError(403, 'Forbidden'); } + + $infos['version'] = PHPWG_VERSION; $query = 'SELECT COUNT(*) FROM '.IMAGES_TABLE.';'; list($infos['nb_elements']) = pwg_db_fetch_row(pwg_query($query)); @@ -231,7 +231,7 @@ function ws_getInfos($params, &$service) } // unvalidated comments - if ($infos['nb_comments'] > 0 and is_admin()) + if ($infos['nb_comments'] > 0) { $query = 'SELECT COUNT(*) FROM '.COMMENTS_TABLE.' WHERE validated=\'false\';'; list($infos['nb_unvalidated_comments']) = pwg_db_fetch_row(pwg_query($query)); -- cgit v1.2.3