Changeset 25115 for trunk/ws.php


Ignore:
Timestamp:
Oct 24, 2013, 12:01:35 PM (11 years ago)
Author:
mistic100
Message:

two new options for API methods : 'admin_only' and 'post_only'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ws.php

    r25077 r25115  
    136136      'ws_getInfos',
    137137      null,
    138       '<b>Admin only.</b> Returns general informations.'
     138      '<b>Admin only.</b> Returns general informations.',
     139      null,
     140      array('admin_only'=>true)
    139141    );
    140142
     
    146148                           'type'=>WS_TYPE_ID),
    147149        ),
    148       '<b>Admin only.</b> Adds elements to the caddie. Returns the number of elements added.'
     150      '<b>Admin only.</b> Adds elements to the caddie. Returns the number of elements added.',
     151      null,
     152      array('admin_only'=>true)
    149153    );
    150154
     
    205209                                'type'=>WS_TYPE_INT|WS_TYPE_POSITIVE),
    206210        ), $f_params),
    207       '<b>Admin only.</b> Returns a list of derivatives to build.'
     211      '<b>Admin only.</b> Returns a list of derivatives to build.',
     212      null,
     213      array('admin_only'=>true)
    208214    );
    209215
     
    217223        'key' =>      array(),
    218224        ),
    219       '<b>POST only.</b> Adds a comment to an image.'
     225      '<b>POST only.</b> Adds a comment to an image.',
     226      null,
     227      array('post_only'=>true)
    220228    );
    221229
     
    269277                            'type'=>WS_TYPE_INT|WS_TYPE_POSITIVE),
    270278        ),
    271       '<b>Admin & POST only.</b> Sets the privacy levels for the images.'
     279      '<b>Admin & POST only.</b> Sets the privacy levels for the images.',
     280      null,
     281      array('admin_only'=>true, 'post_only'=>true)
    272282    );
    273283
     
    280290        'rank'        => array('type'=>WS_TYPE_INT|WS_TYPE_POSITIVE|WS_TYPE_NOTNULL)
    281291        ),
    282       '<b>Admin & POST only.</b> Sets the rank of a photo for a given album.'
     292      '<b>Admin & POST only.</b> Sets the rank of a photo for a given album.',
     293      null,
     294      array('admin_only'=>true, 'post_only'=>true)
    283295    );
    284296
     
    290302        'anonymous_id' => array('default'=>null),
    291303        ),
    292       '<b>Admin & POST only.</b> Deletes all rates for a user.'
     304      '<b>Admin & POST only.</b> Deletes all rates for a user.',
     305      null,
     306      array('admin_only'=>true, 'post_only'=>true)
    293307    );
    294308
     
    304318      'ws_session_login',
    305319      array('username', 'password'),
    306       '<b>POST only.</b> Tries to login the user.'
     320      '<b>POST only.</b> Tries to login the user.',
     321      null,
     322      array('post_only'=>true)
    307323    );
    308324
     
    358374        'position' =>     array()
    359375        ),
    360       '<b>Admin & POST only.</b> Add a chunk of a file.'
     376      '<b>Admin & POST only.</b> Add a chunk of a file.',
     377      null,
     378      array('admin_only'=>true, 'post_only'=>true)
    361379    );
    362380
     
    371389        ),
    372390      '<b>Admin only.</b> Add or update a file for an existing photo.
    373 <br>pwg.images.addChunk must have been called before (maybe several times).'
     391<br>pwg.images.addChunk must have been called before (maybe several times).',
     392      null,
     393      array('admin_only'=>true)
    374394    );
    375395
     
    402422      '<b>Admin only.</b> Add an image.
    403423<br>pwg.images.addChunk must have been called before (maybe several times).
    404 <br>Don\'t use "thumbnail_sum" and "high_sum", these parameters are here for backward compatibility.'
     424<br>Don\'t use "thumbnail_sum" and "high_sum", these parameters are here for backward compatibility.',
     425      null,
     426      array('admin_only'=>true)
    405427    );
    406428
     
    426448<br>Use the <b>$_FILES[image]</b> field for uploading file.
    427449<br>Set the form encoding to "form-data".
    428 <br>You can update an existing photo if you define an existing image_id.'
     450<br>You can update an existing photo if you define an existing image_id.',
     451      null,
     452      array('admin_only'=>true, 'post_only'=>true)
    429453    );
    430454
     
    436460        'pwg_token' =>  array(),
    437461        ),
    438       '<b>Admin & POST only.</b> Deletes image(s).'
     462      '<b>Admin & POST only.</b> Deletes image(s).',
     463      null,
     464      array('admin_only'=>true, 'post_only'=>true)
    439465    );
    440466
     
    443469      'ws_categories_getAdminList',
    444470      null,
    445       '<b>Admin only.</b>'
     471      '<b>Admin only.</b>',
     472      null,
     473      array('admin_only'=>true)
    446474    );
    447475
     
    474502      '<b>Admin & POST only.</b> Deletes album(s).
    475503<br><b>photo_deletion_mode</b> can be "no_delete" (may create orphan photos), "delete_orphans"
    476 (default mode, only deletes photos linked to no other album) or "force_delete" (delete all photos, even those linked to other albums)'
     504(default mode, only deletes photos linked to no other album) or "force_delete" (delete all photos, even those linked to other albums)',
     505      null,
     506      array('admin_only'=>true, 'post_only'=>true)
    477507    );
    478508
     
    486516        ),
    487517      '<b>Admin & POST only.</b> Move album(s).
    488 <br>Set parent as 0 to move to gallery root. Only virtual categories can be moved.'
     518<br>Set parent as 0 to move to gallery root. Only virtual categories can be moved.',
     519      null,
     520      array('admin_only'=>true, 'post_only'=>true)
    489521    );
    490522
     
    496528        'image_id' =>     array('type'=>WS_TYPE_ID),
    497529        ),
    498       '<b>Admin & POST only.</b> Sets the representative photo for an album. The photo doesn\'t have to belong to the album.'
     530      '<b>Admin & POST only.</b> Sets the representative photo for an album. The photo doesn\'t have to belong to the album.',
     531      null,
     532      array('admin_only'=>true, 'post_only'=>true)
    499533    );
    500534
     
    503537      'ws_tags_getAdminList',
    504538      null,
    505       '<b>Admin only.</b> '
     539      '<b>Admin only.</b>',
     540      null,
     541      array('admin_only'=>true)
    506542    );
    507543
     
    510546      'ws_tags_add',
    511547      array('name'),
    512       '<b>Admin only.</b> Adds a new tag.'
     548      '<b>Admin only.</b> Adds a new tag.',
     549      null,
     550      array('admin_only'=>true)
    513551    );
    514552
     
    521559        ),
    522560      '<b>Admin only.</b>  Checks existence of images.
    523 <br>Give <b>md5sum_list</b> if $conf[uniqueness_mode]==md5sum. Give <b>filename_list</b> if $conf[uniqueness_mode]==filename.'
     561<br>Give <b>md5sum_list</b> if $conf[uniqueness_mode]==md5sum. Give <b>filename_list</b> if $conf[uniqueness_mode]==filename.',
     562      null,
     563      array('admin_only'=>true)
    524564    );
    525565
     
    534574        ),
    535575      '<b>Admin only.</b> Checks if you have updated version of your files for a given photo, the answer can be "missing", "equals" or "differs".
    536 <br>Don\'t use "thumbnail_sum" and "high_sum", these parameters are here for backward compatibility.'
     576<br>Don\'t use "thumbnail_sum" and "high_sum", these parameters are here for backward compatibility.',
     577      null,
     578      array('admin_only'=>true)
    537579    );
    538580
     
    541583      'ws_images_checkUpload',
    542584      null,
    543       '<b>Admin only.</b> Checks if Piwigo is ready for upload.'
     585      '<b>Admin only.</b> Checks if Piwigo is ready for upload.',
     586      null,
     587      array('admin_only'=>true)
    544588    );
    545589
     
    567611<br><b>single_value_mode</b> can be "fill_if_empty" (only use the input value if the corresponding values is currently empty) or "replace"
    568612(overwrite any existing value) and applies to single values properties like name/author/date_creation/comment.
    569 <br><b>multiple_value_mode</b> can be "append" (no change on existing values, add the new values) or "replace" and applies to multiple values properties like tag_ids/categories.'
     613<br><b>multiple_value_mode</b> can be "append" (no change on existing values, add the new values) or "replace" and applies to multiple values properties like tag_ids/categories.',
     614      null,
     615      array('admin_only'=>true, 'post_only'=>true)
    570616    );
    571617
     
    578624        'comment' =>      array('default'=>null),
    579625        ),
    580       '<b>Admin & POST only.</b> Changes properties of an album.'
     626      '<b>Admin & POST only.</b> Changes properties of an album.',
     627      null,
     628      array('admin_only'=>true, 'post_only'=>true)
    581629    );
    582630 
     
    585633      'ws_plugins_getList',
    586634      null,
    587       '<b>Admin only.</b> Gets the list of plugins with id, name, version, state and description.'
     635      '<b>Admin only.</b> Gets the list of plugins with id, name, version, state and description.',
     636      null,
     637      array('admin_only'=>true)
    588638    );
    589639
     
    596646        'pwg_token' => array(),
    597647        ),
    598       '<b>Admin only.</b>'
     648      '<b>Admin only.</b>',
     649      null,
     650      array('admin_only'=>true)
    599651    );
    600652
     
    607659        'pwg_token' => array(),
    608660        ),
    609       '<b>Admin only.</b>'
     661      '<b>Admin only.</b>',
     662      null,
     663      array('admin_only'=>true)
    610664    );
    611665
     
    619673        'pwg_token' => array(),
    620674        ),
    621       '<b>Webmaster only.</b>'
     675      '<b>Webmaster only.</b>',
     676      null,
     677      array('admin_only'=>true)
    622678  );
    623679
     
    634690        'pwg_token' =>  array(),
    635691      ),
    636       '<b>Webmaster only.</b> Ignores an extension if it needs update.'
     692      '<b>Webmaster only.</b> Ignores an extension if it needs update.',
     693      null,
     694      array('admin_only'=>true)
    637695  );
    638696
     
    641699      'ws_extensions_checkupdates',
    642700      null,
    643       '<b>Admin only.</b> Checks if piwigo or extensions are up to date.'
     701      '<b>Admin only.</b> Checks if piwigo or extensions are up to date.',
     702      null,
     703      array('admin_only'=>true)
    644704  );
    645705}
Note: See TracChangeset for help on using the changeset viewer.