Added test for Account Object

This commit is contained in:
Deon George 2016-01-11 10:09:38 +11:00
parent c1b1485c10
commit b088de0631
3 changed files with 9 additions and 6 deletions

View File

@ -38,6 +38,7 @@ class Menu extends lnApp_Menu {
$ao = Auth::instance()->get_user();
if (is_object($ao))
foreach ($ao->methods() as $mmo)
if ($mmo->menu_display AND $type == $mmo->directory())
if (empty($result[$mmo->id]))

View File

@ -30,7 +30,9 @@ class URL extends lnApp_URL {
case 'reseller': $result[$k] = array('name'=>'Reseller','icon'=>'icon-th-list');
break;
case 'user': $result[$k] = array('name'=>Auth::instance()->get_user()->name(),'icon'=>'icon-user');
case 'user':
if (is_object(Auth::instance()->get_user()))
$result[$k] = array('name'=>Auth::instance()->get_user()->name(),'icon'=>'icon-user');
break;
default: $result[$k] = array('name'=>$k,'icon'=>'icon-question-sign');

View File

@ -77,7 +77,7 @@
<li class="">
<a href="<?php echo URL::link('admin','welcome',TRUE); ?>"><i class="icon-tasks"></i><span>Admin</span></a>
</li>
<?php elseif ($ao->isReseller()) : ?>
<?php elseif ($ao AND $ao->isReseller()) : ?>
<li class="">
<a href="<?php echo URL::link('reseller','welcome',TRUE); ?>"><i class="icon-tasks"></i><span>Reseller</span></a>
</li>