. */ /** * @brief Form to add a grant to a user, pop up page (User administration) * * * @file * @author Claire Figueras * @date $date$ * @version $Revision$ * @ingroup admin */ try{ require_once("core/class/usergroups_controler.php"); } catch (Exception $e){ functions::xecho($e->getMessage()); } core_tools::load_lang(); core_tools::test_admin('admin_users', 'apps'); $ugc = new usergroups_controler(); $tab = $ugc->getAllUsergroups(); $tab2 = array(); if ( count($_SESSION['m_admin']['users']['groups']) > 0 ) { for($i=0; $i < count($_SESSION['m_admin']['users']['groups']); $i++) { array_push($tab2, array('ID'=> $_SESSION['m_admin']['users']['groups'][$i]['GROUP_ID'], 'LABEL' => $_SESSION['m_admin']['users']['groups'][$i]['LABEL'])); } } $res = $tab; for($j=0; $j < count($tab); $j++) { for($k=0; $k < count($tab2); $k++) { if($tab[$j]->__get('group_id') == $tab2[$k]['ID']) { unset($res[$j]); break; } } } $res = array_values($res); unset($tab2); unset($tab); ?>