selectalbum.php 650 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Tidypics plugin
  4. *
  5. * Selection of album to upload new images to
  6. *
  7. * (c) iionly 2013-2014
  8. * Contact: iionly@gmx.de
  9. * Website: https://github.com/iionly
  10. * License: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
  11. *
  12. */
  13. $album_guid = (int)get_input('album_guid', -1);
  14. $owner_guid = (int)get_input('owner_guid', elgg_get_logged_in_user_guid());
  15. if($album_guid == -1) {
  16. forward("photos/add/$owner_guid");
  17. } else {
  18. $album = get_entity($album_guid);
  19. if (!$album->getContainerEntity()->canWriteToContainer()) {
  20. forward(REFERER);
  21. }
  22. forward("photos/upload/$album_guid");
  23. }