1. 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
  2. 08 Feb, 2007 1 commit
  3. 05 Feb, 2007 1 commit
    • Russ Fish's avatar
      · e56750ff
      Russ Fish authored
      Finished adding machinery and data, probed the first 3/4 of the pages with it.
      
       . Add interspersed action lines to make the {setup,teardown}_forms.list files
         more like scripts, including wget and sql shortcuts.
      
       . Add undo actions so multiple setup/teardown probes don't collide.  Undo the
         state changes after a probe that *DOESN'T FAIL*, due to ignoring the probe
         value given for the input field.  E.g, the first beginexp that succeeds
         uses up the experiment name and blocks all other probes, so the experiment
         has to be deleted again before the next probe is done.
      
       . Add a ! prefix for input_values.list lines to skip the input field entirely.
      
       . Probe both POST input field args, and GET action= args on the same page.
      
       . Change success/failure lines from text snippets to grep patterns.  Give
         failure matching patterns precedence over success.  Finish categorizing
         probe output pages (needed by the probe undo mechanism.)
      
       . Add activation and setup/teardown for probing nodetype, osid, and imageid pages.
      
       . Add analysis of overall success/failure page counts to the probes_msg.
      e56750ff
  4. 02 Feb, 2007 1 commit
  5. 30 Jan, 2007 2 commits
  6. 25 Jan, 2007 1 commit
  7. 24 Jan, 2007 1 commit
  8. 23 Jan, 2007 2 commits
  9. 22 Jan, 2007 1 commit
  10. 19 Jan, 2007 2 commits
  11. 18 Jan, 2007 5 commits
    • Leigh Stoller's avatar
      Fix minor bug. · 99a47a1b
      Leigh Stoller authored
      99a47a1b
    • Leigh Stoller's avatar
    • Leigh Stoller's avatar
      Add autogen of webxxx scripts. · bc1ec6a3
      Leigh Stoller authored
      bc1ec6a3
    • Leigh Stoller's avatar
      Switch to autogen of webxxx scripts. · c3fac28c
      Leigh Stoller authored
      c3fac28c
    • Leigh Stoller's avatar
      Change how the archive stuff is presented in the template instance and · 808f43ec
      Leigh Stoller authored
      run display pages.
      
      * Add new code to archive_control and libarchive to create tags (in
        optional subdirs) of the tags directory. These tags are simply tags
        on the current trunk at the time.
      
      * Change to template instantiate and start/top run code to create a
        "runs" directory. Within the runs directory are subdirs named for
        each runid, and within this directory are start and stop run tags.
        Eventually add some other tags when doing swapmods, but do not have
        that figured out yet.
      
      * Change the viewcvs code to add an "embedded" view of an archive.
        This is just an alternate view that has no header/footer goo, but
        only the actual svn contents. The main reason for this change is
        that the header and footers take up a huge amount of space and
        contribute nothing. Smaller means its easier to add to the instance
        and run show pages.
      
      * Add the above mentioned embedded archive view to the instance and
        run show pages. On the instance page you see the directory of all
        runids, and on the show run page you see the subdir for that run.
      808f43ec
  12. 16 Jan, 2007 1 commit
    • Leigh Stoller's avatar
      Move the bulk (or guts) of newuser and newproject from the web · 16aaa101
      Leigh Stoller authored
      interface to the backend. There are new scripts that can be called
      from the command line:
      
      	newuser xmlfile
      	newproj xmlfile
      
      They both run from small xmlfiles that are generated by the web
      interface from the form data. I also moved user verification to the
      backend so that we do not have duplicated email functions, but that
      was a small change.
      
      Upon error, the xmlfile is saved and sent to tbops so that we can
      rerun the command by hand, rather then force user to fill out form
      again. I also do a better job of putting the form back up intact when
      there are internal errors.
      
      If the user provides an initial public key, that is put into the xml
      file as well and addpubkey is called from newuser instead of the web
      interface. A more general change to addpukey is that it is now
      *always* called as "nobody". This script was a morass of confusion
      cause of having to call it as nobody before the user actually
      exists. In fact, another of my ongoing projects is to reduce the
      number of scripts called as a particular user, but thats a story for
      another day. Anyway, the script is always called as nobody, but we
      pass along the implied user in the environment so that it can do
      permission checks.
      16aaa101
  13. 12 Jan, 2007 5 commits
  14. 10 Jan, 2007 2 commits
  15. 09 Jan, 2007 2 commits
  16. 08 Jan, 2007 3 commits
  17. 05 Jan, 2007 3 commits
    • Leigh Stoller's avatar
      Fix minor bug. · 1237c1f4
      Leigh Stoller authored
      1237c1f4
    • Leigh Stoller's avatar
      Move the core approval code from the web interface to the backend so · 5e25aa17
      Leigh Stoller authored
      that we can run project approval from the command line. Part of the
      ongoing push to get stuff out of php and into the backend ...
      
      The command line is now:
      
      	mkproj [-s] [-h leader_uid] [-m <message> | -f <file>] <pid>
      	switches and arguments:
      	  -s         - silent; do not send approval email to leader
        	  -h <uid>   - switch project leader to specified uid
      	  -m <text>  - Include text in approval email message
      	  -f <file>  - Include text from file in approval email message
      	  <pid>      - project to approve.
      
      Notes:
      
      * The leader can be switched to a new user only at initial project creation.
        Once a project is actually approved (created), its too late. We need
        more stuff in place to change the leader after that, and that code
        is not written yet.
      
      * Email is now sent from the backend script, so easier to recover from
        problems. When invoked from the web interface, the message text will
        be appended to the tberror email if the backend fails for some
        reason.  This should avoid the problem of that text getting lost and
        not being able to recover it.
      
      * The web interface still handles part of project denial internally.
        Move that later.
      5e25aa17
    • Leigh Stoller's avatar
      4960367f
  18. 04 Jan, 2007 1 commit
  19. 03 Jan, 2007 2 commits
    • Leigh Stoller's avatar
      Move most of the password changing code to the backend, as I just did · 32983db4
      Leigh Stoller authored
      for email changes. Currently, the hash is passed in on the command
      line from the web interface, and there is no method for invoking it on
      the command line and providing a text password, but that is an easy
      change now that the bulk of the code is in the backend instead of the
      web interface.
      
      Note that this change took longer cause we allow inactive,frozen, and
      wikionly users to change their password, but since they do not have
      accounts (yet) the operation is invoked as user "nobody" and tbacct
      about to me made aware of that possibility.
      
      Also add equivalent auditing email message that goes to the user when
      password is changed.
      
      Also more cleanup and conversion to objects.
      32983db4
    • Leigh Stoller's avatar
      Started out adding an email message to users whenever their email · 6d50ce56
      Leigh Stoller authored
      address is changed by an admin, but in the process I decided to
      implement the entire operation in the backend, since that is what we
      want to do anyway for all operations. Email is sent from the backend
      script as well.
      6d50ce56
  20. 02 Jan, 2007 1 commit
  21. 29 Dec, 2006 1 commit
  22. 27 Dec, 2006 1 commit