~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/user-media/settings.js

  • Committer: William Grant
  • Date: 2009-03-17 07:16:03 UTC
  • Revision ID: grantw@unimelb.edu.au-20090317071603-ux5qxbjkpdarvig3
Tags: 0.1.9.10
ivle.interpret.execute_raw() no longer breaks with lots of data.

Previously we uses subprocess' wait(), which doesn't empty the stdout
pipe. It filled up, causing the child to block. We now use communicate()
instead, which select()s and reads the pipes to unblock things.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
            populate(user);
33
33
        }
34
34
    /* Just get details for the logged in user */
35
 
    ajax_call(callback, "userservice", "get_user", {}, "GET");
 
35
    ajax_call(callback, "userservice", "get_user", {"login": settings_login}, "GET");
36
36
    return false;
37
37
}
38
38
 
42
42
    user_data = user;
43
43
    /* Plain text elements (non-editable) */
44
44
    var login = document.getElementById("login");
45
 
    var role = document.getElementById("role");
 
45
    var admin = document.getElementById("admin");
46
46
    var changepassword = document.getElementById("changepassword");
47
47
    var notices = document.getElementById("notices");
48
48
    /* Textbox (input) elements */
60
60
 
61
61
    /* Clear things */
62
62
    dom_removechildren(login);
63
 
    dom_removechildren(role);
 
63
    dom_removechildren(admin);
64
64
    dom_removechildren(changepassword);
65
65
    dom_removechildren(notices);
66
66
 
79
79
        text = ")"
80
80
    login.appendChild(document.createTextNode(text));
81
81
 
82
 
    /* "role" : <p>Your privilege level is <b>rolenm</b>.</p>
83
 
     * Unless rolenm is "student"
 
82
    /* "admin" : <p>Privilege: <strong>administrator</strong></p>
84
83
     */
85
 
    if (user.rolenm != "student")
 
84
    if (user.admin)
86
85
    {
87
 
        text = "Your privilege level is ";
88
 
        role.appendChild(document.createTextNode(text));
89
 
        b = document.createElement("b");
90
 
        text = user.rolenm;
91
 
        b.appendChild(document.createTextNode(text));
92
 
        role.appendChild(b);
93
 
        text = ".";
94
 
        role.appendChild(document.createTextNode(text));
 
86
        text = "Privilege: ";
 
87
        admin.appendChild(document.createTextNode(text));
 
88
        strong = document.createElement("strong");
 
89
        strong.appendChild(document.createTextNode("IVLE administrator"));
 
90
        admin.appendChild(strong);
95
91
    }
96
92
 
97
93
    /* "nick" and "email" boxes */