aboutsummaryrefslogtreecommitdiffstats
path: root/ws.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2013-10-24 16:21:24 +0000
committermistic100 <mistic@piwigo.org>2013-10-24 16:21:24 +0000
commit4445af121701cedb3e9050b43ae2f769ddc0e01d (patch)
tree32f8755cd2670627259febf80f1d4652ccce99d7 /ws.php
parent757fe9a8215d7a9746b76668ea81d03d774d9f17 (diff)
feature 2976: can change user status and level
fix saving problem of groups.is_default value use WS_PARAM_OPTIONAL when possible (TODO: use for old methods) git-svn-id: http://piwigo.org/svn/trunk@25118 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'ws.php')
-rw-r--r--ws.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/ws.php b/ws.php
index 01b2ecf02..2ae44a5bf 100644
--- a/ws.php
+++ b/ws.php
@@ -707,10 +707,9 @@ function ws_addDefaultMethods( $arr )
'pwg.groups.getList',
'ws_groups_getList',
array(
- 'group_id' => array('default'=>null,
- 'flags'=>WS_PARAM_FORCE_ARRAY,
+ 'group_id' => array('flags'=>WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
'type'=>WS_TYPE_ID),
- 'name' => array('default'=>null,
+ 'name' => array('flags'=>WS_PARAM_OPTIONAL,
'info'=>'Use "%" as wildcard.'),
'per_page' => array('default'=>100,
'maxValue'=>$conf['ws_max_users_per_page'],
@@ -755,8 +754,8 @@ function ws_addDefaultMethods( $arr )
'ws_groups_setInfo',
array(
'group_id' => array('type'=>WS_TYPE_ID),
- 'name' => array('default'=>null),
- 'is_default' => array('default'=>null,
+ 'name' => array('flags'=>WS_PARAM_OPTIONAL),
+ 'is_default' => array('flags'=>WS_PARAM_OPTIONAL,
'type'=>WS_TYPE_BOOL),
),
'<b>Admin & POST only.</b> Updates a group. Leave a field blank to keep the current value.',
@@ -794,19 +793,16 @@ function ws_addDefaultMethods( $arr )
'pwg.users.getList',
'ws_users_getList',
array(
- 'user_id' => array('default'=>null,
- 'flags'=>WS_PARAM_FORCE_ARRAY,
+ 'user_id' => array('flags'=>WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
'type'=>WS_TYPE_ID),
- 'username' => array('default'=>null,
+ 'username' => array('flags'=>WS_PARAM_OPTIONAL,
'info'=>'Use "%" as wildcard.'),
- 'status' => array('default'=>null,
- 'flags'=>WS_PARAM_FORCE_ARRAY,
+ 'status' => array('flags'=>WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
'info'=>'guest,generic,normal,admin,webmaster'),
'min_level' => array('default'=>0,
'maxValue'=>max($conf['available_permission_levels']),
'type'=>WS_TYPE_INT|WS_TYPE_POSITIVE),
- 'group_id' => array('default'=>null,
- 'flags'=>WS_PARAM_FORCE_ARRAY,
+ 'group_id' => array('flags'=>WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
'type'=>WS_TYPE_ID),
'per_page' => array('default'=>100,
'maxValue'=>$conf['ws_max_users_per_page'],
@@ -851,9 +847,14 @@ function ws_addDefaultMethods( $arr )
'ws_users_setInfo',
array(
'user_id' => array('type'=>WS_TYPE_ID),
- 'username' => array('default'=>null),
- 'password' => array('default'=>null),
- 'email' => array('default'=>null),
+ 'username' => array('flags'=>WS_PARAM_OPTIONAL),
+ 'password' => array('flags'=>WS_PARAM_OPTIONAL),
+ 'email' => array('flags'=>WS_PARAM_OPTIONAL),
+ 'status' => array('flags'=>WS_PARAM_OPTIONAL,
+ 'info'=>'generic,normal,admin'),
+ 'level'=> array('flags'=>WS_PARAM_OPTIONAL,
+ 'maxValue'=>max($conf['available_permission_levels']),
+ 'type'=>WS_TYPE_INT|WS_TYPE_POSITIVE),
),
'<b>Admin & POST only.</b> Updates a user. Leave a field blank to keep the current value.',
null,