File:
[LON-CAPA] /
loncom /
debugging_tools /
make_slots.pl
Revision
1.7:
download - view:
text,
annotated -
select for diffs
Tue Jun 27 15:04:51 2006 UTC (18 years, 3 months ago) by
albertel
Branches:
MAIN
CVS tags:
version_2_9_X,
version_2_9_99_0,
version_2_9_1,
version_2_9_0,
version_2_8_X,
version_2_8_99_1,
version_2_8_99_0,
version_2_8_2,
version_2_8_1,
version_2_8_0,
version_2_7_X,
version_2_7_99_1,
version_2_7_99_0,
version_2_7_1,
version_2_7_0,
version_2_6_X,
version_2_6_99_1,
version_2_6_99_0,
version_2_6_3,
version_2_6_2,
version_2_6_1,
version_2_6_0,
version_2_5_X,
version_2_5_99_1,
version_2_5_99_0,
version_2_5_2,
version_2_5_1,
version_2_5_0,
version_2_4_X,
version_2_4_99_0,
version_2_4_2,
version_2_4_1,
version_2_4_0,
version_2_3_X,
version_2_3_99_0,
version_2_3_2,
version_2_3_1,
version_2_3_0,
version_2_2_X,
version_2_2_99_1,
version_2_2_99_0,
version_2_2_2,
version_2_2_1,
version_2_2_0,
version_2_1_99_3,
version_2_1_99_2,
version_2_1_99_1,
version_2_1_99_0,
version_2_12_X,
version_2_11_X,
version_2_11_5_msu,
version_2_11_5,
version_2_11_4_uiuc,
version_2_11_4_msu,
version_2_11_4,
version_2_11_3_uiuc,
version_2_11_3_msu,
version_2_11_3,
version_2_11_2_uiuc,
version_2_11_2_msu,
version_2_11_2_educog,
version_2_11_2,
version_2_11_1,
version_2_11_0_RC3,
version_2_11_0_RC2,
version_2_11_0_RC1,
version_2_11_0,
version_2_10_X,
version_2_10_1,
version_2_10_0_RC2,
version_2_10_0_RC1,
version_2_10_0,
loncapaMITrelate_1,
language_hyphenation_merge,
language_hyphenation,
bz6209-base,
bz6209,
bz5969,
bz2851,
PRINT_INCOMPLETE_base,
PRINT_INCOMPLETE,
HEAD,
GCI_3,
GCI_2,
GCI_1,
BZ5971-printing-apage,
BZ5434-fox,
BZ4492-merge,
BZ4492-feature_horizontal_radioresponse,
BZ4492-feature_Support_horizontal_radioresponse,
BZ4492-Support_horizontal_radioresponse
- LONCAPA morph
1: use Date::Manip;
2: use GDBM_File;
3: use Storable qw(nfreeze thaw);
4: use lib '/home/httpd/lib/perl/';
5: use LONCAPA;
6: use Apache::lonnet;
7:
8: my $fname="/home/httpd/lonUsers/annarbor/9/7/7/9778182de3942c1annarborl2/slots.db";
9:
10: my $db = &LONCAPA::locking_hash_tie($fname,&GDBM_WRCREAT());
11: if (! $db) {
12: warn "Unable to tie to $fname";
13: exit;
14: }
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
23: type - either 'preassigned' or 'schedulable_student'
24: (controls whether slotrequest.pm will allow one to select it)
25:
26: Optional:
27: startreserve - unix time that a slot can start being reserved
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)
36: symb - arrayref of symbs that can be scheduled to be done in this slot
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
40: secret - arrary ref of words that are the secret for this slot
41: Possibly Need: (but not yet supported)
42:
43:
44: =cut
45:
46: $db->{'slot1'}=
47: &Apache::lonnet::freeze_escape({
48: 'type' => 'preassigned',
49: 'startreserve' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
50: 'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
51: 'endtime' => &UnixDate("Aug 30th 01:00:00 2004","%s"),
52: 'ip' => "*albertelli.com",
53: 'proctor' => 'testuser@annarbor',
54: });
55: $db->{'slot2'}=
56: &Apache::lonnet::freeze_escape({
57: 'type' => 'preassigned',
58: 'startreserve' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
59: 'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
60: #'starttime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
61: 'endtime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
62: 'endtime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
63: 'ip' => "*albertelli.com",
64: 'proctor' => 'testuser@annarbor',
65: });
66: $db->{'slot3'}=
67: &Apache::lonnet::freeze_escape({
68: 'type' => 'preassigned',
69: 'description' => 'slot3',
70: 'startreserve' => &UnixDate("Aug 29th 00:00:00 2004","%s"),
71: 'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
72: 'endtime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
73: 'endtime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
74: #'ip' => "1.2.3.4",
75: #'ip' => "*albertelli.com",
76: 'proctor' => 'testuser@annarbor',
77: });
78: $db->{'slot4'}=
79: &Apache::lonnet::freeze_escape({
80: 'type' => 'preassigned',
81: 'startreserve' => &UnixDate("Aug 29th 00:00:00 2004","%s"),
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"),
85: #'ip' => "*albertelli.com",
86: 'proctor' => 'testuser@annarbor',
87: });
88: $db->{'slot5'}=
89: &Apache::lonnet::freeze_escape({
90: 'type' => 'schedulable_student',
91: 'description' => 'Aug 30th 4 P.M., Room 123 Kedzie',
92: 'startreserve' => &UnixDate("Aug 29th 00:00:00 2004","%s"),
93: 'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
94: #'starttime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
95: 'endtime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
96: #'endtime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
97: 'endtime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
98: #'ip' => "*albertelli.com,"
99: 'proctor' => 'testuser@annarbor',
100: 'uniqueperiod' => [&UnixDate("Aug 30th 00:00:00 2004","%s"),
101: &UnixDate("Aug 30th 00:00:00 2005","%s")],
102: 'maxspace' => 10,
103: 'secret' => 'sauce'
104: });
105: $db->{'slot6'}=
106: &Apache::lonnet::freeze_escape({
107: 'type' => 'schedulable_student',
108: 'description' => 'Aug 31th 4 P.M., Room 222 Computer Center',
109: 'startreserve' => &UnixDate("Aug 29th 00:00:00 2004","%s"),
110: #'starttime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
111: 'starttime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
112: 'endtime' => &UnixDate("Aug 30th 00:00:00 2006","%s"),
113: #'endtime' => &UnixDate("Aug 30th 00:00:00 2004","%s"),
114: #'ip' => "*albertelli.com",
115: 'proctor' => 'testuser@annarbor',
116: 'uniqueperiod' => [&UnixDate("Aug 1st 00:00:00 2005","%s"),
117: &UnixDate("Aug 30th 00:00:00 2006","%s")],
118: 'maxspace' => 4,
119: });
120:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>