Password working
diff --git a/ajax/getusers.php b/ajax/getusers.php
index cb8520d..4973cf7 100644
--- a/ajax/getusers.php
+++ b/ajax/getusers.php
@@ -1,5 +1,11 @@
+<option>Selecciona usuari...</option>
+
<?php
require '../php/utils.php';
+
$users = get_users(0);
- foreach ($users as $user) echo "<option value='".$user->id."'>".$user->nomcomplet."</option>\n";
+ foreach ($users as $user) {
+ $nopassword = $user->md5password == "" ? "nopassword" : "";
+ echo "<option class='".$nopassword."' value='".$user->id."'>".$user->nomcomplet."</option>\n";
+ }
?>
diff --git a/ajax/userinfo.php b/ajax/userinfo.php
index 686287d..6a36742 100644
--- a/ajax/userinfo.php
+++ b/ajax/userinfo.php
@@ -2,12 +2,14 @@
require '../php/utils.php';
$user = get_users($_POST['id']);
+ $text_columns = ["nomcomplet", "md5password"];
+
echo '{ ';
$first = true;
foreach ($user as $prop => $value) {
if (!$first) echo ', ';
else $first = false;
- if ($prop == "nomcomplet") echo '"'.$prop.'": "'.$value.'"';
+ if (in_array($prop, $text_columns)) echo '"'.$prop.'": "'.$value.'"';
else echo '"'.$prop.'": '.$value;
}
echo ' }';