Exemplo n.º 1
0
 /**
  * Get app list
  * @return string
  */
 private function getUsersList()
 {
     $users_list = userModel::getUsers();
     foreach ($users_list as $k => $v) {
         $users_list[$k]['btn_edit'] = $this->render_common('btn_edit', array('url' => $this->makeURI(array('action' => 'edit', 'id_user' => $v['id_user']))));
         if (classModel::getCurrentUserId() !== $v['id_user']) {
             $users_list[$k]['btn_delete'] = $this->render_common('btn_delete', array('url' => $this->makeURI(array('action' => 'delete', 'id_user' => $v['id_user'])), 'confirm_text' => 'Do you want to delete this user?'));
         } else {
             $users_list[$k]['btn_delete'] = 'Current';
         }
     }
     return $this->render('users_list', array('users_list' => $users_list));
 }
Exemplo n.º 2
0
 private function getFilter()
 {
     if (authModel::is_SuperUserSession()) {
         $id_user = classModel::getCurrentUserId();
         // if the superuser is logged - set id user according to the filter state
         classModel::setSession('id_user', $id_user);
         return $this->render('filter_section', array('user_filter' => userModel::getUsers(), 'curent_user' => $id_user));
     } else {
         return null;
     }
 }