本文整理汇总了PHP中grr_sql_command函数的典型用法代码示例。如果您正苦于以下问题:PHP grr_sql_command函数的具体用法?PHP grr_sql_command怎么用?PHP grr_sql_command使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了grr_sql_command函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_user
function delete_user($login)
{
$sql = "SELECT source FROM " . TABLE_PREFIX . "_utilisateurs\n\t WHERE login LIKE '{$login}'";
$res = grr_sql_query($sql);
$row = grr_sql_row($res, 0);
$source = $row[0];
if ($source == 'ext') {
// Si l'utilisateur avait été créé automatiquement, on le
// supprime
// Cf. admin_user.php l99 et l203
$sql = "DELETE FROM " . TABLE_PREFIX . "_utilisateurs WHERE login='{$login}'";
if (grr_sql_command($sql) < 0) {
fatal_error(1, "<p>" . grr_sql_error());
} else {
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_mailuser_room WHERE login='{$login}'");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_user_area WHERE login='{$login}'");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_user_room WHERE login='{$login}'");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_useradmin_area WHERE login='{$login}'");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_useradmin_site WHERE login='{$login}'");
}
// Fin de la session
grr_closeSession($_GET['auto']);
}
// sinon c'est source="local": on le garde et il y a toujours accès
// classique login/mot de passe).
}
示例2: grr_sql_query
grr_sql_query("DELETE from ".TABLE_PREFIX."_setting where NAME = 'maj196_qui_peut_reserver_pour'");
grr_sql_query("INSERT INTO ".TABLE_PREFIX."_setting VALUES ('maj196_qui_peut_reserver_pour', '1');");
$result .= "<b>Mise à jour du champs qui_peut_reserver_pour : </b><span style=\"color:green;\">Ok !</span><br /><br />";
}
// Mise à jour du numéro de version
$req = grr_sql_query1("SELECT VALUE FROM ".TABLE_PREFIX."_setting WHERE NAME='version'");
if ($req == -1) {
$result_inter .= traite_requete("INSERT INTO ".TABLE_PREFIX."_setting VALUES ('version', '".$version_grr."');");
} else {
$result_inter .= traite_requete("UPDATE ".TABLE_PREFIX."_setting SET VALUE='".$version_grr."' WHERE NAME='version';");
}
// Mise à jour du numéro de RC
$req = grr_sql_command("DELETE FROM ".TABLE_PREFIX."_setting WHERE NAME='versionRC'");
$result_inter .= traite_requete("INSERT INTO ".TABLE_PREFIX."_setting VALUES ('versionRC', '".$version_grr_RC."');");
//Re-Chargement des valeurs de la table settingS
if (!loadSettings()) {
die("Erreur chargement settings");
}
affiche_pop_up(get_vocab("maj_good"),"force");
}
// Numéro de version effective
$version_old = getSettingValue("version");
if ($version_old == "") $version_old = "1.3";
// Numéro de RC
$version_old_RC = getSettingValue("versionRC");
示例3: NettoyerTablesJointure
/** NettoyerTablesJointure()
*
* Supprime les lignes inutiles dans les tables de liaison
*
*/
function NettoyerTablesJointure()
{
$nb = 0;
// Table grr_j_mailuser_room
$req = "SELECT j.login FROM " . TABLE_PREFIX . "_j_mailuser_room j\n\tLEFT JOIN " . TABLE_PREFIX . "_utilisateurs u on u.login=j.login\n\tWHERE (u.login IS NULL)";
$res = grr_sql_query($req);
if ($res) {
for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
$nb++;
grr_sql_command("delete from " . TABLE_PREFIX . "_j_mailuser_room where login='" . $row[0] . "'");
}
}
// Table grr_j_user_area
$req = "SELECT j.login FROM " . TABLE_PREFIX . "_j_user_area j\n\tLEFT JOIN " . TABLE_PREFIX . "_utilisateurs u on u.login=j.login\n\tWHERE (u.login IS NULL)";
$res = grr_sql_query($req);
if ($res) {
for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
$nb++;
grr_sql_command("delete from " . TABLE_PREFIX . "_j_user_area where login='" . $row[0] . "'");
}
}
// Table grr_j_user_room
$req = "SELECT j.login FROM " . TABLE_PREFIX . "_j_user_room j\n\tLEFT JOIN " . TABLE_PREFIX . "_utilisateurs u on u.login=j.login\n\tWHERE (u.login IS NULL)";
$res = grr_sql_query($req);
if ($res) {
for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
$nb++;
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_user_room WHERE login='" . $row[0] . "'");
}
}
// Table grr_j_useradmin_area
$req = "SELECT j.login FROM " . TABLE_PREFIX . "_j_useradmin_area j\n\tLEFT JOIN " . TABLE_PREFIX . "_utilisateurs u on u.login=j.login\n\tWHERE (u.login IS NULL)";
$res = grr_sql_query($req);
if ($res) {
for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
$nb++;
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_useradmin_area WHERE login='" . $row[0] . "'");
}
}
// Table grr_j_useradmin_site
$req = "SELECT j.login FROM " . TABLE_PREFIX . "_j_useradmin_site j\n\tLEFT JOIN " . TABLE_PREFIX . "_utilisateurs u on u.login=j.login\n\tWHERE (u.login IS NULL)";
$res = grr_sql_query($req);
if ($res) {
for ($i = 0; $row = grr_sql_row($res, $i); $i++) {
$nb++;
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_useradmin_site WHERE login='" . $row[0] . "'");
}
}
// Suppression effective
echo "<hr />\n";
echo "<p class='avertissement'>" . get_vocab("tables_liaison") . get_vocab("deux_points") . $nb . get_vocab("entres_supprimees") . "</p>\n";
}
示例4: grr_sql_query1
$test_statut = grr_sql_query1("SELECT statut FROM " . TABLE_PREFIX . "_utilisateurs WHERE login='" . $_GET['user_del'] . "'");
if ($test_statut == "gestionnaire_utilisateur" || $test_statut == "administrateur") {
$can_delete = "no";
}
}
if ($temp != getUserName() && $can_delete == "yes") {
$temp = str_replace('\\', '\\\\', $temp);
$sql = "DELETE FROM " . TABLE_PREFIX . "_utilisateurs WHERE login='{$temp}'";
if (grr_sql_command($sql) < 0) {
fatal_error(1, "<p>" . grr_sql_error());
} else {
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_mailuser_room WHERE login='{$temp}'");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_user_area WHERE login='{$temp}'");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_user_room WHERE login='{$temp}'");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_useradmin_area WHERE login='{$temp}'");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_useradmin_site WHERE login='{$temp}'");
$msg = get_vocab("del_user_succeed");
}
}
}
if (isset($mess) && $mess != "") {
echo "<p>" . $mess . "</p>";
}
echo "<h2>" . get_vocab('admin_user.php') . "</h2>";
if (empty($display)) {
$display = 'actifs';
}
if (empty($order_by)) {
$order_by = 'nom,prenom';
}
?>
示例5: NettoyerTablesJointure
/** NettoyerTablesJointure()
* Supprime les lignes inutiles dans les tables de liaison.
*/
function NettoyerTablesJointure()
{
$nb = 0;
// Table grr_j_mailuser_room
$req = 'SELECT j.login FROM ' . TABLE_PREFIX . '_j_mailuser_room j
LEFT JOIN ' . TABLE_PREFIX . '_utilisateurs u on u.login=j.login
WHERE (u.login IS NULL)';
$res = grr_sql_query($req);
if ($res) {
for ($i = 0; $row = grr_sql_row($res, $i); ++$i) {
++$nb;
grr_sql_command('delete from ' . TABLE_PREFIX . "_j_mailuser_room where login='" . $row[0] . "'");
}
}
// Table grr_j_user_area
$req = 'SELECT j.login FROM ' . TABLE_PREFIX . '_j_user_area j
LEFT JOIN ' . TABLE_PREFIX . '_utilisateurs u on u.login=j.login
WHERE (u.login IS NULL)';
$res = grr_sql_query($req);
if ($res) {
for ($i = 0; $row = grr_sql_row($res, $i); ++$i) {
++$nb;
grr_sql_command('delete from ' . TABLE_PREFIX . "_j_user_area where login='" . $row[0] . "'");
}
}
// Table grr_j_user_room
$req = 'SELECT j.login FROM ' . TABLE_PREFIX . '_j_user_room j
LEFT JOIN ' . TABLE_PREFIX . '_utilisateurs u on u.login=j.login
WHERE (u.login IS NULL)';
$res = grr_sql_query($req);
if ($res) {
for ($i = 0; $row = grr_sql_row($res, $i); ++$i) {
++$nb;
grr_sql_command('DELETE FROM ' . TABLE_PREFIX . "_j_user_room WHERE login='" . $row[0] . "'");
}
}
// Table grr_j_useradmin_area
$req = 'SELECT j.login FROM ' . TABLE_PREFIX . '_j_useradmin_area j
LEFT JOIN ' . TABLE_PREFIX . '_utilisateurs u on u.login=j.login
WHERE (u.login IS NULL)';
$res = grr_sql_query($req);
if ($res) {
for ($i = 0; $row = grr_sql_row($res, $i); ++$i) {
++$nb;
grr_sql_command('DELETE FROM ' . TABLE_PREFIX . "_j_useradmin_area WHERE login='" . $row[0] . "'");
}
}
// Table grr_j_useradmin_site
$req = 'SELECT j.login FROM ' . TABLE_PREFIX . '_j_useradmin_site j
LEFT JOIN ' . TABLE_PREFIX . '_utilisateurs u on u.login=j.login
WHERE (u.login IS NULL)';
$res = grr_sql_query($req);
if ($res) {
for ($i = 0; $row = grr_sql_row($res, $i); ++$i) {
++$nb;
grr_sql_command('DELETE FROM ' . TABLE_PREFIX . "_j_useradmin_site WHERE login='" . $row[0] . "'");
}
}
// Suppression effective
echo "<hr />\n";
echo "<p class='avertissement'>" . get_vocab('tables_liaison') . get_vocab('deux_points') . $nb . get_vocab('entres_supprimees') . "</p>\n";
}
示例6: fatal_error
$clef = 0;
$upd = "UPDATE " . TABLE_PREFIX . "_entry SET clef='{$clef}' WHERE id = '" . $id . "'";
if (grr_sql_command($upd) < 0) {
fatal_error(0, grr_sql_error());
}
}
if (isset($_GET['courrier'])) {
$courrier = 1;
$upd = "UPDATE " . TABLE_PREFIX . "_entry SET courrier='{$courrier}' WHERE id = '" . $id . "'";
if (grr_sql_command($upd) < 0) {
fatal_error(0, grr_sql_error());
}
} else {
$courrier = 0;
$upd = "UPDATE " . TABLE_PREFIX . "_entry SET courrier='{$courrier}' WHERE id = '" . $id . "'";
if (grr_sql_command($upd) < 0) {
fatal_error(0, grr_sql_error());
}
}
if (isset($_GET["envoyer_mail"]) && Settings::get("automatic_mail") == 'yes') {
$_SESSION['session_message_error'] = send_mail($id, 7, $dformat);
if ($_SESSION['session_message_error'] == "") {
$_SESSION['displ_msg'] = "yes";
$_SESSION["msg_a_afficher"] = get_vocab("un email envoye") . " " . $_GET["mail_exist"];
}
}
header("Location: " . $_GET['back'] . "");
die;
}
}
if (!isset($day) || !isset($month) || !isset($year)) {
示例7: mktime
$n = mktime(0,0,0,$month,$day,$year);
if (isset($_POST[$n])) {
// Le jour a été selectionné dans le calendrier
$starttime = mktime($morningstarts, 0, 0, $month, $day , $year);
$endtime = mktime($eveningends, 0, $resolution, $month, $day, $year);
// Pour toutes les dates bon précédement enregistrées, on efface toutes les résa en conflit
if (!in_array($n,$day_old)) {
$sql = "select id from ".TABLE_PREFIX."_room";
$res = grr_sql_query($sql);
if ($res) for ($i = 0; ($row = grr_sql_row($res, $i)); $i++)
$result += grrDelEntryInConflict($row[0], $starttime, $endtime, 0, 0, 1);
}
// On enregistre la valeur dans ".TABLE_PREFIX."_calendar
$sql = "INSERT INTO ".TABLE_PREFIX."_calendar set DAY='".$n."'";
if (grr_sql_command($sql) < 0) fatal_error(0, "<p>" . grr_sql_error());
}
$day++;
}
$month++;
if ($month == 13) {
$year++;
$month = 1;
}
}
}
echo "\n<p>".get_vocab("les_journees_cochees_sont_ignorees")."</p>";
echo "\n<table cellpadding=\"3\">\n";
$basetime = mktime(12,0,0,6,11+$weekstarts,2000);
示例8: delete_site
function delete_site($id)
{
if (!(isset($_GET['confirm']))) {
echo '<h2>'.get_vocab('supprimer site').'</h2>';
echo '<h2 style="text-align:center;">' . get_vocab('sure') . '</h2>';
echo '<h2 style="text-align:center;"><a href="admin_site.php?action=delete&id='.$id.'&confirm=yes">' . get_vocab('YES') . '!</a> <a href="admin_site.php?action=delete&id='.$id.'&confirm=no">' . get_vocab('NO') . '!</a></h2>';
} else {
if ($_GET['confirm']=='yes') {
grr_sql_command("delete from ".TABLE_PREFIX."_site where id='".$_GET['id']."'");
grr_sql_command("delete from ".TABLE_PREFIX."_j_site_area where id_site='".$_GET['id']."'");
grr_sql_command("delete from ".TABLE_PREFIX."_j_useradmin_site where id_site='".$_GET['id']."'");
grr_sql_command("update ".TABLE_PREFIX."_utilisateurs set default_site = '-1' where default_site='".$_GET['id']."'");
$test = grr_sql_query1("select VALUE from ".TABLE_PREFIX."_setting where NAME='default_site'");
if ($test==$_GET['id'])
grr_sql_command("delete from ".TABLE_PREFIX."_setting where NAME='default_site'");
// On affiche le tableau des sites
read_sites();
} else {
// On affiche le tableau des sites
read_sites();
}
}
}
示例9: grrDelOverloadFromEntries
grrDelOverloadFromEntries($id_overload);
$sql = "DELETE FROM " . TABLE_PREFIX . "_overload WHERE id={$id_overload};";
grr_sql_command($sql);
}
//OK, nothing there, lets blast it away
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_area WHERE id={$id_area}");
grr_sql_command("update " . TABLE_PREFIX . "_utilisateurs set default_area = '-1', default_room = '-1' WHERE default_area='" . $id_area . "'");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_area_periodes WHERE id_area={$id_area}");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_useradmin_area WHERE id_area={$id_area}");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_type_area WHERE id_area={$id_area}");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_user_area WHERE id_area={$id_area}");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_j_site_area WHERE id_area={$id_area}");
$test = grr_sql_query1("select VALUE from " . TABLE_PREFIX . "_setting WHERE NAME='default_area'");
if ($test == $id_area) {
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_setting WHERE NAME='default_area'");
grr_sql_command("DELETE FROM " . TABLE_PREFIX . "_setting WHERE NAME='default_room'");
// Settings
require_once "./include/settings.class.php";
//Chargement des valeurs de la table settingS
if (!Settings::load()) {
die("Erreur chargement settings");
}
}
//Redirect back to the admin page
header("Location: admin_room.php?id_site={$id_site}");
die;
} else {
//There are rooms left in the area
//print the page header
print_header("", "", "", $type = "with_session");
//print_banner("", "", "", "", $type = "with_session", $page = "admin");
示例10:
}
// On fait l'action si l'id/area a été validé.
if ( $arearight == True )
{
$sql = "update ".TABLE_PREFIX."_overload set
fieldname='".protect_data_sql($fieldname)."',
fieldtype='".protect_data_sql($fieldtype)."',
obligatoire='".$obligatoire."',
confidentiel='".$confidentiel."',
affichage='".$affichage."',
overload_mail='".$overload_mail."',
fieldlist='".protect_data_sql($fieldlist)."'
where id=$id_overload;";
if (grr_sql_command($sql) < 0) fatal_error(0, "$sql \n\n" . grr_sql_error());
}
}
// X- On affiche la première ligne du tableau avec les libelles.
$html = get_vocab("explication_champs_additionnels")."\n";
$html .= "<form method=\"post\" action=\"admin_overload.php\" >\n<table border=\"0\">";
$html .= "<tr><td>".get_vocab("match_area").get_vocab("deux_points")."</td>\n";
$html .= "<td>".get_vocab("fieldname").get_vocab("deux_points")."</td>\n";
$html .= "<td>".get_vocab("fieldtype").get_vocab("deux_points")."</td>\n";
$html .= "<td><span class='small'>".get_vocab("champ_obligatoire")."</span></td>\n";
$html .= "<td><span class='small'>".get_vocab("affiche_dans_les vues")."</span></td>\n";
$html .= "<td><span class='small'>".get_vocab("affiche_dans_les mails")."</span></td>\n";
$html .= "<td><span class='small'>".get_vocab("champ_confidentiel")."</span></td>\n";
$html .= "<td> </td></tr>\n";
示例11: verif_display_email
$verif_display_email = verif_display_email(getUserName(), $room_id);
if ($verif_display_email)
$option_affiche_nom_prenom_email = "withmail";
else
$option_affiche_nom_prenom_email = "nomail";
// Si l'utilisateur est administrateur, possibilité de modifier le statut de la réservation (en cours / libérée)
if (($fin_session == 'n') and (getUserName()!='') and (authGetUserLevel(getUserName(),$room_id) >= 3) and (isset($_GET['ok'])))
{
if (!$was_del)
{
if ($reg_statut_id != "") {
$upd1 = "update ".TABLE_PREFIX."_entry set statut_entry='-' where room_id = '".$room_id."'";
if (grr_sql_command($upd1) < 0) return 0;
$upd2 = "update ".TABLE_PREFIX."_entry set statut_entry='$reg_statut_id' where id = '".$id."'";
if (grr_sql_command($upd2) < 0) return 0;
}
if ((isset($_GET["envoyer_mail"])) and (getSettingValue("automatic_mail") == 'yes')) {
$_SESSION['session_message_error'] = send_mail($id,7,$dformat);
if ($_SESSION['session_message_error'] == "") {
$_SESSION['displ_msg'] = "yes";
$_SESSION["msg_a_afficher"] = get_vocab("un email envoye")." ".$_GET["mail_exist"];
}
}
header("Location: ".$_GET['back']."");
die();
}
}
#If we dont know the right date then make it up
if(!isset($day) or !isset($month) or !isset($year))
示例12: mrbsCreateRepeatEntry
/** mrbsCreateRepeatEntry()
*
* Creates a repeat entry in the data base
*
* $starttime - Start time of entry
* $endtime - End time of entry
* $rep_type - The repeat type
* $rep_enddate - When the repeating ends
* $rep_opt - Any options associated with the entry
* $room_id - Room ID
* $beneficiaire - beneficiaire
* $beneficiaire_ext - beneficiaire extérieur
* $creator - celui aui a créé ou modifié la réservation.
* $name - Name
* $type - Type (Internal/External)
* $description - Description
*$rep_jour_c - Le jour cycle d'une réservation, si aucun 0
*
* Returns:
* 0 - An error occured while inserting the entry
* non-zero - The entry's ID
*/
function mrbsCreateRepeatEntry($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt,
$room_id, $creator, $beneficiaire, $beneficiaire_ext, $name, $type, $description, $rep_num_weeks,$overload_data, $rep_jour_c)
{
$overload_data_string = "";
$area_id = mrbsGetAreaIdFromRoomId($room_id);
$overload_fields_list = mrbsOverloadGetFieldslist($area_id);
foreach ($overload_fields_list as $field=>$fieldtype)
{
$id_field = $overload_fields_list[$field]["id"];
if (array_key_exists($id_field,$overload_data))
{
// $begin_string = "<".$id_field.">"; //tructruc
// $end_string = "</".$id_field.">"; //tructruc
$begin_string = "@".$id_field."@";
$end_string = "@/".$id_field."@";
// $overload_data_string .= $begin_string.base64_encode($overload_data[$id_field]).$end_string; // tructruc
$overload_data_string .= $begin_string.urlencode($overload_data[$id_field]).$end_string; // tructruc
}
}
$sql = "INSERT INTO ".TABLE_PREFIX."_repeat (
start_time, end_time, rep_type, end_date, rep_opt, room_id, create_by, beneficiaire, beneficiaire_ext, type, name, description, rep_num_weeks, overload_desc, jours)
VALUES ($starttime, $endtime, $rep_type, $rep_enddate, '$rep_opt', $room_id, '".protect_data_sql($creator)."','".protect_data_sql($beneficiaire)."','".protect_data_sql($beneficiaire_ext)."', '".protect_data_sql($type)."', '".protect_data_sql($name)."', '".protect_data_sql($description)."', '$rep_num_weeks','".protect_data_sql($overload_data_string)."',".$rep_jour_c.")";
if (grr_sql_command($sql) < 0)
{
return 0;
}
return grr_sql_insert_id("".TABLE_PREFIX."_repeat", "id");
}
示例13: grr_sql_query1
//
// Suppression d'un type de réservation
//
if ((isset($_GET['action_del'])) and ($_GET['js_confirmed'] ==1) and ($_GET['action_del']='yes')) {
// faire le test si il existe une réservation en cours avec ce type de réservation
$type_id = grr_sql_query1("select type_letter from ".TABLE_PREFIX."_type_area where id = '".$_GET['type_del']."'");
$test1 = grr_sql_query1("select count(id) from ".TABLE_PREFIX."_entry where type= '".$type_id."'");
$test2 = grr_sql_query1("select count(id) from ".TABLE_PREFIX."_repeat where type= '".$type_id."'");
if (($test1 != 0) or ($test2 != 0)) {
$msg = "Suppression impossible : des réservations ont été enregistrées avec ce type.";
} else {
$sql = "DELETE FROM ".TABLE_PREFIX."_type_area WHERE id='".$_GET['type_del']."'";
if (grr_sql_command($sql) < 0) {fatal_error(1, "<p>" . grr_sql_error());}
$sql = "DELETE FROM ".TABLE_PREFIX."_j_type_area WHERE id_type='".$_GET['type_del']."'";
if (grr_sql_command($sql) < 0) {fatal_error(1, "<p>" . grr_sql_error());}
}
}
affiche_pop_up($msg,"admin");
echo "<h2>".get_vocab('admin_type.php')."</h2>";
echo get_vocab('admin_type_explications');
echo "<br />\n";
echo "<br />\n";
echo "| <a href=\"admin_type_modify.php?id=0\">".get_vocab("display_add_type")."</a> |\n";
echo "<br />\n";
echo "<br />\n";
$sql = "SELECT id, type_name, order_display, couleur, type_letter, disponible FROM ".TABLE_PREFIX."_type_area
ORDER BY order_display,type_letter";
$res = grr_sql_query($sql);
示例14: grr_sql_query1
$res = grr_sql_query1($sql);
if ($res == -1) {
$sql = "insert into ".TABLE_PREFIX."_j_useradmin_area (login, id_area) values ('$reg_admin_login',$id_area)";
if (grr_sql_command($sql) < 0) {fatal_error(1, "<p>" . grr_sql_error());} else {$msg=get_vocab("add_user_succeed");}
} else {
$msg = get_vocab("warning_exist");
}
}
}
if ($action) {
if ($action == "del_admin") {
unset($login_admin); $login_admin = $_GET["login_admin"];
$sql = "DELETE FROM ".TABLE_PREFIX."_j_useradmin_area WHERE (login='$login_admin' and id_area = '$id_area')";
if (grr_sql_command($sql) < 0) {fatal_error(1, "<p>" . grr_sql_error());} else {$msg=get_vocab("del_user_succeed");}
}
}
echo "<h2>".get_vocab('admin_right_admin.php').grr_help("aide_grr_administateur_restreint")."</h2>\n";
echo "<p><i>".get_vocab("admin_right_admin_explain")."</i></p>\n";
// Affichage d'un pop-up
affiche_pop_up($msg,"admin");
# Table with areas.
echo "<table><tr>\n";
$this_area_name = "";
# Show all areas
echo "<td ><p><b>".get_vocab("areas")."</b></p>\n";
$out_html = "<form id=\"area\" action=\"admin_right_admin.php\" method=\"post\"><div><select name=\"area\" onchange=\"area_go()\">\n";
示例15: grr_opensession
//.........这里部分代码省略.........
$sql .= " password = '' and ";
}
$sql .= " etat != 'inactif'";
$res_user = grr_sql_query($sql);
$num_row = grr_sql_count($res_user);
if ($num_row == 1) {
// L'utilisateur est présent dans la base locale
if ($sso == "lcs") {
// Mise à jour des données
$nom_user = $tab_login["nom"];
$email_user = $tab_login["email"];
$prenom_user = $tab_login["fullname"];
// On met à jour
$sql = "UPDATE " . TABLE_PREFIX . "_utilisateurs SET\n\t\t\t\tnom='" . protect_data_sql($nom_user) . "',\n\t\t\t\tprenom='" . protect_data_sql($prenom_user) . "',\n\t\t\t\temail='" . protect_data_sql($email_user) . "'\n\t\t\t\twhere login='" . protect_data_sql($_login) . "'";
} else {
if ($_user_ext_authentifie == "cas") {
if (Settings::get("ldap_statut") != '' && @function_exists("ldap_connect") && @file_exists("include/config_ldap.inc.php")) {
$auth_ldap = 'yes';
}
$nom_user = $tab_login["user_nom"];
$email_user = $tab_login["user_email"];
$prenom_user = $tab_login["user_prenom"];
if ($nom_user != '') {
// On détecte si Nom, Prénom ou Email ont changé,
// Si c'est le cas, on met à jour les champs
$req = grr_sql_query("SELECT nom, prenom, email from " . TABLE_PREFIX . "_utilisateurs where login ='" . protect_data_sql($_login) . "'");
$res = mysqli_fetch_array($req);
$nom_en_base = $res[0];
$prenom_en_base = $res[1];
$email_en_base = $res[2];
if (strcmp($nom_en_base, $nom_user) != 0 || strcmp($prenom_en_base, $prenom_user) != 0 || strcmp($email_en_base, $email_user) != 0) {
// Si l'un des champs est différent, on met à jour les champs
$sql = "UPDATE " . TABLE_PREFIX . "_utilisateurs SET\n\t\t\t\t\t\tnom='" . protect_data_sql($nom_user) . "',\n\t\t\t\t\t\tprenom='" . protect_data_sql($prenom_user) . "',\n\t\t\t\t\t\temail='" . protect_data_sql($email_user) . "'\n\t\t\t\t\t\twhere login='" . protect_data_sql($_login) . "'";
if (grr_sql_command($sql) < 0) {
fatal_error(0, get_vocab("msg_login_created_error") . grr_sql_error());
}
//Comme les données de la base on été changés, on doit remettre à jour la variable $row,
//Pour que les données mises en sessions soient les bonnes
//on récupère les données de l'utilisateur
$sql = "SELECT upper(login) login, password, prenom, nom, statut, now() start, default_area, default_room, default_style, default_list_type, default_language, source, etat, default_site\n\t\t\t\t\t\tFROM " . TABLE_PREFIX . "_utilisateurs\n\t\t\t\t\t\tWHERE login = '" . protect_data_sql($_login) . "' and\n\t\t\t\t\t\tsource = 'ext' and\n\t\t\t\t\t\tetat != 'inactif'";
$res_user = grr_sql_query($sql);
$num_row = grr_sql_count($res_user);
if ($num_row != 1) {
return "2";
}
}
}
}
}
if (grr_sql_command($sql) < 0) {
fatal_error(0, get_vocab("msg_login_created_error") . grr_sql_error());
}
// on récupère les données de l'utilisateur dans $row
$row = grr_sql_row($res_user, 0);
} else {
// L'utilisateur n'est pas présent dans la base locale ou est inactif
// ou possède un mot de passe (utilisateur local GRR)
// On teste si un utilisateur porte déjà le même login
$test = grr_sql_query1("SELECT login FROM " . TABLE_PREFIX . "_utilisateurs WHERE login = '" . protect_data_sql($_login) . "'");
if ($test != '-1') {
return "3";
} else {
//Aucun utilisateur dans la base locale ne porte le même login. On peut continuer la procédure d'importation
//1er cas : LCS.
if ($sso == "lcs") {
if ($_statut == 'aucun') {