Exemplo n.º 1
0
 * It supports "cluster-slave-node" mode, where page navigation elements are not displayed
 *
 * @author G. Giunta
 * @copyright (C) G. Giunta 2010-2016
 * @license Licensed under GNU General Public License v2.0. See file license.txt
 *
 * @todo use a 3-level path, with the name of the group as 2nd element ?
 */
/// @var eZModule $module
$module = $Params['Module'];
$view = $module->currentView();
// rely on system policy instead of creating our own, but allow also PolicyOmitList for single views
// (useful f.e. for system status checks from tools which can not authenticate because they are too simple).
// Also allow the clusterhelper view to do its auth and then run this view.
$ini = eZINI::instance();
if (!in_array("sysinfo/{$view}", $ini->variable('RoleSettings', 'PolicyOmitList')) && ezSysinfoClusterManager::getAuthStatus() !== true) {
    $user = eZUser::currentUser();
    $access = $user->hasAccessTo('setup', 'system_info');
    if ($access['accessWord'] != 'yes') {
        return $module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
    }
}
$isClusterSlaveRequest = ezSysinfoClusterManager::isClusterSlaveRequest($Params);
$tpl = sysInfoTools::eZTemplateFactory();
if ($isClusterSlaveRequest) {
    // for requests which 'come from cluster', remove titles
    $tpl->setVariable('title', '');
    $tpl->setVariable('description', '');
    $tpl->setVariable('cluster_request', true);
} else {
    $tpl->setVariable('title', ezSysinfoModule::viewTitle($view));