get_display_list(); } function show_esgroup_form_anonymous() { global $msg, $charset; print '
'; print '

'.$msg['es_groups_edit'].'

'; print '
'; //name print '

'; print $msg["admin_connecteurs_outauth_anonymgroupname"]; print '
'; //fullname print '

'; print $msg["admin_connecteurs_outauth_anonymgroupfullname"]; print '
'; $pmbusers_sql = "SELECT userid, username, nom, prenom FROM users"; $pmbusers_res = pmb_mysql_query($pmbusers_sql); $pmbusers = array(); while($pmbusers_row = pmb_mysql_fetch_assoc($pmbusers_res)) { $pmbusers[] = $pmbusers_row; } $sql = "SELECT esgroup_pmbusernum FROM es_esgroups WHERE esgroup_id = -1"; $res = pmb_mysql_query($sql); if (!pmb_mysql_num_rows($res)) $esg_pmbuserid = 1; else $esg_pmbuserid = pmb_mysql_result($res, 0, 0); //pmbuser print '

'; print '
'; //buttons print "
"; print " "; print ''; print "


"; print ''; } function update_esgroup_from_form() { global $msg,$id; global $es_group_name, $es_group_pmbuserid; if (!$id) { //Ajout d'un nouveau groupe if (!$es_group_name) { print $msg['es_group_error_emptyfield']; $the_user = new es_esgroup(); $the_user->set_properties_from_form(); print $the_user->get_form(); return false; } if (es_esgroup::name_exists($es_group_name)) { print $msg['es_group_error_namealreadyexists']; $the_user = new es_esgroup(); $the_user->set_properties_from_form(); print $the_user->get_form(); return false; } $new_esgroup = es_esgroup::add_new(); $new_esgroup->set_properties_from_form(); $new_esgroup->commit_to_db(); } else { $the_group = new es_esgroup($id); if ($the_group->error) { return false; } $the_group->set_properties_from_form(); $the_group->commit_to_db(); } return true; } switch ($action) { case "add": $the_group = new es_esgroup(); print $the_group->get_form(); break; case "edit": $the_group = new es_esgroup($id); print $the_group->get_form(); break; case "editanonymous": show_esgroup_form_anonymous(); break; case "update": if (update_esgroup_from_form()) list_groups(); break; case 'updateanonymous': $es_group_pmbuserid = intval($es_group_pmbuserid); if ($es_group_pmbuserid) { $sql = "REPLACE INTO es_esgroups SET esgroup_id = -1, esgroup_name = '".$msg["admin_connecteurs_outauth_anonymgroupname"]."', esgroup_fullname = '".$msg["admin_connecteurs_outauth_anonymgroupfullname"]."', esgroup_pmbusernum = ".$es_group_pmbuserid; pmb_mysql_query($sql); } list_groups(); break; case "del": if ($id) { $the_group = new es_esgroup($id); $the_group->delete(); } list_groups(); break; default: list_groups(); break; } ?>