I am in a quandary as to what is wrong with this code:
<div id="navbar">
<ul>
<?php if ($session->check('Auth.User.group_id') == 1):
?>
<li><?php echo $html->link(__
('distributors',true),''.'/'.'distributors'); ?></li>
<li><?php echo
$html->link(__('dealers',true),''.'/'.'dealers'); ?
></li>
<li><?php echo
$html->link(__('groups',true),''.'/'.'groups'); ?></
li>
<li><?php echo
$html->link(__('users',true),''.'/'.'users'); ?></
li>
<?php elseif ($session->check('Auth.User.group_id') ==
2): ?>
<li><?php echo $html->link(__
('distributors',true),''.'/'.'distributors'); ?></li>
<?php elseif ($session->check('Auth.User.group_id') ==
3): ?>
<li><?php echo
$html->link(__('dealers',true),''.'/'.'dealers'); ?
></li>
<?php endif;?>
<?php if (!$session->check('Auth.User.id')): ?>
<li><?php echo $html->link(__
('login',true),''.'/'.'users'.'/'.'login'); ?></li>
<?php else: ?>
<li><?php echo $html->link(__
('logout',true),''.'/'.'users'.'/'.'logout'); ?></li>
<?php endif;?>
</ul>
</div>
The "If" construct at the bottom works to toggle the 'Login' and
'Logout' buttons. However, the "If" construct above based on
'Auth.User.group_id' always acts as if the value == '1'
I have DebugKit installed and it shows the value of 2 for the person
logged in through Session->Auth->User. The field 'group_id' is a
foreign key in the Users table.
Please help me out here! Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---