array (userinfo) * We can't simplify this because some auth schemes (like LDAP) automatically (or it's at least cheaper to) return all the information * Functions like get_user_info allow selection of specifics (in functions_db) * * @param string Field to order by (id_usuario, nombre_real or fecha_registro) * * @return array An array of user information */ function get_users ($order = "nombre_real") { switch ($order) { case "id_usuario": case "fecha_registro": case "nombre_real": break; default: $order = "nombre_real"; } $output = array(); $result = get_db_all_rows_in_table ("tusuario", $order); if ($result !== false) { foreach ($result as $row) { $output[$row["id_usuario"]] = $row; } } return $output; } /** * Sets the last login for a user * * @param string User id */ function update_user_contact ($id_user) { $sql = sprintf ("UPDATE tusuario SET fecha_registro = NOW() WHERE id_usuario = '%s'", $id_user); process_sql ($sql); } /** * Deletes the user * * @param string User id */ function delete_user ($id_user) { $sql = "DELETE FROM tgrupo_usuario WHERE usuario = '".$id_user."'"; $result = process_sql ($sql); if ($result === false) { return false; } $sql = "DELETE FROM tusuario WHERE id_usuario = '".$id_user."'"; $result = process_sql ($sql); if ($result === false) { return false; } return true; } //Reference the global use authorization error to last ldap error. $config["auth_error"] = &$mysql_cache["auth_error"]; ?>