Cleanup of the disabled login mode.

Hides user menu, the navigation user panel, etc.

Closes #718
This commit is contained in:
Stephen Ball 2014-12-11 14:41:00 +00:00 committed by Dan Cryer
parent c2c51e376b
commit f78b6ae9f9
2 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,35 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/
namespace PHPCI\Helper;
/**
* Login Is Disabled Helper - Checks if login is disalbed in the view
* @author Stephen Ball <phpci@stephen.rebelinblue.com>
* @package PHPCI
* @subpackage Web
*/
class LoginIsDisabled
{
/**
* Checks if
* @param $method
* @param array $params
* @return mixed|null
*/
public function __call($method, $params = array())
{
unset($method, $params);
$config = b8\Config::getInstance();
$state = (bool) $config->get('phpci.authentication_settings.state', false);
return (false !== $state);
}
}

View file

@ -124,6 +124,7 @@
</li>
<?php if (!$this->LoginIsDisabled()): ?>
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
@ -150,6 +151,7 @@
</li>
</ul>
</li>
<?php endif; ?>
</ul>
</div>
</nav>
@ -159,6 +161,8 @@
<aside class="left-side sidebar-offcanvas">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<?php if (!$this->LoginIsDisabled()): ?>
<!-- Sidebar user panel -->
<div class="user-panel">
<div class="pull-left image">
@ -170,6 +174,7 @@
<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
</div>
</div>
<?php endif; ?>
<!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu">