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

« back to all changes in this revision

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

  • Committer: mattgiuca
  • Date: 2008-02-15 04:45:12 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:472
db.py: No longer exceptions if password is not supplied.
makeuser: Converted explicit args into kwargs which are simply forwarded along
    to db. Makeuser db NO LONGER accepts "force" argument (which used to
    delete and replace login rows). This is dangerous, and we have removed the
    delete user functionality altogether - because we never delete users.
makeuser.py (script): Major change. Replaced the command-line interface so it
    now only takes 3 required arguments, and a bunch of optional arguments
    getopts style.
    All the arguments are specified at the top; the rest of the code works
    with these data structures so they are only specified in one place
    (including all the work of putting them into a dict and passing it to the
    database).
    Note that makeuser.py is a *second* point of control for the list of the
    login fields (the other is in db.DB.login_fields_list). This is by design,
    because there is a semantic difference between "what fields are in the db"
    and "what arguments should we accept on the command line".

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
            query_string += "&" + encodeURIComponent(arg_key) + "=" +
279
279
                encodeURIComponent(arg_val);
280
280
    }
281
 
    if (query_string == "")
282
 
        query_string = null;
283
 
    else
 
281
    if (query_string != "")
284
282
        /* Drop the first "&" */
285
283
        query_string = query_string.substr(1);
286
284
 
321
319
    else if (("args" in obj) && obj.args != null)
322
320
        query_string = make_query_string(obj.args);
323
321
 
324
 
    if (query_string != null)
 
322
    if (query_string != "" && query_string != null)
325
323
        url += "?" + query_string;
326
324
 
327
325
    return url;
571
569
            xhr.setRequestHeader("Content-Type", content_type);
572
570
            message = make_query_string(args);
573
571
        }
 
572
        xhr.setRequestHeader("Content-Length", message.length);
574
573
        xhr.send(message);
575
574
    }
576
575
    return xhr;