Subversion Repositories wimsdev

Rev

Rev 6586 | Rev 17177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6586 Rev 15416
Line -... Line 1...
-
 
1
<h2 class="wimscenter">Access restriction definition</h2>
1
 
2
 
2
 
-
 
3
<p class="wimscenter">Access restriction definition</p>
-
 
4
<p>
3
<p>
5
 
-
 
6
This is multi-line data, executed line by line in their list orders. The
4
This is multi-line data, executed line by line in their list orders. The
7
restrictions only affect resource modules, but not administration modules.
5
restrictions only affect resource modules, but not administration modules.
8
Lines starting with a `<span class="tt">#</span>' are comments.
6
Lines starting with a `<span class="tt wims_code_words">#</span>' are comments.
9
</p><p>
7
</p><p>
10
Each line is of the format <span class="tt">[access conditions]:[host conditions]</span>.
8
Each line is of the format <span class="tt wims_code_words">access conditions:host/time conditions</span>.
11
</p><p>
9
</p><p>
12
The access conditions is a list of words, which will be ANDed. The available
10
The access conditions is a list of words, which will be ANDed. The available
13
words are listed in the following table. Each word can be prefixed with
11
words are listed in the following table. Each word can be prefixed with
14
<span class="tt wims_code_words">non</span> to reverse its logical meaning.
12
<span class="tt wims_code_words">non</span> to reverse its logical meaning.
15
</p>
13
</p>
16
$table_header
14
$table_header
17
$table_tr<th>word</th><th>meaning</th></tr>
15
$table_tr<th>word</th><th>meaning</th></tr>
18
$table_tr<td class="tt wims_code_words">class</td><td>The connection is within a virtual class.</td></tr>
16
$table_tr<td class="tt wims_code_words">class</td><td>The connection is within a virtual class.</td></tr>
19
$table_tr<td class="tt wims_code_words">com</td><td>The requested module is under the com/ subtree.</td></tr>
17
$table_tr<td class="tt wims_code_words">com</td><td>The requested module is under the com/ subtree.</td></tr>
20
$table_tr<td class="tt wims_code_words">document</td><td>The requested module is a document. (not yet available)</td></tr>
18
$table_tr<td class="tt wims_code_words">document</td><td>The requested module is a document.</td></tr>
21
$table_tr<td class="tt wims_code_words">exercise</td><td>The requested module is an exercise.</td></tr>
19
$table_tr<td class="tt wims_code_words">exercise</td><td>The requested module is an exercise.</td></tr>
22
$table_tr<td class="tt wims_code_words">hint</td><td>The request is for hint.</td></tr>
20
$table_tr<td class="tt wims_code_words">hint</td><td>The request is for hint.</td></tr>
23
$table_tr<td class="tt wims_code_words">local</td><td>The requested module is under the local/ subtree.</td></tr>
21
$table_tr<td class="tt wims_code_words">local</td><td>The requested module is under the local/ subtree.</td></tr>
24
$table_tr<td class="tt wims_code_words">recreation</td><td>The requested module is a recreation.</td></tr>
22
$table_tr<td class="tt wims_code_words">recreation</td><td>The requested module is a recreation.</td></tr>
25
$table_tr<td class="tt wims_code_words">tool</td><td>The requested module is a tool.</td></tr>
23
$table_tr<td class="tt wims_code_words">tool</td><td>The requested module is a tool.</td></tr>
26
$table_end
24
$table_end
27
 
25
 
-
 
26
!set date=!char 1 to 8 of $wims_now
-
 
27
!set year=!char 1 to 4 of $wims_now
-
 
28
<div>
28
The host conditions can be any host definition, eventually plus time
29
The host/time conditions can be any host or time definition as for any worksheet.
29
definition as for any worksheets. If the first character of the host
30
According to the first line with host/time meeting the host/time conditions:
30
conditions is <span class="tt wims_code_words">!</span>, then the host/time meeting the conditions will
31
  <ul><li> If the first character of the host/time conditions is
31
be refused access (for the resources meeting the access conditions).
32
    <span class="tt wims_code_words">!</span>, the resources meeting the access conditions
-
 
33
    will be refused access.
-
 
34
  </li><li>
32
Otherwise they will be granted access, and subsequent lines in the
35
    Otherwise they will be granted access.
-
 
36
  </li></ul>
33
restriction definition will be ignored for those meeting the conditions.
37
  Subsequent lines in the restriction definition will be then ignored.
34
 
38
</div>
35
<hr />
39
<hr />
36
 
40
 
37
!read help/hosts.phtml
41
!read help/hosts.phtml
38
 
42
 
39
<hr />
43
<hr />
40
 
44
 
41
Some starting examples.
45
Some starting examples.
42
<p>
46
<div>
43
# Disallow the use of tools from 134.59.102.*
47
# Disallow the use of tools from 134.59.102.*
-
 
48
<pre>
44
<br/><span class="tt wims_code_words">tool:! 134.59.102.</span>
49
<span class="tt wims_code_words">tool:! 134.59.102.</span>
45
</p><p>
50
</pre></div><div>
46
# Disallow calls for hint from localhost.
51
# Disallow calls for hint from localhost.
-
 
52
<pre>
47
<br /><span class="tt wims_code_words">hint:! 127.0.0.1</span>
53
<span class="tt wims_code_words">hint:! 127.0.0.1</span>
48
</p><p>
54
</pre></div><div>
49
# People from wanadoo.fr cannot have anonymous accesses for recreations.
55
# People from wanadoo.fr cannot have anonymous accesses for recreations.
-
 
56
<pre>
50
<br/><span class="tt wims_code_words">recreation nonclass:! .wanadoo.fr</span>
57
<span class="tt wims_code_words">nonclass recreation:! .wanadoo.fr</span>
51
</p><p>
58
</pre></div><div>
52
# Work in virtual classes prohibited from localhost on New Year's Day of 2004.
59
# Work in the virtual class prohibited from localhost on New Year's Day of 2004.
-
 
60
<pre>
53
<br/><span class="tt" class="wims_code_words">class: ! 127.0.0.1 >20040101.00:00 <20040101.23:59</span>
61
<span class="tt wims_code_words">class:! 127.0.0.1 &gt;$(year)0101.00:00 &lt;$(year)0101.23:59</span>
-
 
62
</pre></div><div>
-
 
63
# Work in the virtual class prohibited from 10pm to 6am on the days of October.
-
 
64
<pre>
-
 
65
<span class="tt wims_code_words">class:! &gt;****10**.22:00 &lt;****10**.23:59</span>
-
 
66
<span class="tt wims_code_words">class:! &gt;****10**.00:00 &lt;****10**.06:00</span>
54
</p>
67
</pre>
55
 
68
</div>