1. 17 Apr, 2007 1 commit
  2. 07 Mar, 2007 1 commit
  3. 23 Feb, 2007 1 commit
  4. 14 Feb, 2007 1 commit
  5. 12 Feb, 2007 1 commit
    • Leigh Stoller's avatar
      * Replace the argument processing code in all pages. Currently we rely on · 48acc8e3
      Leigh Stoller authored
        register_globals=1 to turn POST/GET/COOKIES arguments in local variables.
        This is known to be a terrible security risk, and we keep saying we are
        going to fix it, and now I am. In order to accomplish this on a
        transitional basis (since I don't want the entire web interface to stop
        working while I debug it), and because the code just needs the cleanup, I
        am doing it like this: Each page will sport new declarations at the top:
      
      	RequiredPageArguments("experiment", PAGEARG_EXPERIMENT,
                                    "template",   PAGEARG_TEMPLATE,
                                    "instance",   PAGEARG_INSTANCE,
                                    "metadata",   PAGEARG_METADATA,
                                    "osinfo",     PAGEARG_OSINFO,
                                    "image",      PAGEARG_IMAGE,
                                    "project",    PAGEARG_PROJECT,
                                    "group",      PAGEARG_GROUP,
                                    "user",       PAGEARG_USER,
      			      "node",       PAGEARG_NODE,
      			      "yesno",      PAGEARG_BOOLEAN,
      			      "message",    PAGEARG_STRING,
      			      "age",        PAGEARG_INTEGER,
                                    "cost",       PAGEARG_NUMERIC,
                                    "formfields", PAGEARG_ARRAY,
                                    "unknown",    PAGEARG_ANYTHING);
      
      	OptionalPageArguments("canceled", PAGEARG_BOOLEAN);
      
        The first token in each pair is the name of the global variable to
        set, and the second token is the type. So, for "experiment" we look at
        the URL for a pid/eid or exptidx, etc, sanity check them (safe for a
        DB query), and then try to find that experiment in the DB. If it maps
        to an experiment, set global variable $experiment to the object. Since
        its a required argument, produce an error if not supplied. Similar
        treatment for optional arguments, with the obvious difference.
      
        The goal is to have ALL argument processing in one place, consistent,
        and correct. I've found numerous places where we leak unchecked
        arguments into queries. It also cuts out a lot of duplicated code.
      
      * To make the above easier to deal with, I've been replacing lots of
        hardcoded URLS in the code of the form:
      
      	foo.php3?pid=$pid&eid=$eid ...
      
        with
      
              CreateURL("foo", $experiment)
      
        which creates and returns the neccessary url string, by looking at
        the type of its arguments (experiment, template, instance, etc.)
      
        Eventually plan to replace them all so that URL handling throughout
        the code is all defined in one place (all the new URL code is in
        url_defs.php).
      
      * I have cranked up error reporting to tell me anytime a variable is
        used before it is initialized, plus a bunch of other stuff that PHP
        deems improper. Think of it like -Wall ... and boy we get a lot of
        warnings.  A very large percentage of the diffs are to fix all these
        warnings.
      
        The warnings are currently going to /usr/testbed/log/php-errors.log,
        and I'll be adding a script to capture them each night and mail them
        to tbops. This file also gets errors (this will be a change for
        developers; rather then seeing errors and warnings dumped in the
        middle of web pages, they will go to this file instead).
      
      * Major refactoring of the code. More objects (nodes, images, osids).
        Moving tons of queries into the objects in the hopes of someday
        getting to a point where we can split the web interface onto a
        different server.  Lots of general cleanup.
      48acc8e3
  6. 30 Jan, 2007 1 commit
  7. 10 Jan, 2007 1 commit
  8. 21 Dec, 2006 1 commit
  9. 20 Dec, 2006 1 commit
  10. 27 Nov, 2006 1 commit
    • Leigh Stoller's avatar
      Call this commit "Snow in Corvallis" ... · 4998b2d7
      Leigh Stoller authored
      The major functional change in this revision is converting from user
      selected UIDs to system selected UIDs. This is controlled by the
      variable $USERSELECTUIDS in defs/defs.php3.in which is now set to
      zero, so system selected UIDs is the default.
      
      The algo for creating the uid is to take the email address, strip the
      @whatever from it, squeeze out dots and dashes and underlines, and
      make sure any +foo tokens are removed. Then make sure it is unique by
      taking the first 5 characters and then adding a 3 digit number,
      derived by checking the DB to see what exists.
      
      Since we will want to (more often) change the UID selected, there is a
      new admin only menu option on the Show User page. It calls the backend
      script to do the work (sbin/changeuid).
      
      The login page now defaults to storing and showing the email address
      for login, rather then the UID. It will still accept either one though
      (has for a long time).
      
      Along the way I also reorg'ed a number of pages to use the new user,
      group, and project classes and moved some common functionality into
      the class defs.
      
      Also changed the way addpubkey is called, to avoid some confusion.
      4998b2d7
  11. 15 Jun, 2006 1 commit
  12. 14 Jun, 2006 3 commits
  13. 08 Jun, 2006 1 commit
  14. 23 May, 2006 1 commit
    • Leigh Stoller's avatar
      A little hack for Rob ... add "su as user" capability. When in admin · 7034b6d5
      Leigh Stoller authored
      mode, the User Profile menu has a new "Su as User" option that flips
      you to the target user. You are effectively logged out and logged back
      in as the target.
      
      No going back; you have to log out to return to your former self. That
      would be too much work for something that is a rare event.
      7034b6d5
  15. 08 May, 2006 1 commit
  16. 05 May, 2006 2 commits
  17. 19 Dec, 2005 1 commit
    • Leigh Stoller's avatar
      Add support for moving deleted users to a deleted users table. This · b4231fbf
      Leigh Stoller authored
      would be no big deal, except that we want to retain user_stats for
      deleted users, and rather then a deleted_user_stats table, I want to
      retain stats for deleted users in the user_stats table, since that
      is a more natural place for them.
      
      The main problem is that we use the login (uid) as the cross table
      reference slot all over the DB, which is fundamentally incorrect, if
      we want to be able reuse uids and still know what historical data
      refers to.
      
      So, I have taken a few baby steps towards weaning us off the uid, and
      towards permanently unique key for users, using the unix_uid integer
      for now, but probably something slightly different later.
      
      The user_stats is now indexed on this new key (called uid_idx in the
      users_stats table) instead of the plain uid.
      
      The unix_uid slot in the users table is no longer an auto_increment
      field, but instead uses the emulab_indicies table for the next
      available index.
      b4231fbf
  18. 15 Dec, 2005 1 commit
  19. 13 Nov, 2005 1 commit
  20. 21 Jul, 2005 1 commit
  21. 20 Apr, 2005 1 commit
  22. 29 Mar, 2005 1 commit
  23. 28 Mar, 2005 1 commit
    • Leigh Stoller's avatar
      Implement a cross machine login so that user is automatically logged · 9310dedb
      Leigh Stoller authored
      into the Wiki when clicking on the My Wiki's link. Works like this:
      
      * The My Wiki's link points to new page, gotowiki.php3, on boss.
      
      * The gotowiki page looks for a new cookie in the user's browser
        which holds a key (the usual random data run through md5).
      
      * If the key does not exist, generate it and store it in the user
        browser (expires when browser is closed or emulab login times out).
        Also invoke backend script wikixlogin, which will send the key over
        to the wiki server (via ssh), which will write the key into a file
        named by the user account.
      
      * The user's browser is redirected to the wiki server's login script
        (twiki/bin/newlogon), but instead of username and password, we send
        over username and key (as well as redurl= parameter which is the
        page on the wiki server to redirect to later).
      
      * The new login script looks for this case, and opens the file named
        by the user and compares the key it gets with what is in the file.
        If they match, the user login succeeds and the browser is once again
        redirected, but this time to the page it wants on the wiki server.
        If the key does not match, the browser is redirected to the login
        page (so user can enter username password normally). The redurl
        parameter is passed along as well.
      
      * Subsequent clicks on My Wiki's will not need to invoke the backend
        script, since the cookie will be in the browser.
      9310dedb
  24. 25 Mar, 2005 1 commit
    • Leigh Stoller's avatar
      Okay, I think I am finally done with WikiWhacking (or WhackingTheWiki?) · 90dcbbe2
      Leigh Stoller authored
      for the near future. Two big changes:
      
      * Add WikiOnly accounts. An external user can register for an account on
        the wiki. Rather then use the registration stuff that comes with TWiki,
        redirect to new Emulab web page so we can manage all of the wiki accounts
        from one place. I modified the joinproject page to spit out a subset of
        the required fields so that its simple to get a wiki only account (just a
        few things to fill in).
      
        In keeping with current security practices, we still generate a
        verification email message to ensure the email address works. However,
        when the user completes the verification, the wiki account is created right
        away, rather then waiting for someone to approve it (since that would
        defeat the entire point of the wiki).
      
        Aside: I have not thought much about the conversion from a wiki-only
        account to a real account. That is going to happen, and it would be nice
        if that step did not require one of use to go in and hack the DB. Will
        cross that moat later.
      
        Aside: Rather beat up on the modify user info page too much, I continue
        to spit out the same form, but mark most of the fields as not required,
        and allow wiki-only people to not specify them.
      
      * Both the joinproject and newproject pages sport a new WikiName field so
        that users can select their own WikiName. I added some JavaScript to
        both pages that generate a suitable wikiname from the FullName field, so
        that as soon as the user clicks out of the FullName, a default wikiname is
        inserted in the field.
      
        Both pages verify the wikinames by checking to make sure it is not
        already in use, and that it meets the WikiRules for WikiTopic names.
        (someone please shoot me if I continue to use WikiNotation).
      90dcbbe2
  25. 21 Mar, 2005 1 commit
  26. 29 Apr, 2004 1 commit
    • Leigh Stoller's avatar
      Add prelim support for using linktest. Because of problems, this is · 6cdccbd2
      Leigh Stoller authored
      currently available to only people with stud=1 status in the DB.
      
      * www/tbauth.php3: Add a STUDLY() function to check that bit.
      
      * www/linktest.php3: New page to run linktest on the fly. The level
        defaults to the current level in the experiments table, but you can
        override that via the form on the page.
      
      * www/showexp.php3: Add link to aforementioned page. STUDLY() only.
      
      * www/beginexp_form.php3: Add an option (selection) to set the linktest
        level for create/swapin. Defaults to 0 (no linktest). STUDLY() only.
      
      * www/editexp.php3: Add an option to edit the default linktest level
        for an experiment. STUDLY() only.
      
      * tbsetup/batchexp.in and tbsetup/swapexp.in: Add code to optionally run
        the linktest, sending email if it fails (exists with non-zero status).
        Failure does not affect the swapin.
      6cdccbd2
  27. 20 Jan, 2004 2 commits
  28. 16 Dec, 2003 1 commit
  29. 10 Dec, 2003 1 commit
  30. 09 Dec, 2003 1 commit
    • Leigh Stoller's avatar
      Add drop down menu to approve project form that allows admin person to · 9d882479
      Leigh Stoller authored
      select the default user interface for a project. The choice is current
      'emulab or 'plab', defaults to 'emulab'. New users that join emulab
      get the default user interface from the first project they join.
      
      Also generalize the plab_user bit as new "user_interface" slot of the
      users table, which is an enum of interface tokens, currently either
      'emulab' or 'plab', defaults to 'emulab'. The plab_user bit will be
      removed later.
      9d882479
  31. 05 Dec, 2003 1 commit
  32. 04 Dec, 2003 1 commit
  33. 03 Dec, 2003 1 commit
  34. 02 Dec, 2003 1 commit
  35. 01 Dec, 2003 2 commits
    • Leigh Stoller's avatar
      Allow user to specify email address when logging in. Some minor reorg · 41d37ee8
      Leigh Stoller authored
      of the CHECKEMAIL function as a result.
      41d37ee8
    • Leigh Stoller's avatar
      Fix glitch with switching between browsers. Stems from the goal of not · 0efa7677
      Leigh Stoller authored
      switching the menu when user switches between http and https (since
      the secret cookie is not transferred in http, we have no way of
      actually knowing the user is logged in from the browser). So, add
      another cookie that is a crc32 hash of the real cookie, and trasnfer
      that in http mode. A valid crc32 hash simply indicates that the user
      is almost certainly logged in from the browser (but does not impart
      any privs until we get the real cookie), while the absence of the
      crc32 or a mismatch indicates that user is almost certainly *not*
      logged in from the browser, and so we draw the usual "not logged in"
      page.
      0efa7677