importaddressbook.php 914 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. OCP\JSON::checkLoggedIn();
  9. OCP\App::checkAppEnabled('contacts');
  10. $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
  11. $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
  12. $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
  13. $freeSpace=OC_Filesystem::free_space('/');
  14. $freeSpace=max($freeSpace,0);
  15. $maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
  16. $tmpl = new OCP\Template('contacts', 'part.importaddressbook');
  17. $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
  18. $tmpl->assign('requesttoken', $_SERVER['HTTP_REQUESTTOKEN']);
  19. $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
  20. $tmpl->printpage();
  21. ?>