MantisBT - Piwigo
View Issue Details
0001023Piwigoweb APIpublic2009.06.07 23:532011.04.17 00:12
normalfeaturehave not tried
Apache 1.3.x
0001023: new API method pwg.getInfos for admins with overall statistics
Should add a data with overall gallery images count in the result array
(why not activated or not by a new parameter)
No tags attached.
Issue History
2009.06.07 23:53mistic100New Issue
2009.06.07 23:53mistic100browser => any
2009.06.07 23:53mistic100Web server => Apache 1.3.x
2011.04.03 17:59svnCheckin
2011.04.03 17:59svnNote Added: 0004935
2011.04.03 18:00mistic100Statusnew => resolved
2011.04.03 18:00mistic100Fixed in Version => 2.2.0
2011.04.03 18:00mistic100Resolutionopen => fixed
2011.04.03 18:00mistic100Assigned To => mistic100
2011.04.05 14:01plgNote Added: 0004940
2011.04.05 14:17mistic100Note Added: 0004942
2011.04.05 14:17mistic100Statusresolved => feedback
2011.04.05 14:17mistic100Resolutionfixed => reopened
2011.04.05 14:29plgNote Added: 0004943
2011.04.05 14:35mistic100Note Added: 0004944
2011.04.05 14:41mistic100Note Edited: 0004944
2011.04.05 14:41mistic100Note Edited: 0004944
2011.04.05 14:41plgNote Added: 0004945
2011.04.05 15:00mistic100Note Added: 0004946
2011.04.05 15:02plgNote Added: 0004947
2011.04.05 15:13svnCheckin
2011.04.05 15:13svnNote Added: 0004948
2011.04.05 15:13mistic100Statusfeedback => resolved
2011.04.05 15:13mistic100Resolutionreopened => fixed
2011.04.16 20:03plgStatusresolved => closed
2011.04.16 20:03plgProduct Version => 2.2.0
2011.04.16 20:03plgFixed in Version2.2.0 => 2.2.1
2011.04.16 20:03plgTarget Version => 2.2.1
2011.04.17 00:12plgSummaryAdd images count in Webservices results => new API method pwg.getInfos for admins with overall statistics

2011.04.03 17:59   
[Subversion] r10022 by mistic100 on branch 2.2

-----[Subversion commit log]----------------------------------------------------
merge r10017 from trunk to 2.2 (bug:1023)
2011.04.05 14:01   
in ws_getInfos(...), replace:

if ($conf['show_version'] or is_admin())


if (is_admin())
2011.04.05 14:17   
why ?
it's the same condition than in ws_getVersion...
2011.04.05 14:29   
But you show *much* more than in pwg.getVersion, you show things that are only available in the administration panel.
2011.04.05 14:35   
(edited on: 2011.04.05 14:41)
ho... you mean all the function must be restricted to an admin usage ?
If I'm right there are much than one line to change
and unless the version, I don't know if it's critical information :s

2011.04.05 14:41   
Oh sorry, I didn't read your code with enough attention. It's just the $infos['version'] that is added if $conf['show_version'] or is_admin().

With its current coding, this function should be only for admins :

if (!is_admin())
  return new PwgError(403, 'Forbidden');

Or you will have to change the list of informations depending on user status and manage permissions : the number of physical albums is not interesting for non admin users, you must not return the total number of photos for a non admin user (you have to filter based on permissions). So to make things simpler, I would simply require admin rights for this method.

What is the purpose of this method? (who is the audience?)
2011.04.05 15:00   
ok I understand the deal.

I will try to make differents results : one complete serie for admin and one limited serie for guests, user specific datas is too complicated for a very limited usage.

Bassically I just want to know the number a pictures on the gallery... but It was months ago and I admit I don't remember why...
2011.04.05 15:02   
If you don't know why it's useful, I advise you to wait for the moment you remember why it's useful :-) no need add useless methods in the API.
2011.04.05 15:13   
[Subversion] r10062 by mistic100 on branch 2.2

-----[Subversion commit log]----------------------------------------------------
merge r10061 from trunk : ws_getInfos is restrcited to admins (bug:1023)