Piwigo / Piwigo-Android

Piwigo Native Android App
GNU General Public License v3.0
140 stars 43 forks source link

support community plugin #47

Open ramack opened 6 years ago

ramack commented 6 years ago

@EddyLB wrote in #20: I suggest to add Compatibility with the Community plugin (which should have been added to the current list of features of the iOS app). Many users requested it.

@EddyLB can you elaborate what that technically means? And also feel free to submit such kind of proposals directly in a new ticket.

EddyLB commented 6 years ago

Hi @ramack

Here is how Piwigo-Mobile detects the presence of the Community plugin while opening a session:

  1. Call reflection.getMethodList to determine whether the Community extension is installed (by detecting the presence of community.session.getStatus)
  2. Call pwg.session.login to authenticate the user
  3. If the Community extension is installed, call community.session.getStatus to determine the real user rights (admin or webmaster).
  4. Call pwg.session.getStatus to check Piwigo version, get token, available image sizes, upload file types, etc. Set the user rights from this call only when the Community extension is not used.
  5. Call pwg.categories.getList with parameters cat_id, recursive and faked_by_community. As explained in https://github.com/plegall/Piwigo-community/issues/23 the value of faked_by_community must be "false" if the Community extension is installed and "true" otherwise.
  6. If the Community extension is installed, call community.categories.getList to identify albums having upload rights

The app displays all albums (public and belonging to Community user). The actions proposed to the user then depend on his/her rights: [admin], [upload rights on specific albums] or [none].

Cheers