Skip to content

Commit f78b6ae

Browse files
REBELinBLUEDan Cryer
authored and
Dan Cryer
committed
Cleanup of the disabled login mode.
Hides user menu, the navigation user panel, etc. Closes dancryer#718
1 parent c2c51e3 commit f78b6ae

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

PHPCI/Helper/LoginIsDisabled.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* PHPCI - Continuous Integration for PHP
4+
*
5+
* @copyright Copyright 2014, Block 8 Limited.
6+
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
7+
* @link https://www.phptesting.org/
8+
*/
9+
10+
namespace PHPCI\Helper;
11+
12+
/**
13+
* Login Is Disabled Helper - Checks if login is disalbed in the view
14+
* @author Stephen Ball <[email protected]>
15+
* @package PHPCI
16+
* @subpackage Web
17+
*/
18+
class LoginIsDisabled
19+
{
20+
/**
21+
* Checks if
22+
* @param $method
23+
* @param array $params
24+
* @return mixed|null
25+
*/
26+
public function __call($method, $params = array())
27+
{
28+
unset($method, $params);
29+
30+
$config = b8\Config::getInstance();
31+
$state = (bool) $config->get('phpci.authentication_settings.state', false);
32+
33+
return (false !== $state);
34+
}
35+
}

PHPCI/View/layout.phtml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
</li>
125125

126126

127+
<?php if (!$this->LoginIsDisabled()): ?>
127128
<!-- User Account: style can be found in dropdown.less -->
128129
<li class="dropdown user user-menu">
129130
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
@@ -150,6 +151,7 @@
150151
</li>
151152
</ul>
152153
</li>
154+
<?php endif; ?>
153155
</ul>
154156
</div>
155157
</nav>
@@ -159,6 +161,8 @@
159161
<aside class="left-side sidebar-offcanvas">
160162
<!-- sidebar: style can be found in sidebar.less -->
161163
<section class="sidebar">
164+
165+
<?php if (!$this->LoginIsDisabled()): ?>
162166
<!-- Sidebar user panel -->
163167
<div class="user-panel">
164168
<div class="pull-left image">
@@ -170,6 +174,7 @@
170174
<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
171175
</div>
172176
</div>
177+
<?php endif; ?>
173178

174179
<!-- sidebar menu: : style can be found in sidebar.less -->
175180
<ul class="sidebar-menu">

0 commit comments

Comments
 (0)