commit de24be8d422881a7530de91ce8288318a16b78f0
Author: hard456 <janpalcut@seznam.cz>
Date:   Mon Jun 10 16:51:43 2019 +0200

    Re #7580 správa uživatelů

diff --git a/old/html/multidic/app/webroot/administration.php b/old/html/multidic/app/webroot/administration.php
index 2d27c51..711d276 100644
--- a/old/html/multidic/app/webroot/administration.php
+++ b/old/html/multidic/app/webroot/administration.php
@@ -27,7 +27,7 @@ if (!kontrola_pristupu(2)) {
 
    <div class="nadpis_sekce">
      <i>Přihlášen:</i><br />
-     <?php echo "".$ses_name." ".$ses_surname."\n"?>
+     <?php echo "".@$_SESSION['ses_name']." ".@$_SESSION['ses_surname']."\n"?>
      <br />
      <?php if(kontrola_pristupu(3)) echo "Administrátor";
            else echo "Uživatel (smí i zapisovat)";?>
@@ -152,11 +152,11 @@ if (!kontrola_pristupu(2)) {
 <div id="content">
  <div class="content_home">
 
-   <?php $cesta = "./administration/";
+   <?php $cesta = "administration/";
    
   // pr($_);
    
-  switch($nav_id) {
+  switch(@$_REQUEST['nav_id']) {
     case("add_user") :
       require_once($cesta."add_user.php");
     break;
diff --git a/old/html/multidic/app/webroot/administration/add_user.php b/old/html/multidic/app/webroot/administration/add_user.php
index b18915b..a4bdf33 100644
--- a/old/html/multidic/app/webroot/administration/add_user.php
+++ b/old/html/multidic/app/webroot/administration/add_user.php
@@ -2,179 +2,101 @@
 
 require_once("./administration/user.php");
 
-if (!Empty($action) && $action == "insert_new_user") {
+if(isset($_REQUEST['submit_btn'])){
+        $zobrazit_znovu = true;
 
-  $zobrazit_znovu = true;
-  
-  if (Empty($name)) {
-    print_hlasku("Jméno musíte vyplnit");
-  }
-  else if (Empty($surname)) {
-    print_hlasku("Příjmení musíte vyplnit");
-  }
-  else if (Empty($email)) {
-    print_hlasku("E-mail musíte vyplnit");
-  }
-  else if (!ERegI("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,5}$", $email)) {
-    print_hlasku("E-mailová adresa není ve správném tvaru.");
-  }
-  else if (Empty($privileges)) {
-    print_hlasku("Práva musíte vyplnit");
-  }
-  else if ($privileges != 1 && $privileges != 2 && $privileges != 3) {
-    print_hlasku("Práva: Zadejte 1 = jen čtení, 2 = čtení i zápis nebo 3 = admin.");
-  }
-  else if (Empty($nick)) {
-    print_hlasku("Nick musíte vyplnit");
-  }
-  else if (Empty($password) || Empty($password2)) {
-    print_hlasku("Heslo i heslo pro kontrolu musíte vyplnit");
-  }
-  else if ($password != $password2) {
-    print_hlasku("Heslo a heslo pro kontrolu se neshoduje");
-  }
-  else {
-    if (nick_exists($nick)) {
-      print_hlasku("Uživatel s takovým nickem již existuje, zvolte si prosím jiný");
+        if (Empty(@$_REQUEST['name'])) {
+            print_hlasku("Jméno musíte vyplnit");
+        }
+        else if (Empty(@$_REQUEST['surname'])) {
+            print_hlasku("Příjmení musíte vyplnit");
+        }
+        else if (Empty(@$_REQUEST['email'])) {
+            print_hlasku("E-mail musíte vyplnit");
+        }
+        else if (Empty(@$_REQUEST['privileges'])) {
+            print_hlasku("Práva musíte vyplnit");
+        }
+        else if (@$_REQUEST['privileges'] != 1 && @$_REQUEST['privileges'] != 2 && @$_REQUEST['privileges'] != 3) {
+            print_hlasku("Práva: Zadejte 1 = jen čtení, 2 = čtení i zápis nebo 3 = admin.");
+        }
+        else if (Empty(@$_REQUEST['nick'])) {
+            print_hlasku("Nick musíte vyplnit");
+        }
+        else if (Empty(@$_REQUEST['password']) || Empty(@$_REQUEST['password2'])) {
+            print_hlasku("Heslo i heslo pro kontrolu musíte vyplnit");
+        }
+        else if (@$_REQUEST['password'] != @$_REQUEST['password2']) {
+            print_hlasku("Heslo a heslo pro kontrolu se neshoduje");
+        }
+        else {
+            if (nick_exists(@$_REQUEST['nick'])) {
+                print_hlasku("Uživatel s takovým nickem již existuje, zvolte si prosím jiný");
+            }
+            else {
+                insert_user(@$_REQUEST['name'], @$_REQUEST['surname'], @$_REQUEST['city'], @$_REQUEST['email'], @$_REQUEST['nationality'], @$_REQUEST['privileges'], @$_REQUEST['nick'], @$_REQUEST['password']);
+                $zobrazit_znovu = false;
+            }
+        }
     }
-    else {
-      insert_user($name, $surname, $city, $email, $nationality, $privileges, $nick, $password);
-      $zobrazit_znovu = false;
-    }
-  }
-}
 
 function znova($string) {
-  global $zobrazit_znovu;
-  if ($zobrazit_znovu)
-    echo ' value="'.$string.'"';
+    global $zobrazit_znovu;
+    if ($zobrazit_znovu)
+        echo ' value="'.$string.'"';
 }
-?>
-<script language="JavaScript">
-	function setFocus(object)
-	{
-	   	object.focus();
-	   	object.select();
-	}
 
-  function validate_new_user_form(form) {
-    new_user_form = form;
-
-    if (new_user_form.name.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(new_user_form.name);
-      return false;
-    }
-    if (new_user_form.surname.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(new_user_form.surname);
-      return false;
-    }
-    if (new_user_form.email.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(new_user_form.email);
-      return false;
-    }
-    if(window.RegExp) {
-      re = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,5}$");
-      if (!re.test(new_user_form.email.value)) {
-        alert("Zadaná adresa není správnou adresou elektronické pošty!");
-        setFocus(new_user_form.email);
-        return false;
-      }
-    }
-    if (new_user_form.privileges.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(new_user_form.privileges);
-      return false;
-    }
-    if (edit_user_form.privileges.value != "1" && 
-        edit_user_form.privileges.value != "2" &&
-        edit_user_form.privileges.value != "3") {
-      alert("Práva: Zadejte 1 = jen čtení, 2 = čtení i zápis nebo 3 = admin.");
-      setFocus(new_user_form.privileges);
-      return false;
-    }
-    if (new_user_form.nick.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(new_user_form.nick);
-      return false;
-    }
-    if (new_user_form.password.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(new_user_form.password);
-      return false;
-    }
-    if (new_user_form.password2.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(new_user_form.password2);
-      return false;
-    }
-    if (new_user_form.password.value != new_user_form.password2.value) {
-      alert("Heslo pro kontorlu se neshoduje...");
-      setFocus(new_user_form.password);
-      return false;
-    }
-    
-    return true;
-  }
-</script>
+?>
 
 <table>
     <thead align="center"> <h3 class="nadpis2">Vlož nového uživatele</h3> </thead>
     <tbody>
-    <form action="" method="POST" name="new_user_form" onSubmit="return validate_new_user_form(this)">
+    <form method="POST" name="new_user_form">
       <table border="0">
       <tr class="akt">
         <td>jméno*</td>
-        <td><input type="text" name="name"  size="50" maxlength="50"<?php znova($name)?> /></td>
+        <td><input type="text" name="name"  size="50" maxlength="50"<?php znova(@$_REQUEST['name'])?> /></td>
       </tr>
       <tr class="akt">
         <td>příjmení*</td>
-        <td><input type="text" name="surname"  size="50" maxlength="50"<?php znova($surname)?> /></td>
+        <td><input type="text" name="surname"  size="50" maxlength="50"<?php znova(@$_REQUEST['surname'])?> /></td>
       </tr>
       <tr class="akt">
         <td>město</td>
-        <td><input type="text" name="city"  size="50" maxlength="70"<?php znova($city)?> /></td>
+        <td><input type="text" name="city"  size="50" maxlength="70"<?php znova(@$_REQUEST['city'])?> /></td>
       </tr>
       <tr class="akt">
         <td>e-mail*</td>
-        <td><input type="text" name="email"  size="50" maxlength="80"<?php znova($email)?> /></td>
+        <td><input type="text" name="email"  size="50" maxlength="80"<?php znova(@$_REQUEST['email'])?> /></td>
       </tr>
       <tr class="akt">
         <td>národnost</td>
-        <td><input type="text" name="nationality"  size="50" maxlength="30"<?php znova($nationality)?> /></td>
+        <td><input type="text" name="nationality"  size="50" maxlength="30"<?php znova(@$_REQUEST['nationality'])?> /></td>
       </tr>
       <tr class="akt">
         <td>práva*</td>
-        <td><?php  echo get_privileges_chooser($privileges); ?></td>
+        <td><?php  echo get_privileges_chooser(@$_REQUEST['privileges']); ?></td>
       </tr>
       <tr class="akt">
         <td>nick*</td>
-        <td><input type="text" name="nick"  size="50" maxlength="30"<?php znova($nick)?> /></td>
+        <td><input type="text" name="nick"  size="50" maxlength="30"<?php znova(@$_REQUEST['nick'])?> /></td>
       </tr>
       <tr class="akt">
         <td>heslo*</td>
-        <td><input type="password" name="password"  size="50" maxlength="100" onFocus="setFocus(this)" /></td>
+        <td><input type="password" name="password"  size="50" maxlength="100" /></td>
       </tr>
       <tr class="akt">
         <td>heslo znovu*</td>
-        <td><input type="password" name="password2"  size="50" maxlength="100" onFocus="setFocus(this)" /></td>
+        <td><input type="password" name="password2"  size="50" maxlength="100" /></td>
       </tr>
       <tr class="nadpis_sekce">
-        <td>
-          <input type="hidden" name="action" value="insert_new_user">
-        </td>
-        <td><input type="submit" value="Vlož"></td>
+          <td></td>
+        <td><input type="submit" value="Vlož" name="submit_btn"></td>
       </tr>
     </form>
     </tbody>
   </table>
-  
-  <script language="javascript">
-				<!--
-					var focus = document.new_user_form.name;
-  				focus.focus();
-				-->
-  </script>
 
+<?php
+
+?>
\ No newline at end of file
diff --git a/old/html/multidic/app/webroot/administration/edit_user.php b/old/html/multidic/app/webroot/administration/edit_user.php
index b342535..79330e3 100644
--- a/old/html/multidic/app/webroot/administration/edit_user.php
+++ b/old/html/multidic/app/webroot/administration/edit_user.php
@@ -3,108 +3,53 @@
 
 $vypis_edit = true;
 
-if (!Empty($action) && $action == "edit_user") {
+if(isset($_REQUEST['submit_btn'])){
 
-  if (Empty($name)) {
+  if (Empty(@$_REQUEST['name'])) {
     print_hlasku("Jméno musíte vyplnit");
   }
-  else if (Empty($surname)) {
+  else if (Empty(@$_REQUEST['surname'])) {
     print_hlasku("Příjmení musíte vyplnit");
   }
-  else if (Empty($email)) {
+  else if (Empty(@$_REQUEST['email'])) {
     print_hlasku("E-mail musíte vyplnit");
   }
-  else if (!ERegI("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,5}$", $email)) {
-    print_hlasku("E-mailová adresa není ve správném tvaru.");
-  }
-  else if (Empty($privileges)) {
+  else if (Empty(@$_REQUEST['nick'])) {
     print_hlasku("Práva musíte vyplnit");
   }
-  else if ($privileges != 1 && $privileges != 2 && $privileges != 3) {
+  else if (@$_REQUEST['privileges'] != 1 && @$_REQUEST['privileges'] != 2 && @$_REQUEST['privileges'] != 3) {
     print_hlasku("Práva: Zadejte 1 = jen čtení, 2 = čtení i zápis nebo 3 = admin.");
   }
-  else if (Empty($nick)) {
+  else if (Empty(@$_REQUEST['nick'])) {
     print_hlasku("Nick musíte vyplnit");
   }
-  else if ($password != $password2) {
+  else if (@$_REQUEST['password'] != @$_REQUEST['password2']) {
     print_hlasku("Heslo a heslo pro kontrolu se neshoduje");
   }
   else {
-    update_user($name, $surname, $city, $email, $nationality, $privileges, $nick, $user_id, $password);
+    update_user(@$_REQUEST['name'], @$_REQUEST['surname'], @$_REQUEST['city'], @$_REQUEST['email'], @$_REQUEST['nationality'], @$_REQUEST['privileges'], @$_REQUEST['nick'], @$_REQUEST['user_id'], @$_REQUEST['password']);
     $vypis_edit = false;
   }
 }
-if($vypis_edit){
-
-  $Record      = get_user($user_id);
-  $name        = $Record[1];
-  $surname     = $Record[2];
-  $city        = $Record[3];
-  $email       = $Record[4];
-  $nationality = $Record[5];
-  $privileges  = $Record[9];
-  $nick        = $Record[10];
-  //$password    = $Record["pass"];
-
+if($vypis_edit)
+{
 
+    $Record = get_user(@$_REQUEST['user_id']);
+    $name = $Record[1];
+    $surname = $Record[2];
+    $city = $Record[3];
+    $email = $Record[4];
+    $nationality = $Record[5];
+    $privileges = $Record[9];
+    $nick = $Record[10];
+    //$password    = $Record["pass"];
+}
 ?>
-<script language="JavaScript">
-	function setFocus(object)
-	{
-	   	object.focus();
-	   	object.select();
-	}
 
-  function validate_edit_user_form(form) {
-    edit_user_form = form;
-    if (edit_user_form.name.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(edit_user_form.name);
-      return false;
-    }
-    if (edit_user_form.surname.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(edit_user_form.surname);
-      return false;
-    }
-    if (edit_user_form.email.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(edit_user_form.email);
-      return false;
-    }
-    if(window.RegExp) {
-      re = new RegExp("^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,5}$");
-      if (!re.test(edit_user_form.email.value)) {
-        alert("Zadaná adresa není správnou adresou elektronické pošty!");
-        setFocus(edit_user_form.email);
-        return false;
-      }
-    }
-    if (edit_user_form.privileges.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(edit_user_form.privileges);
-      return false;
-    }
-    if (edit_user_form.privileges.value != "1" && 
-        edit_user_form.privileges.value != "2" &&
-        edit_user_form.privileges.value != "3") {
-      alert("Práva: Zadejte 1 = jen čtení, 2 = čtení i zápis nebo 3 = admin.");
-      setFocus(edit_user_form.privileges);
-      return false;
-    }
-    if (edit_user_form.nick.value == "") {
-      alert("Položku musite vyplnit.");
-      setFocus(edit_user_form.nick);
-      return false;
-    }
-    
-    return true;
-  }
-</script>
 <table>
     <thead align="center"> <h3 class="nadpis2">Uprav uživatele</h3> </thead>
     <tbody>
-    <form action="" method="POST" name="edit_user_form" onSubmit="return validate_edit_user_form(this)">
+    <form action="" method="POST" name="edit_user_form">
       <table border="0">
       <tr class="akt">
         <td>jméno*</td>
@@ -148,21 +93,10 @@ if($vypis_edit){
       </tr>
       <tr>
         <td>
-          <input type="hidden" name="action" value="edit_user">
-          <input type="hidden" name="user_id" value="<?php echo $user_id?>">
+          <input type="hidden" name="user_id" value="<?php echo @$_REQUEST['user_id']?>">
         </td>
-        <td><input type="submit" value="Uprav"></td>
+        <td><input type="submit" value="Uprav" name="submit_btn"></td>
       </tr>
     </form>
     </tbody>
   </table>
-  <script language="javascript">
-				<!--
-					var focus = document.edit_user_form.name;
-  				focus.focus();
-				-->
-  </script>
-  
-<?php
-  }//end of else
-?>
diff --git a/old/html/multidic/app/webroot/administration/list_user.php b/old/html/multidic/app/webroot/administration/list_user.php
index b7ffc19..e783ffc 100644
--- a/old/html/multidic/app/webroot/administration/list_user.php
+++ b/old/html/multidic/app/webroot/administration/list_user.php
@@ -2,14 +2,16 @@
 
 require_once("./administration/user.php");
 
-if (!Empty($action) && $action == "delete_user") {
+
+
+if(isset($_REQUEST['delete-btn'])){
 
 
   $coun_true = 0;
   $coun_false = 0;
-  if (Is_Array($smaz)) {
-    for (Reset($smaz); Current($smaz); Next($smaz)) {
-      if (delete_user(Key($smaz))) $coun_true++;
+  if (Is_Array($_REQUEST['smaz'])) {
+    for (Reset($_REQUEST['smaz']); Current($_REQUEST['smaz']); Next($_REQUEST['smaz'])) {
+      if (delete_user(Key($_REQUEST['smaz']))) $coun_true++;
       else $coun_false++;
     }
   }
@@ -19,8 +21,8 @@ if (!Empty($action) && $action == "delete_user") {
     print_hlasku("Bohužel,$coun_false uživatelů se nepodařilo smazat ($coun_true se podařilo smazat)");
 }
 
-if (!Empty($serad)) {
-    print_table_of_user($order, $od, $limit);
+if(isset($_REQUEST['serad'])){
+    print_table_of_user(@$_REQUEST['order'], @$_REQUEST['od'], @$_REQUEST['limit']);
 }
 else {
   print_table_of_user();
diff --git a/old/html/multidic/app/webroot/administration/user.php b/old/html/multidic/app/webroot/administration/user.php
index 0c04e11..f064aff 100644
--- a/old/html/multidic/app/webroot/administration/user.php
+++ b/old/html/multidic/app/webroot/administration/user.php
@@ -10,7 +10,7 @@ require_once("./functions/dictionary.php");
 function get_row_of_table($Record, $od = 1, $do = 2) {
   $navrat .= "<tr class=\"akt\">\n     ";
   $navrat .= '<td><input type="checkbox" name="smaz['.$Record[0].']" /></td>'.
-             '<td><a href="?nav_id=edit_user&user_id='.$Record[0].'">uprav</a></td>';  
+             '<td><a href="?nav_id=edit_user&user_id='.$Record[0].'">uprav</a></td>';
   for($j=$od;$j<$do;$j++) {
     $navrat .= "<td>";
     $navrat .= "$Record[$j]";
@@ -23,7 +23,7 @@ function get_row_of_table($Record, $od = 1, $do = 2) {
 function get_pocet_uzivatel() {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "SELECT \"IDuser\" FROM \"user\" ";
+  $dotaz = "SELECT IDuser FROM user";
   $spojeni->query($dotaz);
   return $spojeni->num_rows();
 }
@@ -98,21 +98,21 @@ return "<tr class=\"nadpis_sekce\">
 }
 
 function get_foot_of_table() {
-  return '<tr class="nadpis_sekce"><td><input type="submit" name="delete" value="Smaž"></td><td></td>
+  return '<tr class="nadpis_sekce"><td><input type="submit" name="delete-btn" value="Smaž"></td><td></td>
           <td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>';
 }
 
 function print_table_of_user($order = "IDuser", $od = 0, $limit = 30) {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "SELECT * FROM \"user\" ORDER BY \"$order\" OFFSET $od LIMIT $limit";
+  $dotaz = "SELECT * FROM user ORDER BY $order LIMIT $od, $limit";
   $radky = $spojeni->query($dotaz);
   $navrat .= "<h3 class=\"nadpis2\">Výpis uživatelů</h3>";
   $navrat .= get_razeni($order, $od, $limit);
   $navrat .= "<table><form action=\"\" method=\"post\">";
   $navrat .= get_header_of_table();
   while ($spojeni->next_record()) {
-    $navrat .= get_row_of_table($spojeni->Record, 1, 11);
+    $navrat .= get_row_of_table($radky->fetch_array(), 1, 11);
   }
   $navrat .= get_foot_of_table();
   $navrat .= '<input type="hidden" name="action" value="delete_user">';
@@ -125,13 +125,9 @@ function print_table_of_user($order = "IDuser", $od = 0, $limit = 30) {
 function nick_exists($nick) {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "SELECT * FROM \"user\" WHERE nick LIKE '$nick'";
+  $dotaz = "SELECT * FROM user WHERE nick LIKE $nick";
   $spojeni->query($dotaz);
-  if ($spojeni->connection->errno != 0) {
-    print_hlasku($spojeni->Error);
-    return true;
-  }
-  //echo $nick." / ".$spojeni->num_rows();
+
   if ($spojeni->num_rows() == 0)
     return false;
     
@@ -143,23 +139,23 @@ function insert_user($name, $surname, $city, $email, $nationality, $privileges,
   $spojeni = new DB_Sql();
   //$NOW = Date("YmdHis");
   
-  $dotaz = "INSERT INTO \"user\" (\"name\", 
-                              \"surname\",
-                              \"city\",
-                              \"email\",
-                              \"nationality\",
-                              \"number_of_usage\",
-                              \"date_created\",
-                              \"privileges\",
-                              \"nick\",
-                              \"pass\")
+  $dotaz = "INSERT INTO user (name, 
+                              surname,
+                              city,
+                              email,
+                              nationality,
+                              number_of_usage,
+                              date_created,
+                              privileges,
+                              nick,
+                              pass)
                     VALUES ('$name',
                             '$surname',
                             '$city',
                             '$email',
                             '$nationality',
                             '0',
-                            'NOW',
+                            'NOW()',
                             '$privileges',
                             '$nick',
                             '$password')";
@@ -175,7 +171,7 @@ function insert_user($name, $surname, $city, $email, $nationality, $privileges,
 function possible_to_delete_user($user_id) {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "SELECT * FROM dict WHERE usr LIKE '$user_id'";
+  $dotaz = "SELECT * FROM dict WHERE usr LIKE $user_id";
   $spojeni->query($dotaz);
   if ($spojeni->connection->errno != 0) {
     print_hlasku($spojeni->connection->error);
@@ -195,7 +191,7 @@ function delete_user($ID) {
   }
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "DELETE FROM \"user\" WHERE \"IDuser\" = '$ID'";
+  $dotaz = "DELETE FROM user WHERE IDuser = $ID";
   $spojeni->query($dotaz);
   if ($spojeni->connection->errno != 0) {
     return false;
@@ -204,37 +200,39 @@ function delete_user($ID) {
 }
 
 function update_user($name, $surname, $city, $email, $nationality, $privileges, $nick, $user_id, $password) {
+
   require_once("./classes/db.php");
+
   $spojeni = new DB_Sql();
-  $dotaz = "UPDATE \"user\" SET \"name\" = '$name', 
-                            \"surname\" = '$surname',
-                            \"city\" = '$city',
-                            \"email\" = '$email',
-                            \"nationality\" = '$nationality',
-                            \"privileges\" = '$privileges',
-                            \"nick\" = '$nick'";
+  $dotaz = "UPDATE user SET name = '$name', 
+                            surname = '$surname',
+                            city = '$city',
+                            email = '$email',
+                            nationality = '$nationality',
+                            privileges = '$privileges',
+                            nick = '$nick'";
   if (!Empty($password)) {
-    $dotaz .= ", \"pass\" = '$password'";
+    $dotaz .= ", pass = '$password'";
   }
-  $dotaz .= " WHERE \"IDuser\" = '$user_id'";
+  $dotaz .= " WHERE IDuser = '$user_id'";
   
   $spojeni->query($dotaz);
   if ($spojeni->connection->errno != 0) {
     print_hlasku("Uživatel se nepodařilo upravit.");
   }
-  print_hlasku("Uživatel změněn.");
-  echo_zpet_do_uzivatel();
+  else{
+    print_hlasku("Uživatel změněn.");
+    echo_zpet_do_uzivatel();
+  }
 }
 
 function get_user($user_id) {
   require_once("./classes/db.php");
   $spojeni = new DB_Sql();
-  $dotaz = "SELECT * FROM \"user\" WHERE \"IDuser\" LIKE '$user_id'";
+  $dotaz = "SELECT * FROM user WHERE IDuser LIKE $user_id";
   $radky = $spojeni->query($dotaz);
 
-  $spojeni->next_record();
-  
-  return $spojeni->Record;
+  return $spojeni->next_record();
 }
 
 function get_privileges_chooser($privileges = 1) {  
