1. 21 Oct, 2008 1 commit
    • Kevin Atkinson's avatar
      If a known user (based on stored cookies) is not logged in than · 846a98d6
      Kevin Atkinson authored
      redirect to the login page rather than printing a message with a link
      to the page.  Otherwise send a "403 Forbidden" to keep robots from
      indexing the page.  Also send appreciate HTTP responses on other
      precheck errors to keep a robot from indexing the page.  In order to
      do this the PAGEHEADER call needed to be moved to after
      CheckLoginOrDie and Required/OptionalPageArguments on many pages.  A
      warning will be printed if either CheckLoginOrDie or
      Required/OptionalPageArguments detects that PAGEHEADER was already
      called.
      
      Also change the redirect in kb-show to be a permanent redirect (301)
      rather than a temporary one (302) which is the default unless a status
      code is given.
      846a98d6
  2. 09 May, 2008 1 commit
    • Kevin Atkinson's avatar
      Make project approval mail truly anonymous. Also make membership · 503bb661
      Kevin Atkinson authored
      acceptance email truly anonymous.  A few other emails related to
      project membership are still not anonymous though.  New function
      AnonSENDMAIL in libtestbed which will try to make sure there is no
      trace of the current user in the mail sent.
      
      For now, stop sending membership approval related email to the project
      admin list since this will also go to testbed-approval.  There is also
      some code to remove testbed-approval from the proj-admin list after
      the acceptance email but this is disabled for now since some times people
      reply to the approval email.
      503bb661
  3. 01 May, 2008 1 commit
    • Kevin Atkinson's avatar
      Implemt FS#187 -- Show admin history of projects: · 8054f5f8
      Kevin Atkinson authored
        When a project is initially created a new mailing list is created,
        PROJ-admin@emulab.net.
      
        testbed-approval is subscribed to the list
      
        Several emails that originally went to testbed-approval now go to the
        mailing list instead.  The From, To, fields are basically the same
        with testbed-approval becoming PROJ-admin.  This means some mail
        is sent with a From PROJ-admin and Bcc the mailing list.  Note that
        some mail still goes to testbed-approval directly, in particular
        ones where there is no clear project involved, and when a project is
        denied.
      
        In addition notifications of approval status of new members is also
        sent to the list.  These emails use to only go to testbed-audit@.
      
        Currently All mail sent to PROJ-admin is also sent to testbed-audit
        (via a Bcc).  This means that some mail that didn't use to go to
        testbed-audit now does.
      
        The mailing list is deleted when a project is deleted with out first
        being approved.  Becuase of this notified that a project is denied
        is sent to testbed-approval instead of PROJ-admin.
      
        Admins can access the mailing list from the Project Profile page.
      
        The mailing list is open in order to allow users to reply to the
        mailing list, in addition the check that PROJ-admin is in the To or
        CC field is disabled.  There is currently no spam control on the
        mailing lists.  However, since the mailing list address is not posted
        anywhere it should't pick up to much spam.  If it does we can deal
        with it then.
      
        Finally, a new script is created to create the per-project admin
        mailing list.  See doc/UPDATING.
      
      Also add DBQuerySingleFatal to libdb, which is like DBQueryFatal but
      also fails if the query didn't return any results.  Basically
      identical to he version in libtblog.  Eventually libtblog should be
      modified to use this version.
      8054f5f8
  4. 08 Mar, 2007 1 commit
  5. 05 Mar, 2007 1 commit
  6. 13 Feb, 2007 1 commit
  7. 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
  8. 23 Jan, 2007 1 commit
  9. 20 Dec, 2006 1 commit
  10. 19 Sep, 2005 1 commit
    • Leigh Stoller's avatar
      Move all modification of the group_membership table to the backend, · cfba1ac7
      Leigh Stoller authored
      into a single new script call modgroups. Usage:
      
      	modgroups [-a pid:gid:trust[,pid:gid:trust]...]
                        [-m pid:gid:trust[,pid:gid:trust]...]
                        [-r pid:gid[,pid:gid]...] user
      
      So, -a to add groups, -r to remove groups, and -m to modify the trust
      value for a member of a group.
      
      The reason for doing this is that previously, we had no idea in the
      backend what group changes actually happened; we just knew what the
      current groups are. This make it hard to add and remove users from
      mailing lists, chat server buddy lists, etc. This is cleaner ...
      cfba1ac7
  11. 21 Jul, 2005 1 commit
  12. 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
  13. 12 May, 2003 1 commit
  14. 25 Mar, 2003 2 commits
    • Chad Barb's avatar
    • Chad Barb's avatar
      · f3d05157
      Chad Barb authored
         - Performing an approval action (postpone/approve/deny/nuke) on a
           user in a subgroup results in an implicit version of that same
           approval action on the user in the
           default group (for approve, $trust='user'.)
      
         - Tidied up a table in approveuser_form.php3,
           but form is otherwise unchanged.
      f3d05157
  15. 13 Mar, 2003 1 commit
    • Chad Barb's avatar
      · c6129ad7
      Chad Barb authored
      More rework on the groups system.
      
      * BESTOWGROUPROOT permission added to dbdefs.
      
      * Permissions criteria for group operations changed in dbdefs
        (consult code for full explanation.)
      
      * Approveuser and Editgroup now check for BESTOWGROUPROOT
        permissions before allowing changes to group_root.
      
      * approveuser_form and editgroup_form do not show "Group Root"
        as an option unless you are allowed to set it (or it is already set.)
      
      * editgroup does not UPDATE rows where trust has not been changed.
      
      * showgroup does a correct check to see whether to show the
        "group options" subpage.
      c6129ad7
  16. 12 Mar, 2003 2 commits
    • Chad Barb's avatar
      · 6052927b
      Chad Barb authored
      Approveuser now does not allow non-project-owners to approve people as
      group_root into the default group.
      
      Modified editgroup form to show only valid trust options for "add users"
      table.
      6052927b
    • Chad Barb's avatar
      · 24940013
      Chad Barb authored
      * Altered consistency checks to treat any root as equivalent
        (so, if you're project_root in the default group, but group_root in
         a group, that won't be a problem)
      
      * Moved consistency checks, which were done in two different places into
        dbdefs TBCheckGroupTrustConsistency()
      
      * Added preemptive checks, so if 'user' or '*_root' are not valid
        trusts, they aren't displayed as options in editgroup_form and
        approveuser_form (using above function)
      
      * In approveuser, a new approval may now be sent to group_root.
      24940013
  17. 13 Feb, 2003 1 commit
  18. 24 Jan, 2003 1 commit
  19. 09 Dec, 2002 1 commit
    • Leigh Stoller's avatar
      Wrap up mkacct calls with a function call, like ADDPUBKEY. Checks to · 356a9fc0
      Leigh Stoller authored
      see if user actually has an account (by checking user status user
      table). Avoids trying to run suexec as a user that does not actuall
      exist on boss cause they do not have an account (since we allow users
      to edit personal info before being approved and getting an account).
      For addpubkey, we have to run the program as someone, so when the user
      does not have an account, run it as nobody.
      356a9fc0
  20. 06 Dec, 2002 1 commit
  21. 16 Sep, 2002 1 commit
  22. 10 Jul, 2002 1 commit
  23. 07 Jul, 2002 1 commit
  24. 12 Jun, 2002 1 commit
    • Leigh Stoller's avatar
      The big key changes ... Deprecate the two pubkey slots in the users · 6c6f8baf
      Leigh Stoller authored
      table and create a new table to hold user_pubkeys, indexed by the
      comment field of the key. Change mkacct to insert newly created Emulab
      keys into that table, and to regen the users authorized_keys file
      from the DB. Users should no longer edit their own authorized_keys
      file or the changes will be lost (I put a comment in their files).
      
      Change the three pages that deal with keys. join/new project can now
      take a file of multiple keys; each is inserted. Moved the key stuff
      that was in the update user info page into a new pubkeys page that
      allows users to add/sub keys easily. New key additions are password
      protected.
      
      Unrelated change: Add an audit mode to mkacct to log its output and
      send it to the tblogs email. Previously, warnings and errors tended to
      get lost.
      6c6f8baf
  25. 12 Feb, 2002 1 commit
  26. 26 Dec, 2001 1 commit
    • Leigh Stoller's avatar
      A bunch o' account managment script schanges. I have reworked · 46068860
      Leigh Stoller authored
      mkprojdir, mkacct-cntrl, mkgroup, and group-update into a set of new
      scripts that are more specific to their intended operation, and strive
      to do less work.
      
      1. mkacct - Replaces mkacct-cntrl. This script no longer does any
         group stuff. All it does is create new accounts, or update the
         password and gecos fields of existing accounts. Usage is the same
         as it was: "mkacct <userid>", and is typically invoked from the web
         interface via the approveuser form.
      
      2. mkgroup - Replaces group-update. This script creates new groups,
         either for the main project when it is approved, or for subgroup
         creation. This script does not alter the group membership. Usage
         is typically from the web interface, but mkgroup can be invoked
         from the command line: "mkgroup [-b | -a] <pid> <gid>" where -b
         puts it in the background and sends email later, while -a just
         captures the log and emails. This "audit" feature is going to find
         its way into more scripts as soon as I figure out a neat and clean
         perl mechanism to make it easy.
      
      3. setgroups - Replaces group-update. This script modifies the group
         membership of either specific users, or all the users in a
         project. It is typically invoked from the web interface when a
         project leader edits the subgroup membership or when a user is
         first approved to a project or subgroup. Command line usage is:
      
      	setgroups [-b | -a] -p <pid> [user ...]
              setgroups [-b | -a] [user ...]\n
      
         The first form is mostly a means to speed things up. The web
         interfaces knows exactly what users have need to be changed, but a
         global project update is nice too.
      
      4. mkproj - Replaces mkprojdir. Actually, mkproj still has all that
         directory code, but it also handles creating the groups and the
         account for the project leader. Part of my policy to move as much
         random code out of the web interface and into the PERL backend
         where it belongs.
      46068860
  27. 20 Dec, 2001 1 commit
    • Leigh Stoller's avatar
      And finally, all those groups changes I've been whining and yammering · c13d27c3
      Leigh Stoller authored
      and complaining about this week.
      
      1. editgroup: You can now edit the trust levels for existing group
         members (default group too), and you can specify trust levels when
         adding users to subgroups.
      
      2. approveusers: When approving users in the approval page, you can
         specify different levels of trust. Before, I invisibly set all the
         trust values the same. I also added some ordering to the DB query
         to group users together.
      
      3. I added a great deal of error checking to the processing pages for
         both forms. I split things up into a pre/post pass. The prepass
         goes through all of the form args and checks them for consistency
         and correctness. Nothing is changed in the DB unless all checks
         pass for all args. Then I do a second pass and make the changes.
         Both scripts set the ignore_user_abort() flag to prevent the user
         from stopping the script and causing a DB inconsistency.
      
      4. Added trust consistency checks as well. Rather than allow the
         project or group leader to set inconsistent trust levels, I look
         for those and just plain disallow them. You may not give different
         trust levels in different subgroups of the *same* project, and you
         may not give a user a higher trust level in the default group than
         in the subgroups. Both edit and approve make these checks, and the
         code is absolutely awful.
      c13d27c3
  28. 28 Nov, 2001 1 commit
  29. 16 Oct, 2001 1 commit
  30. 05 Sep, 2001 1 commit
  31. 19 Jul, 2001 1 commit
    • Leigh Stoller's avatar
      Address Pats comments in email to testbed-ops: · 1728fe2b
      Leigh Stoller authored
          From: "Patrick Tullmann 'tullmann'" <tullmann@cs.utah.edu>
          Subject: Re: TESTBED: aclement janos Project Join Request
      
          First the reply-to: address for approval mails should be
          testbed-ops@fast (right?).
      
          Second, Austin isn't listed on my testbed user approval page.  I
          assume Mike or a testbed person approved him (which is good because
          who knows when I'd get around to it. :)
      
          An option like "remove" or "ignore" or something like that for just
          nuking requests without a reply would be useful (I've got some guy
          from yahoo.com who wants to join Janos).
      
          Also, the date of the join request would be nice to know (e.g., for
          the above, I think he tried joining 4 or 5 months ago).
      
          he documentation above the table is out of synch with the pull-down
          boxes.
      1728fe2b
  32. 10 May, 2001 1 commit
    • Leigh Stoller's avatar
      Lots of little changes for sending email to the right places, with · 3285bc3e
      Leigh Stoller authored
      proper headers. Split out some of the mail into testbed-logs,
      testbed-ops, and testbed-approval. Added a library for including from
      our perl scripts. Contains a couple of mail helper functions, but will
      hopefully contain more as time goes by.
      
      Fixed a bug in the web interface that was causing breakage for people
      with multiple accounts. Mac and Jay have noticed this, when logging
      out and trying to join or create a project under a new or different
      name.
      3285bc3e
  33. 18 Apr, 2001 1 commit
  34. 01 Feb, 2001 1 commit
    • Mac Newbold's avatar
      Changes to mkacct-ctrl for membership in multiple groups. Now it only takes... · bd32aec3
      Mac Newbold authored
      Changes to mkacct-ctrl for membership in multiple groups. Now it only takes user as a param and does the rest from the db. Special note: You can now run it to correct any incorrect password/group entries. Like if someone gets removed from one of the groups they belong to (but we don't want to kill their acct yet). Also, special note for accts on paper: It doesn't change your shell. So if you had an acct with a real shell (admins/developers only) it will leave it. If your a testbed admin, it will also make sure you're in group wheel and group flux.
      bd32aec3
  35. 03 Jan, 2001 2 commits
  36. 08 Dec, 2000 2 commits