aboutsummaryrefslogtreecommitdiffstats
path: root/ws.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-02-06 01:02:06 +0000
committerrvelices <rv-github@modusoptimus.com>2007-02-06 01:02:06 +0000
commitdd339aa6c50267337e786e9e20811b535edd985b (patch)
treef541a88da4289f24b97a2aa430fd4f05e7be4d97 /ws.php
parent01be744d0716119e993a0d9798534fd3f53e5fff (diff)
web services:
- respect conf['allow_web_services'] - added conf['ws_max_images_per_page'] to limit the number of images returned per web call - fixes for Vincent's partners - added comments git-svn-id: http://piwigo.org/svn/trunk@1781 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--ws.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/ws.php b/ws.php
index 2b5d636f4..a196d49e0 100644
--- a/ws.php
+++ b/ws.php
@@ -29,12 +29,18 @@ define ('PHPWG_ROOT_PATH', './');
include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
include_once(PHPWG_ROOT_PATH.'include/ws_core.inc.php');
+if ( !$conf['allow_web_services'] )
+{
+ page_forbidden('Web services are disabled');
+}
+
/**
* event handler that registers standard methods with the web service
*/
function ws_addDefaultMethods( $arr )
{
include_once(PHPWG_ROOT_PATH.'include/ws_functions.inc.php');
+ global $conf;
$service = &$arr[0];
$service->addMethod('pwg.getVersion', 'ws_getVersion', null,
'retrieves the PWG version');
@@ -43,7 +49,7 @@ function ws_addDefaultMethods( $arr )
array(
'cat_id'=>array('default'=>0, 'flags'=>WS_PARAM_FORCE_ARRAY),
'recursive'=>array('default'=>false),
- 'per_page' => array('default'=>100),
+ 'per_page' => array('default'=>100, 'maxValue'=>$conf['ws_max_images_per_page']),
'page' => array('default'=>0),
'order' => array('default'=>null),
'f_min_rate' => array( 'default'=> null ),
@@ -90,7 +96,7 @@ function ws_addDefaultMethods( $arr )
'tag_url_name'=>array('default'=>null, 'flags'=>WS_PARAM_FORCE_ARRAY ),
'tag_name'=>array('default'=>null, 'flags'=>WS_PARAM_FORCE_ARRAY ),
'tag_mode_and'=>array('default'=>false),
- 'per_page' => array('default'=>100),
+ 'per_page' => array('default'=>100, 'maxValue'=>$conf['ws_max_images_per_page']),
'page' => array('default'=>0),
'order' => array('default'=>null),
'f_min_rate' => array( 'default'=> null ),