mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-05-06 08:05:51 +03:00
merge r27810 from branch 2.6 to trunk
bug 3055: add security pwg_token on API methods introduced in Piwigo 2.6 (pwg.groups.addUser, pwg.groups.deleteUser, pwg.groups.setInfo, pwg.users.add, pwg.users.setInfo, pwg.permissions.add, pwg.permissions.remove) git-svn-id: http://piwigo.org/svn/trunk@27811 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
61b4fd3bb2
commit
b08c46f3c3
5 changed files with 47 additions and 2 deletions
|
@ -165,6 +165,11 @@ DELETE
|
|||
*/
|
||||
function ws_groups_setInfo($params, &$service)
|
||||
{
|
||||
if (get_pwg_token() != $params['pwg_token'])
|
||||
{
|
||||
return new PwgError(403, 'Invalid security token');
|
||||
}
|
||||
|
||||
$updates = array();
|
||||
|
||||
// does the group exist ?
|
||||
|
@ -221,6 +226,11 @@ SELECT COUNT(*)
|
|||
*/
|
||||
function ws_groups_addUser($params, &$service)
|
||||
{
|
||||
if (get_pwg_token() != $params['pwg_token'])
|
||||
{
|
||||
return new PwgError(403, 'Invalid security token');
|
||||
}
|
||||
|
||||
// does the group exist ?
|
||||
$query = '
|
||||
SELECT COUNT(*)
|
||||
|
@ -264,6 +274,11 @@ SELECT COUNT(*)
|
|||
*/
|
||||
function ws_groups_deleteUser($params, &$service)
|
||||
{
|
||||
if (get_pwg_token() != $params['pwg_token'])
|
||||
{
|
||||
return new PwgError(403, 'Invalid security token');
|
||||
}
|
||||
|
||||
// does the group exist ?
|
||||
$query = '
|
||||
SELECT COUNT(*)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue