1. 08 Jan, 2004 1 commit
  2. 07 Jan, 2004 1 commit
  3. 05 Jan, 2004 1 commit
    • Robert Ricci's avatar
      Fix two bugs: · 2eacd213
      Robert Ricci authored
      Fix a bug in enum parsing
      
      Fix typos that were keeping MySQL errors from coming through to the
      web interface.
      2eacd213
  4. 23 Dec, 2003 1 commit
    • Leigh B. Stoller's avatar
      Add new state PXEWAIT to be explained later ... · 22ee2594
      Leigh B. Stoller authored
      Change ptopgen to look at the eventstate of a node; a node is not considered
      free unless it is ISUP or PXEWAIT.
      
      Add TBAvailablePCs() to libdb, removing the corresponding code from
      assign_wrapper. This routine does the equiv of ptopgen, returning the
      number of PCs that are available for use (looking at eventstate).
      
      Change TBFreePCs in the web interface accordingly.
      
      The above changes correspond to an upcoming change in stated.
      22ee2594
  5. 22 Dec, 2003 2 commits
  6. 20 Dec, 2003 1 commit
  7. 19 Dec, 2003 6 commits
  8. 18 Dec, 2003 3 commits
    • Leigh B. Stoller's avatar
      Added check to make sure that uid does not already exist. This is · 7e50b223
      Leigh B. Stoller authored
      usually handled via uid cookie we get back from the browser, but if
      the user Clicks stop or maybe has cookies off, we don't that info.
      7e50b223
    • Leigh B. Stoller's avatar
      First try at solving the problem of validating user input for the · 8dbead16
      Leigh B. Stoller authored
      zillions of DB fields that we have to set. My solution was to add a
      meta table that describes what is a legal value for each table/slot
      for which we take from user input. The table looks like this right
      now, but is likely to adapt as we get more experience with this
      approach (or it might get tossed if it turns out to be a pain in the
      ass!).
      
      	CREATE TABLE table_regex (
      	  table_name varchar(64) NOT NULL default '',
      	  column_name varchar(64) NOT NULL default '',
      	  column_type enum('text','int','float') default NULL,
      	  check_type enum('regex','function','redirect') default NULL,
      	  check tinytext NOT NULL,
      	  min int(11) NOT NULL default '0',
      	  max int(11) NOT NULL default '0',
      	  comment tinytext,
      	  UNIQUE KEY table_name (table_name,column_name)
      	) TYPE=MyISAM;
      
      Entries in this table look like this:
      
      	('virt_nodes','vname','text','regex','^[-\\w]+$',1,32,NULL);
      
      Which says that the vname slot of the virt_nodes table (which we trust the
      user to give us in some form) is a text field to be checked with the given
      regex (perlre of course), and that the min/max length of the text field is
      1 and 32 chars respectively.
      
      Now, you wouldn't want to write the same regex over and over, and since we
      use the same fields in many tables (like pid, eid, vname, etc) there is an
      option to redirect to another entry (recursively). So, for "PID" I do this:
      
              ('eventlist','pid','text','redirect','projects:pid',0,0,NULL);
      
      which redirects to:
      
      	('projects','pid','text','regex','^[a-zA-Z][-\\w]+$',2,12,NULL);
      
      And, for many fields you just want to describe generically what could go
      into it. For that I have defined some default fields. For example, a user
      description:
      
              ('experiment,'usr_name','text','redirect','default:tinytext',0,0,NULL);
      
      which redirects to:
      
      	('default','tinytext','text','regex','^[\\040-\\176]*$',0,256,NULL);
      
      and this says that a tinytext (in our little corner of the database
      universe) field can have printable characters (but not a newline), and
      since its a tinytext field, its maxlen is 256 chars.
      
      You also have integer fields, but these are little more irksome in the
      details.
      
      	('default','tinyint,'int,'regex','^[\\d]+$',-128,127,NULL);
      
      and you would use this anyplace you do not care about the min/max values
      being something specific in the tinyint range. The range for a float is of
      course stated as an integer, and thats kinda bogus, but we do not have many
      floats, and they generally do not take on specific values anyway.
      
      A note about the min/max fields and redirecting. If the initial entry has
      non-zero min/max fields, those are the min mac fields used. Otherwise they
      come from the default. So for example, you can do this:
      
          ('experiments','mem_usage','int','redirect','default:tinyint',0,5,NULL);
      
      So, you can redirect to the standard "tinyint" regular expression, but you
      still get to define min/max for the specific field.
      
      Isn't this is really neat and really obtuse too? Sure, you can say it.
      
      Anyway, xmlconvert now sends all of its input through these checks (its
      all wrapped up in library calls), and if a slot does not have an entry, it
      throws an error so that we are forced to define entries for new slots as we
      add them.
      
      In the web page, I have changed all of the public pages (login, join
      project, new project, and a couple of others) to also use these checks.
      As with the perl code, its all wrapped up in a library. Lots more code
      needs to be changed of course, but this is a start.
      8dbead16
    • Leigh B. Stoller's avatar
      Minor changes and cleanup. Also fix up the problem with duplicate · da4a4125
      Leigh B. Stoller authored
      addslashes getting called, once in the web interface and again in the
      perl backend.
      da4a4125
  9. 16 Dec, 2003 7 commits
  10. 15 Dec, 2003 4 commits
    • Leigh B. Stoller's avatar
      e5bf68ad
    • Shashi Guruprasad's avatar
      Added question TR-6: "I wrote a small TCP application to test the · 5019322b
      Shashi Guruprasad authored
      bandwidth of a link/LAN. I do not observe the bandwidth that I
      asked for. Why?"
      5019322b
    • Leigh B. Stoller's avatar
      My own top bar image. · e510dc6f
      Leigh B. Stoller authored
      e510dc6f
    • Leigh B. Stoller's avatar
      Commit functioning XML interface. At present, only isadmin people will · 51310e62
      Leigh B. Stoller authored
      see this new page. That allows me to inflict pain on testbed
      developers while we work out any kinks. These new pages implement an
      XML interface to experiment creation.
      
      Some new files:
      
      beginexp_html.php3: A wrapper for the actual beginexp form. This page
      includes the form, and then invokes the XMLRPC backend page.
      
      beginexp_form.html: The original form code, split out from beginexp
      and turned into a module that can be included into another file.  It
      is slightly reorganized to make it easier to include as a module.  The
      idea is that the plab_ez form will be recast in this model, reducing
      some redundant complexity.
      
      beginexp_xml.php3: The XML backend. The idea is that the html page
      packages up the form arguments as an XMLRPC message, and invokes this
      page with the XML goo encoded in the URL. It also passes along the
      uid/cookie so that the authentication happens properly (https of
      course). The page decodes the URL into PHP datatypes, and does much of
      the same argument checking that beginexp used to do. Errors are stored
      up in the same manner, but instead of spitting back html, it now spits
      back a "structure", encoded in XML so that the _html page can put up a
      new form. Basically, all output is sent back via an XML encoded
      structure and displayed in a form that the invoking script deems
      appropriate.
      
      This gives us a pure XMLRPC interface, which we wrap with a form interface
      so that it looks just like it did before.
      
      The next step is to provide an alternate front end, but that will require
      some certificate stuff that I have not worked out yet.
      
      Oh, one more item. The syntax check stuff has been altered a bit.
      Instead of invoking the beginexp page, which meant a zillion special
      tests, I now invoke nscheck.php3 directly from the button. Took a few
      extra lines of Javascript to do this, so watch out for problems there
      too.
      51310e62
  11. 12 Dec, 2003 1 commit
  12. 11 Dec, 2003 5 commits
  13. 10 Dec, 2003 5 commits
    • Jay Lepreau's avatar
    • Leigh B. Stoller's avatar
      New pages to allow users to reset their forgotten passwords without · 315e11ab
      Leigh B. Stoller authored
      invovling testbed ops. Split into two parts:
      
      * password.php3 gives the user a form to specify their email address
        and their phone number. We look for a match in the DB, with the
        phone number stripped of all non-numeric characters and the email
        addresses lowercased. If we find a matching user in the database,
        generate a unique key and store that into the DB along with a
        timestamp that allows the key to be used for a short time period
        (currently 30 minutes). The key is split into two parts, with half
        stored in the users browser (secure mode), and the other half sent
        to the user in an email message that contains a URL that allows the
        user to reset their password.
      
      * chpasswd.php3 does the rest of the operation. It takes half the key
        from the URL, and sucks the other half from the user's browser,
        combining the two halves and matching it against the key that is
        stored in the DB. If the key matches and the timeout has not
        expired, the user is given a form to specify a new password. From
        this point on its just a standard change password operation.
      
      Both pages are audited with email sent to the user, tbops and the
      audit list.
      315e11ab
    • Leigh B. Stoller's avatar
      1fbefb43
    • Leigh B. Stoller's avatar
      Minor cosmetic change. · f68d3b80
      Leigh B. Stoller authored
      f68d3b80
    • Leigh B. Stoller's avatar
      9675076d
  14. 09 Dec, 2003 2 commits
    • Leigh B. Stoller's avatar
      Add pubs. · 3d1ece48
      Leigh B. Stoller authored
      3d1ece48
    • Leigh B. Stoller's avatar
      Add drop down menu to approve project form that allows admin person to · 9d882479
      Leigh B. 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