<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'manager-form',
    'enableAjaxValidation'=>false,
));
?>

    <fieldset>
    <legend><?php echo $title;?></legend>
    <div>
        <table class="widefat post">
            <thead>
            <tr><th>编号</th><th>用户名</th><th>权限</th><th>操作</th></tr>
            </thead>
            <tbody>
            <?php foreach ($users as $key => $user):?>
            <tr>
                <td>
                   <?php echo $user->id; ?>
                </td>
                <td>
                   <?php echo CHtml::link($user->username,array('userassign','name'=>$user->username));?>
                </td>
                <td>
                    <?php foreach ( Yii::app()->authManager->getAuthAssignments($user->username) as $assign):?>
                    <?php echo $assign->itemName; ?> 
                    <?php endforeach;?>
                </td>
                <td>
                     <?php echo CHtml::link('权限指派',array('userassign','name'=>$user->username));?>
                </td>
            </tr>
            <?php endforeach;?>
            </tbody>
        </table>
    </div>
    <?php $this->widget('CLinkPager',array('pages'=>$pages)); ?>
    </fieldset>
<?php $this->endWidget();?>
</div>
