mirror of https://github.com/movim/movim
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
60 lines
1.5 KiB
<?php
|
|
|
|
/**
|
|
* @package Widgets
|
|
*
|
|
* @file Pods.php
|
|
* This file is part of Movim.
|
|
*
|
|
* @brief The Infos widget for the API
|
|
*
|
|
* @author Jaussoin Timothée <edhelas@movim.eu>
|
|
|
|
* Copyright (C)2014 Movim project
|
|
*
|
|
* See COPYING for licensing information.
|
|
*/
|
|
|
|
class Infos extends WidgetBase
|
|
{
|
|
function load() {
|
|
|
|
}
|
|
|
|
function display()
|
|
{
|
|
// We get the informations
|
|
$pop = 0;
|
|
foreach(scandir(USERS_PATH) as $f)
|
|
if(is_dir(USERS_PATH.'/'.$f))
|
|
$pop++;
|
|
$pop = $pop-2;
|
|
|
|
// We get the global configuration
|
|
$conf = Conf::getServerConf();
|
|
|
|
$sd = new \Modl\SessionxDAO();
|
|
|
|
// We see if we have the url rewriting
|
|
$rewrite = false;
|
|
if(isset($_SERVER['HTTP_MOD_REWRITE']) && $_SERVER['HTTP_MOD_REWRITE']) {
|
|
$rewrite = true;
|
|
}
|
|
|
|
$infos = array(
|
|
'url' => BASE_URI,
|
|
'language' => $conf['defLang'],
|
|
'whitelist' => $conf['xmppWhiteList'],
|
|
'timezone' => $conf['timezone'],
|
|
'description' => $conf['description'],
|
|
'unregister' => $conf['unregister'],
|
|
'php_version' => phpversion(),
|
|
'rewrite' => $rewrite,
|
|
'version' => APP_VERSION,
|
|
'population' => $pop,
|
|
'connected' => $sd->getConnected()
|
|
);
|
|
|
|
$this->view->assign('json', json_encode($infos));
|
|
}
|
|
}
|