Annotation of loncom/debugging_tools/make_slots.pl, revision 1.7

1.1       albertel    1: use Date::Manip;
                      2: use GDBM_File;
                      3: use Storable qw(nfreeze thaw);
1.7     ! albertel    4: use lib '/home/httpd/lib/perl/';
        !             5: use LONCAPA;
        !             6: use Apache::lonnet;
1.1       albertel    7: 
                      8: my $fname="/home/httpd/lonUsers/annarbor/9/7/7/9778182de3942c1annarborl2/slots.db";
1.7     ! albertel    9: 
        !            10: my $db = &LONCAPA::locking_hash_tie($fname,&GDBM_WRCREAT());
        !            11: if (! $db) {
1.1       albertel   12:     warn "Unable to tie to $fname";
                     13:     exit;
                     14: }
1.3       albertel   15: 
                     16: =pod
                     17: 
                     18: slots can have these parts;:
                     19: 
                     20: Required:
                     21:   starttime - unix time that a slot start
                     22:   endtime - unix time that a slot ends
1.6       albertel   23:   type - either 'preassigned' or 'schedulable_student'
                     24:          (controls whether slotrequest.pm will allow one to select it)
1.3       albertel   25: 
                     26: Optional:
1.6       albertel   27:   startreserve - unix time that a slot can start being reserved
1.3       albertel   28:   ip - comma seperated list of ip address or wildcard ranges or
                     29:        wilcard hostnames, or [] style range of allowable client IP
                     30:        addresses
                     31:   proctor - comma seperated list of user@domain that can checkin a user
                     32:   description - string that will displayed to people when talking about 
                     33:                 this slot
                     34:   maxspace - integer (number of people that can schedule this space)
                     35:              (if unspecfied no limit is used)
1.4       albertel   36:   symb - arrayref of symbs that can be scheduled to be done in this slot
1.5       albertel   37:   uniqueperiod - if the user has a reservation that has a uniqueperiod
                     38:                  that overlaps this don't allow them to schedule this
                     39:                  slot
1.6       albertel   40:   secret - arrary ref of words that are the secret for this slot
1.3       albertel   41: Possibly Need: (but not yet supported)
                     42: 
                     43: 
                     44: =cut
                     45: 
1.7     ! albertel   46: $db->{'slot1'}=
        !            47:     &Apache::lonnet::freeze_escape({
1.3       albertel   48: 	'type'      => 'preassigned',
1.4       albertel   49: 	'startreserve' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
1.1       albertel   50: 	'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
                     51: 	'endtime'   => &UnixDate("Aug 30th 01:00:00 2004","%s"),
                     52: 	'ip'        => "*albertelli.com",
1.2       albertel   53: 	'proctor'   => 'testuser@annarbor',
1.1       albertel   54:     });
1.7     ! albertel   55: $db->{'slot2'}=
        !            56:     &Apache::lonnet::freeze_escape({
1.3       albertel   57: 	'type'      => 'preassigned',
1.4       albertel   58: 	'startreserve' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
1.6       albertel   59: 	'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
                     60: 	#'starttime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
1.1       albertel   61: 	'endtime'   => &UnixDate("Aug 30th 00:00:00 2006","%s"),
1.6       albertel   62: 	'endtime'   => &UnixDate("Aug 30th 00:00:00 2004","%s"),
1.1       albertel   63: 	'ip'        => "*albertelli.com",
1.2       albertel   64: 	'proctor'   => 'testuser@annarbor',
1.1       albertel   65:     });
1.7     ! albertel   66: $db->{'slot3'}=
        !            67:     &Apache::lonnet::freeze_escape({
1.3       albertel   68: 	'type'      => 'preassigned',
                     69: 	'description' => 'slot3',
1.4       albertel   70: 	'startreserve' => &UnixDate("Aug 29th 00:00:00 2004","%s"),
1.1       albertel   71: 	'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
                     72: 	'endtime'   => &UnixDate("Aug 30th 00:00:00 2006","%s"),
1.3       albertel   73:         'endtime'   => &UnixDate("Aug 30th 00:00:00 2004","%s"),
1.5       albertel   74: 	#'ip'        => "1.2.3.4",
                     75: 	#'ip'        => "*albertelli.com",
1.2       albertel   76: 	'proctor'   => 'testuser@annarbor',
1.1       albertel   77:     });
1.7     ! albertel   78: $db->{'slot4'}=
        !            79:     &Apache::lonnet::freeze_escape({
1.3       albertel   80: 	'type'      => 'preassigned',
1.4       albertel   81: 	'startreserve' => &UnixDate("Aug 29th 00:00:00 2004","%s"),
1.3       albertel   82: 	'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
                     83: 	'endtime'   => &UnixDate("Aug 30th 00:00:00 2006","%s"),
                     84: 	'endtime'   => &UnixDate("Aug 30th 00:00:00 2004","%s"),
1.5       albertel   85: 	#'ip'        => "*albertelli.com",
1.3       albertel   86: 	'proctor'   => 'testuser@annarbor',
                     87:     });
1.7     ! albertel   88: $db->{'slot5'}=
        !            89:     &Apache::lonnet::freeze_escape({
1.3       albertel   90: 	'type'      => 'schedulable_student',
1.5       albertel   91: 	'description' => 'Aug 30th 4 P.M., Room 123 Kedzie',
1.4       albertel   92: 	'startreserve' => &UnixDate("Aug 29th 00:00:00 2004","%s"),
1.5       albertel   93: 	'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
1.6       albertel   94: 	#'starttime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
1.5       albertel   95: 	'endtime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
                     96: 	#'endtime'   => &UnixDate("Aug 30th 00:00:00 2006","%s"),
1.6       albertel   97: 	'endtime'   => &UnixDate("Aug 30th 00:00:00 2004","%s"),
1.5       albertel   98: 	#'ip'        => "*albertelli.com,"
1.3       albertel   99: 	'proctor'   => 'testuser@annarbor',
1.5       albertel  100: 	'uniqueperiod' => [&UnixDate("Aug 30th 00:00:00 2004","%s"),
                    101: 			   &UnixDate("Aug 30th 00:00:00 2005","%s")],
1.6       albertel  102: 	'maxspace' => 10,
                    103: 	'secret'   => 'sauce'
1.3       albertel  104:     });
1.7     ! albertel  105: $db->{'slot6'}=
        !           106:     &Apache::lonnet::freeze_escape({
1.3       albertel  107: 	'type'      => 'schedulable_student',
                    108: 	'description' => 'Aug 31th 4 P.M., Room 222 Computer Center',
1.4       albertel  109: 	'startreserve' => &UnixDate("Aug 29th 00:00:00 2004","%s"),
1.6       albertel  110: 	#'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
1.5       albertel  111: 	'starttime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
1.1       albertel  112: 	'endtime'   => &UnixDate("Aug 30th 00:00:00 2006","%s"),
1.4       albertel  113: 	#'endtime'   => &UnixDate("Aug 30th 00:00:00 2004","%s"),
1.5       albertel  114: 	#'ip'        => "*albertelli.com",
1.2       albertel  115: 	'proctor'   => 'testuser@annarbor',
1.5       albertel  116: 	'uniqueperiod' => [&UnixDate("Aug 1st 00:00:00 2005","%s"),
                    117: 			   &UnixDate("Aug 30th 00:00:00 2006","%s")],
1.6       albertel  118: 	'maxspace' => 4,
1.1       albertel  119:     });
                    120: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>