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

« back to all changes in this revision

Viewing changes to www/media/common/tos.js

  • Committer: mattgiuca
  • Date: 2008-03-07 15:12:02 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:669
Timestamps are now stored within the program as Python "time" module's
    "struct_time" objects, rather than strings directly from the DB.
    They are parsed into struct_time objects when reading from the db.
    They are formatted into SQL Timestamp strings when writing to the db.
    This allows them to be manipulated and compared within the program.

common.db: _escape now accepts struct_time objects - it formats them into SQL
            time strings.
common.user: The User constructor now parses "acct_exp", "pass_exp" and
            "last_login" fields as timestamp strings, and stores them
            internally as struct_time.
tutorialservice: When recording a submission, the "date" field is now stored
            as a struct_time, not a formatted string.
login.py: When logging in, uncommented call to write last_login to the DB,
            passing the current local time. (This now works correctly).
            Note that this is done after retrieving the user details, so the
            value of last_login stored in the session is the _old_ last login,
            not the new one (this is intentional).

(With Tom Conway).

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
 
 
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
103
 
    {
104
 
        /* Refresh the page; as the user is now (apparently) logged in */
105
 
        window.location.href = parse_url(window.location.href).args["url"] || "/";
106
 
    }
 
82
    /* Refresh the page; as the user is now (apparently) logged in */
 
83
    window.location.href = window.location.href;
107
84
}
108
85
 
109
86
function decline_license()
110
87
{
111
88
    /* Redirect to the logout page */
112
 
    window.location.href = app_path("+logout");
 
89
    window.location.href = app_path("logout");
113
90
}