mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
two new options for API methods : 'admin_only' and 'post_only'
git-svn-id: http://piwigo.org/svn/trunk@25115 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
120
ws.php
120
ws.php
@@ -135,7 +135,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'pwg.getInfos',
|
||||
'ws_getInfos',
|
||||
null,
|
||||
'<b>Admin only.</b> Returns general informations.'
|
||||
'<b>Admin only.</b> Returns general informations.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -145,7 +147,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'image_id'=> array('flags'=>WS_PARAM_FORCE_ARRAY,
|
||||
'type'=>WS_TYPE_ID),
|
||||
),
|
||||
'<b>Admin only.</b> Adds elements to the caddie. Returns the number of elements added.'
|
||||
'<b>Admin only.</b> Adds elements to the caddie. Returns the number of elements added.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -204,7 +208,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'prev_page' => array('default'=>null,
|
||||
'type'=>WS_TYPE_INT|WS_TYPE_POSITIVE),
|
||||
), $f_params),
|
||||
'<b>Admin only.</b> Returns a list of derivatives to build.'
|
||||
'<b>Admin only.</b> Returns a list of derivatives to build.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -216,7 +222,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'content' => array(),
|
||||
'key' => array(),
|
||||
),
|
||||
'<b>POST only.</b> Adds a comment to an image.'
|
||||
'<b>POST only.</b> Adds a comment to an image.',
|
||||
null,
|
||||
array('post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -268,7 +276,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'level' => array('maxValue'=>max($conf['available_permission_levels']),
|
||||
'type'=>WS_TYPE_INT|WS_TYPE_POSITIVE),
|
||||
),
|
||||
'<b>Admin & POST only.</b> Sets the privacy levels for the images.'
|
||||
'<b>Admin & POST only.</b> Sets the privacy levels for the images.',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -279,7 +289,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'category_id' => array('type'=>WS_TYPE_ID),
|
||||
'rank' => array('type'=>WS_TYPE_INT|WS_TYPE_POSITIVE|WS_TYPE_NOTNULL)
|
||||
),
|
||||
'<b>Admin & POST only.</b> Sets the rank of a photo for a given album.'
|
||||
'<b>Admin & POST only.</b> Sets the rank of a photo for a given album.',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -289,7 +301,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'user_id' => array('type'=>WS_TYPE_ID),
|
||||
'anonymous_id' => array('default'=>null),
|
||||
),
|
||||
'<b>Admin & POST only.</b> Deletes all rates for a user.'
|
||||
'<b>Admin & POST only.</b> Deletes all rates for a user.',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -303,7 +317,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'pwg.session.login',
|
||||
'ws_session_login',
|
||||
array('username', 'password'),
|
||||
'<b>POST only.</b> Tries to login the user.'
|
||||
'<b>POST only.</b> Tries to login the user.',
|
||||
null,
|
||||
array('post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -357,7 +373,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'info'=>'Must be "file", for backward compatiblity "high" and "thumb" are allowed.'),
|
||||
'position' => array()
|
||||
),
|
||||
'<b>Admin & POST only.</b> Add a chunk of a file.'
|
||||
'<b>Admin & POST only.</b> Add a chunk of a file.',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -370,7 +388,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'sum' => array(),
|
||||
),
|
||||
'<b>Admin only.</b> Add or update a file for an existing photo.
|
||||
<br>pwg.images.addChunk must have been called before (maybe several times).'
|
||||
<br>pwg.images.addChunk must have been called before (maybe several times).',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
|
||||
@@ -401,7 +421,9 @@ function ws_addDefaultMethods( $arr )
|
||||
),
|
||||
'<b>Admin only.</b> Add an image.
|
||||
<br>pwg.images.addChunk must have been called before (maybe several times).
|
||||
<br>Don\'t use "thumbnail_sum" and "high_sum", these parameters are here for backward compatibility.'
|
||||
<br>Don\'t use "thumbnail_sum" and "high_sum", these parameters are here for backward compatibility.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -425,7 +447,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'<b>Admin & POST only.</b> Add an image.
|
||||
<br>Use the <b>$_FILES[image]</b> field for uploading file.
|
||||
<br>Set the form encoding to "form-data".
|
||||
<br>You can update an existing photo if you define an existing image_id.'
|
||||
<br>You can update an existing photo if you define an existing image_id.',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -435,14 +459,18 @@ function ws_addDefaultMethods( $arr )
|
||||
'image_id' => array('flags'=>WS_PARAM_ACCEPT_ARRAY),
|
||||
'pwg_token' => array(),
|
||||
),
|
||||
'<b>Admin & POST only.</b> Deletes image(s).'
|
||||
'<b>Admin & POST only.</b> Deletes image(s).',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
'pwg.categories.getAdminList',
|
||||
'ws_categories_getAdminList',
|
||||
null,
|
||||
'<b>Admin only.</b>'
|
||||
'<b>Admin only.</b>',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -473,7 +501,9 @@ function ws_addDefaultMethods( $arr )
|
||||
),
|
||||
'<b>Admin & POST only.</b> Deletes album(s).
|
||||
<br><b>photo_deletion_mode</b> can be "no_delete" (may create orphan photos), "delete_orphans"
|
||||
(default mode, only deletes photos linked to no other album) or "force_delete" (delete all photos, even those linked to other albums)'
|
||||
(default mode, only deletes photos linked to no other album) or "force_delete" (delete all photos, even those linked to other albums)',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -485,7 +515,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'pwg_token' => array(),
|
||||
),
|
||||
'<b>Admin & POST only.</b> Move album(s).
|
||||
<br>Set parent as 0 to move to gallery root. Only virtual categories can be moved.'
|
||||
<br>Set parent as 0 to move to gallery root. Only virtual categories can be moved.',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -495,21 +527,27 @@ function ws_addDefaultMethods( $arr )
|
||||
'category_id' => array('type'=>WS_TYPE_ID),
|
||||
'image_id' => array('type'=>WS_TYPE_ID),
|
||||
),
|
||||
'<b>Admin & POST only.</b> Sets the representative photo for an album. The photo doesn\'t have to belong to the album.'
|
||||
'<b>Admin & POST only.</b> Sets the representative photo for an album. The photo doesn\'t have to belong to the album.',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
'pwg.tags.getAdminList',
|
||||
'ws_tags_getAdminList',
|
||||
null,
|
||||
'<b>Admin only.</b> '
|
||||
'<b>Admin only.</b>',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod( // TODO: create multiple tags
|
||||
'pwg.tags.add',
|
||||
'ws_tags_add',
|
||||
array('name'),
|
||||
'<b>Admin only.</b> Adds a new tag.'
|
||||
'<b>Admin only.</b> Adds a new tag.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -520,7 +558,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'filename_list' => array('default'=>null),
|
||||
),
|
||||
'<b>Admin only.</b> Checks existence of images.
|
||||
<br>Give <b>md5sum_list</b> if $conf[uniqueness_mode]==md5sum. Give <b>filename_list</b> if $conf[uniqueness_mode]==filename.'
|
||||
<br>Give <b>md5sum_list</b> if $conf[uniqueness_mode]==md5sum. Give <b>filename_list</b> if $conf[uniqueness_mode]==filename.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -533,14 +573,18 @@ function ws_addDefaultMethods( $arr )
|
||||
'high_sum' => array('default'=>null),
|
||||
),
|
||||
'<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".
|
||||
<br>Don\'t use "thumbnail_sum" and "high_sum", these parameters are here for backward compatibility.'
|
||||
<br>Don\'t use "thumbnail_sum" and "high_sum", these parameters are here for backward compatibility.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
'pwg.images.checkUpload',
|
||||
'ws_images_checkUpload',
|
||||
null,
|
||||
'<b>Admin only.</b> Checks if Piwigo is ready for upload.'
|
||||
'<b>Admin only.</b> Checks if Piwigo is ready for upload.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -566,7 +610,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'<b>Admin & POST only.</b> Changes properties of an image.
|
||||
<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"
|
||||
(overwrite any existing value) and applies to single values properties like name/author/date_creation/comment.
|
||||
<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.'
|
||||
<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.',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -577,14 +623,18 @@ function ws_addDefaultMethods( $arr )
|
||||
'name' => array('default'=>null),
|
||||
'comment' => array('default'=>null),
|
||||
),
|
||||
'<b>Admin & POST only.</b> Changes properties of an album.'
|
||||
'<b>Admin & POST only.</b> Changes properties of an album.',
|
||||
null,
|
||||
array('admin_only'=>true, 'post_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
'pwg.plugins.getList',
|
||||
'ws_plugins_getList',
|
||||
null,
|
||||
'<b>Admin only.</b> Gets the list of plugins with id, name, version, state and description.'
|
||||
'<b>Admin only.</b> Gets the list of plugins with id, name, version, state and description.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -595,7 +645,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'plugin' => array(),
|
||||
'pwg_token' => array(),
|
||||
),
|
||||
'<b>Admin only.</b>'
|
||||
'<b>Admin only.</b>',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -606,7 +658,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'theme' => array(),
|
||||
'pwg_token' => array(),
|
||||
),
|
||||
'<b>Admin only.</b>'
|
||||
'<b>Admin only.</b>',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -618,7 +672,9 @@ function ws_addDefaultMethods( $arr )
|
||||
'revision' => array(),
|
||||
'pwg_token' => array(),
|
||||
),
|
||||
'<b>Webmaster only.</b>'
|
||||
'<b>Webmaster only.</b>',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
@@ -633,14 +689,18 @@ function ws_addDefaultMethods( $arr )
|
||||
'info'=>'If true, all ignored extensions will be reinitilized.'),
|
||||
'pwg_token' => array(),
|
||||
),
|
||||
'<b>Webmaster only.</b> Ignores an extension if it needs update.'
|
||||
'<b>Webmaster only.</b> Ignores an extension if it needs update.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
|
||||
$service->addMethod(
|
||||
'pwg.extensions.checkUpdates',
|
||||
'ws_extensions_checkupdates',
|
||||
null,
|
||||
'<b>Admin only.</b> Checks if piwigo or extensions are up to date.'
|
||||
'<b>Admin only.</b> Checks if piwigo or extensions are up to date.',
|
||||
null,
|
||||
array('admin_only'=>true)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user