Changeset 25118 for trunk/ws.php


Ignore:
Timestamp:
Oct 24, 2013, 6:21:24 PM (10 years ago)
Author:
mistic100
Message:

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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ws.php

    r25117 r25118  
    708708      'ws_groups_getList',
    709709      array(
    710         'group_id' => array('default'=>null,
    711                             'flags'=>WS_PARAM_FORCE_ARRAY,
     710        'group_id' => array('flags'=>WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
    712711                            'type'=>WS_TYPE_ID),
    713         'name' =>     array('default'=>null,
     712        'name' =>     array('flags'=>WS_PARAM_OPTIONAL,
    714713                            'info'=>'Use "%" as wildcard.'),
    715714        'per_page' => array('default'=>100,
     
    756755      array(
    757756        'group_id' =>   array('type'=>WS_TYPE_ID),
    758         'name' =>       array('default'=>null),
    759         'is_default' => array('default'=>null,
     757        'name' =>       array('flags'=>WS_PARAM_OPTIONAL),
     758        'is_default' => array('flags'=>WS_PARAM_OPTIONAL,
    760759                              'type'=>WS_TYPE_BOOL),
    761760        ),
     
    795794      'ws_users_getList',
    796795      array(
    797         'user_id' =>    array('default'=>null,
    798                               'flags'=>WS_PARAM_FORCE_ARRAY,
     796        'user_id' =>    array('flags'=>WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
    799797                              'type'=>WS_TYPE_ID),
    800         'username' =>   array('default'=>null,
     798        'username' =>   array('flags'=>WS_PARAM_OPTIONAL,
    801799                              'info'=>'Use "%" as wildcard.'),
    802         'status' =>     array('default'=>null,
    803                               'flags'=>WS_PARAM_FORCE_ARRAY,
     800        'status' =>     array('flags'=>WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
    804801                              'info'=>'guest,generic,normal,admin,webmaster'),
    805802        'min_level' =>  array('default'=>0,
    806803                              'maxValue'=>max($conf['available_permission_levels']),
    807804                              'type'=>WS_TYPE_INT|WS_TYPE_POSITIVE),
    808         'group_id' =>   array('default'=>null,
    809                               'flags'=>WS_PARAM_FORCE_ARRAY,
     805        'group_id' =>   array('flags'=>WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
    810806                              'type'=>WS_TYPE_ID),
    811807        'per_page' =>   array('default'=>100,
     
    852848      array(
    853849        'user_id' =>  array('type'=>WS_TYPE_ID),
    854         'username' => array('default'=>null),
    855         'password' => array('default'=>null),
    856         'email' =>    array('default'=>null),
     850        'username' => array('flags'=>WS_PARAM_OPTIONAL),
     851        'password' => array('flags'=>WS_PARAM_OPTIONAL),
     852        'email' =>    array('flags'=>WS_PARAM_OPTIONAL),
     853        'status' =>   array('flags'=>WS_PARAM_OPTIONAL,
     854                            'info'=>'generic,normal,admin'),
     855        'level'=>     array('flags'=>WS_PARAM_OPTIONAL,
     856                            'maxValue'=>max($conf['available_permission_levels']),
     857                            'type'=>WS_TYPE_INT|WS_TYPE_POSITIVE),
    857858        ),
    858859      '<b>Admin & POST only.</b> Updates a user. Leave a field blank to keep the current value.',
Note: See TracChangeset for help on using the changeset viewer.