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

« back to all changes in this revision

Viewing changes to ivle/webapp/tos/media/tos.js

  • Committer: Matt Giuca
  • Date: 2010-07-22 02:12:36 UTC
  • mfrom: (1812.1.13 late-submit)
  • Revision ID: matt.giuca@gmail.com-20100722021236-k8kt4cqdtywzpk24
Merge from trunk late-submit.
Students may now submit projects after the deadline, but they are warned that the submission is late.
Lecturers are now given data on which submissions were made late, and how many days.
(LP: #598346)

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
    /* TEMP */
80
80
    var tos_acceptbuttons = document.getElementById("tos_acceptbuttons");
81
81
    dom_removechildren(tos_acceptbuttons);
82
 
    /* Refresh the page; as the user is now (apparently) logged in */
83
 
    window.location.href = window.location.href;
 
82
 
 
83
    try
 
84
    {
 
85
        response = JSON.parse(xhr.responseText);
 
86
    }
 
87
    catch (e)
 
88
    {
 
89
        response = {'response': 'parse-failure'};
 
90
    }
 
91
 
 
92
    if (response.response == 'usrmgt-failure')
 
93
    {
 
94
    tos_acceptbuttons.appendChild(dom_make_text_elem("p",
 
95
        "Error connecting to User Management server. Please try again later.")); 
 
96
    }
 
97
    else if (response.response == 'parse-failure')
 
98
    {
 
99
    tos_acceptbuttons.appendChild(dom_make_text_elem("p",
 
100
        "Error connecting to server. Please try again later. "));
 
101
    }
 
102
    else if (response.response == 'error')
 
103
    {
 
104
    tos_acceptbuttons.appendChild(dom_make_text_elem("p",
 
105
        "Error activating user: " + response.message));
 
106
    }
 
107
    else
 
108
    {
 
109
        /* Refresh the page; as the user is now (apparently) logged in */
 
110
        window.location.href = parse_url(window.location.href).args["url"] || "/";
 
111
    }
84
112
}
85
113
 
86
114
function decline_license()
87
115
{
88
116
    /* Redirect to the logout page */
89
 
    window.location.href = app_path("logout");
 
117
    window.location.href = app_path("+logout");
90
118
}