Skip to content
Snippets Groups Projects
Commit 66fcc509 authored by Alfredo Chissotti's avatar Alfredo Chissotti
Browse files

while nell'install

parent 2d10e409
No related branches found
No related tags found
No related merge requests found
......@@ -65,13 +65,18 @@ public class InstallHandler implements HttpHandler {
DBC.insertDom(domain);
// questa chiamata serve ad assicurarsi che l'utente che ha effettuato la
// chiamata sia anche amministratore del dominio
DBC.insertAmministra(user, domain);
JSONArray arrUsers = j.getJSONArray("users");
for (int i = 0; i < arrUsers.length(); i++) {
DBC.insertAmministra(user, domain);
arrUsers.put("\"role\":\"A\",\"passwd\":\""+user+"\",\"user\":\"" + user + "\"");
j.put("users", arrUsers);
int i = 0;
while (i < arrUsers.length()) {
JSONObject userObj = arrUsers.getJSONObject(i);
i++;
String usr = userObj.getString("user");
if (user.equals(usr))
if (user.equals(usr)) {//se l'utente e' colui che ha fatto la chiamata, l'ho gia' sistemato => passo al successivo
continue;
}
if (userObj.getString("role").equals("A")) {
DBC.insertAmministra(usr, domain);
} else if (userObj.getString("role").equals("U")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment