You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.5 KiB

  1. <?php
  2. /**
  3. * @package Widgets
  4. *
  5. * @file Pods.php
  6. * This file is part of Movim.
  7. *
  8. * @brief The Infos widget for the API
  9. *
  10. * @author Jaussoin Timothée <edhelas@movim.eu>
  11. * Copyright (C)2014 Movim project
  12. *
  13. * See COPYING for licensing information.
  14. */
  15. class Infos extends WidgetBase
  16. {
  17. function load() {
  18. }
  19. function display()
  20. {
  21. // We get the informations
  22. $pop = 0;
  23. foreach(scandir(USERS_PATH) as $f)
  24. if(is_dir(USERS_PATH.'/'.$f))
  25. $pop++;
  26. $pop = $pop-2;
  27. // We get the global configuration
  28. $conf = Conf::getServerConf();
  29. $sd = new \Modl\SessionxDAO();
  30. // We see if we have the url rewriting
  31. $rewrite = false;
  32. if(isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE']) {
  33. $rewrite = true;
  34. }
  35. $infos = array(
  36. 'url' => BASE_URI,
  37. 'language' => $conf['defLang'],
  38. 'whitelist' => $conf['xmppWhiteList'],
  39. 'timezone' => $conf['timezone'],
  40. 'description' => $conf['description'],
  41. 'unregister' => $conf['unregister'],
  42. 'php_version' => phpversion(),
  43. 'rewrite' => $rewrite,
  44. 'version' => APP_VERSION,
  45. 'population' => $pop,
  46. 'connected' => $sd->getConnected()
  47. );
  48. $this->view->assign('json', json_encode($infos));
  49. }
  50. }