Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 16 files changed
  • 0 comments
  • 1 contributor
10 courses/course-template.phps
@@ -6,22 +6,22 @@ require("courseheader.php");
6 6
7 7 <div id="coursenavigation">
8 8 <ol class="tree">
9   - <li class="file"><a href="#" onClick="selectPart('default')">Introduction</a></li>
  9 + <li class="file"><a data-contentid="default" href="#/course/General/Introduction">Introduction</a></li>
10 10 <li>
11 11 <label for="theory">Theory</label><input type="checkbox" checked id="theory" />
12 12 <ol>
13   - <li class="file"><a href="#" onClick="selectPart('chapter1')">Chapter 1</a></li>
  13 + <li class="file"><a data-contentid="chapter1" href="#/course/General/Chapter+1">Chapter 1</a></li>
14 14 *** add more chapter links here ***
15 15 </ol>
16 16 </li>
17 17 <li>
18 18 <label for="exercises">Exercises</label> <input type="checkbox" checked id="exercises" />
19 19 <ol>
20   - <li class="file"><a href="#" onClick="selectPart('exercise1')">Exercise 1</a></li>
  20 + <li class="file"><a data-contentid="exercise1" href="#/course/General/Exercise+1">Exercise 1</a></li>
21 21 *** add more exercise links here ***
22 22 </ol>
23 23 </li>
24   - <li class="file"><a href="#" onClick="selectPart('examn')">Exam</a></li>
  24 + <li class="file"><a data-contentid="examn" href="#/course/General/Exam">Exam</a></li>
25 25 </ol>
26 26 </div>
27 27
@@ -29,7 +29,7 @@ require("courseheader.php");
29 29
30 30 <div id="default">
31 31 Default
32   - <p class="center"><a href="#" onClick="selectPart('chapter1')">>> Next Chapter >></a></p>
  32 + <p class="center"><a href="#/course/General/[nextChapterName]">>> Next Chapter >></a></p>
33 33 </div>
34 34
35 35 <div id="chapter1">
66 courses/course.php
@@ -27,20 +27,62 @@
27 27 // Description: Load the course file specified by the GET variable 'id'
28 28 //
29 29
30   - $courseid = isset($_GET['id']) ? $_GET['id'] : 0;
31   - $errorstring = "<p class=\"center\"><img alt=\"Y U NO GIVE ID\" src=\"images/yuno.png\" /><br /><br />No active course, select a valid course from the overview!</p>";
32   - $filename = "courses/course".$courseid.".php";
  30 + if(isset($_GET['id'])){
  31 +
  32 + }
  33 +
  34 + $errorstring = "<p class=\"center\"><img alt=\"Y U NO GIVE ID\" src=\"images/yuno.png\" /><br /><br />No active course, select a valid course from the navigation on the left!
  35 + </p>";
  36 +
33 37 $mincourseid = 0;
34 38 $maxcourseid = 100000;
35 39
36   - if(!isset($courseid)||!is_numeric($courseid)||$courseid<$mincourseid||$courseid>$maxcourseid)
37   - echo $errorstring;
38   - else
39   - {
40   - if(is_readable($filename))
41   - include($filename);
42   - else
43   - echo $errorstring;
44   - }
  40 + echo '<div id="coursenavigation">
  41 + <ol class="tree">';
  42 +
  43 + foreach($categories as $id => $name){
  44 + echo '<li><a href="/course/'.urlencode($name).'"><label for="'.urlencode($name).'">
  45 + '.$name.'</label></a>
  46 + <input type="checkbox" id="'.urlencode($name).'" />';
  47 + if(count($tree[$id]) > 0){
  48 + echo '<ol>';
  49 + }
  50 + foreach($tree[$id] as $course){
  51 + echo '<li><a href="/course/'.urlencode($name)
  52 + .'/'.urlencode($course['title']).'"><label for="'.urlencode($course['title']).'">
  53 + '.$course['title'].'</label></a>
  54 + <input type="checkbox" id="'.urlencode($course['title']).'" />
  55 + <ol>';
  56 + $filename = "courses/course".$course['id'].".php";
  57 + if(is_readable($filename)){
  58 + $courseData = include($filename);
  59 + }
  60 + if($courseData['nav']) foreach($courseData['nav'] as $chapterType => $chapters){
  61 + if($chapters) foreach($chapters as $contentId => $chapterName){
  62 + //$chapterType class to style icons
  63 + echo '<li class="file '.$chapterType.'"><a
  64 + data-contentid="'.$contentId.'"
  65 + data-chapterid="'.$chapterName.'_'.$course['id'].'"
  66 + href="/course/'.urlencode($name)
  67 + .'/'.urlencode($course['title'])
  68 + .'/'.urlencode($chapterName).'">'.$chapterName.'
  69 + </a>
  70 + <script type="text/html" id="'.$chapterName.'_'.$course['id'].'">
  71 + '.$courseData['content'][$chapterType][$contentId].'
  72 + </script>
  73 + </li>';
  74 + }
  75 + }
  76 + echo '</ol></li>';
  77 + }
  78 + if(count($tree[$id]) > 0){
  79 + echo '</ol>';
  80 + }
  81 + echo '</li>';
  82 + }
  83 + echo '</ol><!-- end ol class tree -->
  84 + </div><!-- end div id="coursenavigation" -->';
  85 +
45 86 ?>
  87 + <div id="coursecontent"><?php echo $errorstring; ?></div>
46 88 </div>
12 courses/courseheader.php
@@ -20,16 +20,13 @@
20 20 // //
21 21 ///////////////////////////////////////////////////////////////////////////////////
22 22
23   -require("../getsmfuser.php");
  23 +require_once("../getsmfuser.php");
24 24
25 25 $notloggedintext = "<p class=\"warning\">Warning: You aren't logged in to the Hackits forum, submitting this exam will only count if you are logged in!</p>";
  26 +$courseid = isset($_GET['id']) ? $_GET['id'] : 0;
26 27
27 28 ?>
28 29 <script type="text/javascript">
29   -
30   - // shows the specified div and hides all others
31   - function selectPart(part){ $("#"+part).show().siblings().hide(); }
32   -
33 30 // when the examn form is submitted, show the results in a dialog window
34 31 $(document).ready(function(){
35 32 $("#examnform").submit( function () {
@@ -37,8 +34,7 @@ function selectPart(part){ $("#"+part).show().siblings().hide(); }
37 34 'examnhandler.php?id=<? echo $courseid; ?>',
38 35 $(this).serialize(),
39 36 function(data){
40   - $("#examnresult").empty().append( data );
41   - $("#examnresult").dialog("open");
  37 + $("#examnresult").empty().append(data).dialog("open");
42 38 }
43 39 );
44 40 return false;
@@ -51,4 +47,4 @@ function(data){
51 47
52 48 </script>
53 49
54   -<div id="examnresult" title="Exam Results"></div>
  50 +<div id="examnresult" title="Exam Results"></div>
187 courses/courses/course1.php
... ... @@ -1,93 +1,96 @@
1 1 <?php
2   - require("courseheader.php");
3   -?>
4   -<div id="coursenavigation">
5   - <ol class="tree">
6   - <li class="file"><a href="#" onClick="selectPart('default')">Introduction</a></li>
7   - <li>
8   - <label for="theory">Theory</label><input type="checkbox" checked id="theory" />
9   - <ol>
10   - <li class="file"><a href="#" onClick="selectPart('chapter1')">Hackits Courses</a></li>
11   - <li class="file"><a href="#" onClick="selectPart('chapter2')">More about courses</a></li>
12   - </ol>
13   - </li>
14   - <li>
15   - <label for="exercises">Exercises</label> <input type="checkbox" checked id="exercises" />
16   - <ol>
17   - <li class="file"><a href="#" onClick="selectPart('exercise1')">Exercise 1</a></li>
18   - </ol>
19   - </li>
20   - <li class="file"><a href="#" onClick="selectPart('examn')">Exam</a></li>
21   - </ol>
22   -</div>
23   -<div id="coursecontent">
24   - <div id="default">
25   - <h1>Welcome</h1>
26   - <p>Thanks for checking out the Hackits Courses! These courses will help you to learn a lot about a wide variety of topics related to hacking, computer security, and a lot more. They will help you tackle the Hackits challenges and lift your general skill as a hacker to a higher level.</p>
27   - <p>Click on the skull to continue to the first chapter of this introduction course!</p>
28   - <p class="center"><a href="#" onClick="selectPart('chapter1')"><img alt="skull" src="images/course1skull.jpg" /></a></p>
29   - </div>
30   - <div id="chapter1">
31   - <h1>Hackits Courses</h1>
32   - <h2>Course structure</h2>
33   - <p>All courses consist of one or more theory chapters, usually followed by some exercises that allow you to test your understanding of the theory. These exercises are always optional. Finally there is an exam for each course, which will show that you master the course contents and will earn you Hackits points! There is no time limit or penalty for reading a course or doing an exam, so no need to stress.</p>
34   - <p>At the left of the screen you see how the course is structured, and you can select a chapter/exercise to display and an exam link at the bottom of the list. Usually you will find links to the next part at the bottom of a page as well. At the top of the screen you see some tabs, currently you are in the 'Current Course' tab of the Courses system. At any time you can click on another tab to check out its contents, as long as you dont select a different course from the overview or refresh the page, your 'Current Course' tab will stay the same as when you left it.</p>
35   - <h2>Logging in</h2>
36   - <p>We advise that you first log in to the <a href="http://www.hackits.be/forum/" target="new">Hackits forum</a> before using the Courses system, because it will allow you to view which courses you completed in the overview, and it will allow the courses system to award you personally with points when completing an exam. You can see if you are logged in by checking out the top bar of the Courses page, which should say 'Logged in as: ' followed by your forum account name. If you submit an exam without being logged in, a warning will be displayed telling you to log in to the forum in a different browser tab or window, no need to fill in the exam again.</p>
37   - <h2>Difficulty</h2>
38   - <p>Each course has a difficulty level assigned to it by the Hackits team, the higher the difficulty the higher the score thats rewarded by completing the exam. Also at the start of a course there might be links to other courses as prerequisites listed, we advise that you complete those courses so you will have a much smoother learning curve. </p>
39   - <p>If you think you already know the contents of a course and want to skip right to the exam, feel free to do so, but keep in mind that there might be details in the theory that you didn't know about, or can use some refreshing in your brain. </p>
40   - <h2>Disclaimer</h2>
41   - <p>All information given to you in these courses is to be used for educational purposes only, and the hacking/cracking techniques described should be performed on your own systems, or on systems where you have explicit permission from its owner to use them for these purposes. Not following these rules can result in very large fines or even jailtime in some countries.</p>
42   - <p class="center"><a href="#" onClick="selectPart('chapter2')">>> Next Chapter >></a></p>
43   - </div>
44   - <div id="chapter2">
45   - <h1>More about courses</h1>
46   - <h2>Getting help</h2>
47   - <p>The best place to get help on a course is the <a href="http://www.hackits.be/forum/index.php?board=12.0">Courses Help section</a> in the forum. In here, other hackits members and staff can help you out and think along. The questions and remarks you give us, can help us make the courses better for everybody!</p>
48   - <p>If you need realtime communication then IRC might be a good choice instead, but keep in mind that the author of the course might not be available or on IRC at all.</p>
49   - <h2>Feedback</h2>
50   - <p>If something about the Course system is not working like it should, or isn't being displayed properly in your browser, or the actual content of the course is outdated or false, there are a few ways to get in contact with the Hackits team.</p>
51   - <p>First of all, security-related issues should always be communicated privately to one of the Hackits <a href="http://www.hackits.be/forum/index.php?action=mlist;sort=id_group;start=0">Administrators</a>, either trough a private message on the forum, or a query on IRC.</p>
52   - <p>Technical issues or styling (HTML/CSS) issues are probably best discussed with the author of the Courses system, Sling. He is usually available on IRC but you can of course <a href="http://www.hackits.be/forum/index.php?action=pm;sa=send;u=2">PM</a> him on the Forum as well.</p>
53   - <p>All other feedback can be given publically in the <a href="http://www.hackits.be/forum/index.php?board=11.0">right section in the Forum</a>.</p>
54   - <h2>Submitting your own course</h2>
55   - <p>If you want to share your knowledge about a certain topic that hasn't already been covered in a course, feel free to submit your own tutorial on it to <a href="http://www.hackits.be/forum/index.php?topic=11.0">the forum</a>. Staff will check it out and if it meets the quality standards for a course, we will try to get in contact with you to create a new course! If you aren't sure if the topic has been covered or if your idea is suitable for a course, just join us on IRC and we can have a chat!</p>
56   - <h2>Final words</h2>
57   - <p>This is all we have to tell you about the courses system itself, head over to the <a href="#" onClick="selectPart('exercise1')">exercise</a> to see how an example exercise looks.</p>
58   - <p>Welcome again and have a great learning experience!</p>
59   - </div>
60   - <div id="exercise1">
61   - <h3>Exercise 1:</h3>
62   - <p>Exercises are small tests you can do yourself to see if you understood the contents of the course. Each exercise has an answer that can be revealed by clicking on the 'Reveal Answer' button.</p>
63   - <p>Now it would be a bit silly to have an exercise for this course, but we can at least show you how an exercise would look like. So here it goes: the exercise for this course is to reveal the answer to this exercise!</p>
64   - <div class="revealbutton" onClick="$('#answer1').show(); $('.revealbutton').hide(); ">Reveal Answer</div>
65   - <div class="answer" id="answer1">
66   - <p>Well done, you revealed the answer!</p>
67   - <p>This is the only exercise for this course, think you are ready for the exam? <a href="#" onClick="selectPart('examn')">Click here</a> to check it out!</p>
68   - </div>
69   - </div>
70   - <div id="examn">
71   - <h2>Exam Time!</h2><br />
72   - <? if(!$loggedin) echo $notloggedintext; ?>
73   - <form id="examnform" name="examnform" method="post" action="">
74   - <div class="question">
75   - <h3>Question 1</h3><br />
76   - <p>Why should I do any courses?</p>
77   - <input type="radio" value="A" id="radio1" name="1" /><label for="radio1">For fun and for learning</label><br />
78   - <input type="radio" value="B" id="radio2" name="1" /><label for="radio2">They help me with challenges and give Hackits points</label><br />
79   - <input type="radio" value="C" id="radio3" name="1" /><label for="radio3">All of the above!</label><br />
80   - </div>
81   - <div class="question">
82   - <h3>Question 2</h3><br />
83   - <p>What should I do when I find a security vulnerability that allows me to complete any course?</p>
84   - <input type="radio" value="A" id="radio1" name="2" /><label for="radio1">Dont mention it, I could get the highest score in the ranking!</label><br />
85   - <input type="radio" value="B" id="radio2" name="2" /><label for="radio2">Make a new topic on the forum to warn everybody</label><br />
86   - <input type="radio" value="C" id="radio3" name="2" /><label for="radio3">Send a private message to one of the Administrators</label><br />
87   - </div>
88   - <div id="examnsubmit">
89   - <button>Submit</button>
90   - </div>
91   - </form>
92   - </div>
93   -</div>
  2 +$msg = !$loggedin ? $notloggedintext : '';
  3 +return array(
  4 + 'nav' => array(
  5 + 'default' => array(
  6 + 'chapter1' => 'Hackits Courses',
  7 + 'chapter2' => 'More about courses',
  8 + ),
  9 + 'exercises' => array(
  10 + 'exercise1' => 'Exercise 1',
  11 + ),
  12 + 'exam' => array(
  13 + 'exam1' => 'Exam',
  14 + )
  15 + ),
  16 + 'content' => array(
  17 + 'default' => array(
  18 + 'index' => <<<°
  19 + <h1>Welcome</h1>
  20 + <p>Thanks for checking out the Hackits Courses! These courses will help you to learn a lot about a wide variety of topics related to hacking, computer security, and a lot more. They will help you tackle the Hackits challenges and lift your general skill as a hacker to a higher level.</p>
  21 + <p>Click on the skull to continue to the first chapter of this introduction course!</p>
  22 + <p class="center"><a href="#"><img alt="skull" src="images/course1skull.jpg" /></a></p>
  23
  24 + ,
  25 + 'chapter1' => <<<°
  26 + <h1>Hackits Courses</h1>
  27 + <h2>Course structure</h2>
  28 + <p>All courses consist of one or more theory chapters, usually followed by some exercises that allow you to test your understanding of the theory. These exercises are always optional. Finally there is an exam for each course, which will show that you master the course contents and will earn you Hackits points! There is no time limit or penalty for reading a course or doing an exam, so no need to stress.</p>
  29 + <p>At the left of the screen you see how the course is structured, and you can select a chapter/exercise to display and an exam link at the bottom of the list. Usually you will find links to the next part at the bottom of a page as well. At the top of the screen you see some tabs, currently you are in the 'Current Course' tab of the Courses system. At any time you can click on another tab to check out its contents, as long as you dont select a different course from the overview or refresh the page, your 'Current Course' tab will stay the same as when you left it.</p>
  30 + <h2>Logging in</h2>
  31 + <p>We advise that you first log in to the <a href="http://www.hackits.be/forum/" target="new">Hackits forum</a> before using the Courses system, because it will allow you to view which courses you completed in the overview, and it will allow the courses system to award you personally with points when completing an exam. You can see if you are logged in by checking out the top bar of the Courses page, which should say 'Logged in as: ' followed by your forum account name. If you submit an exam without being logged in, a warning will be displayed telling you to log in to the forum in a different browser tab or window, no need to fill in the exam again.</p>
  32 + <h2>Difficulty</h2>
  33 + <p>Each course has a difficulty level assigned to it by the Hackits team, the higher the difficulty the higher the score thats rewarded by completing the exam. Also at the start of a course there might be links to other courses as prerequisites listed, we advise that you complete those courses so you will have a much smoother learning curve. </p>
  34 + <p>If you think you already know the contents of a course and want to skip right to the exam, feel free to do so, but keep in mind that there might be details in the theory that you didn't know about, or can use some refreshing in your brain. </p>
  35 + <h2>Disclaimer</h2>
  36 + <p>All information given to you in these courses is to be used for educational purposes only, and the hacking/cracking techniques described should be performed on your own systems, or on systems where you have explicit permission from its owner to use them for these purposes. Not following these rules can result in very large fines or even jailtime in some countries.</p>
  37 + <p class="center"><a href="#/course/General/Internet+Relay+Chat+%28IRC%29">>> Next Chapter >></a></p>
  38
  39 + ,
  40 + 'chapter2' => <<<°
  41 + <h1>More about courses</h1>
  42 + <h2>Getting help</h2>
  43 + <p>The best place to get help on a course is the <a href="http://www.hackits.be/forum/index.php?board=12.0">Courses Help section</a> in the forum. In here, other hackits members and staff can help you out and think along. The questions and remarks you give us, can help us make the courses better for everybody!</p>
  44 + <p>If you need realtime communication then IRC might be a good choice instead, but keep in mind that the author of the course might not be available or on IRC at all.</p>
  45 + <h2>Feedback</h2>
  46 + <p>If something about the Course system is not working like it should, or isn't being displayed properly in your browser, or the actual content of the course is outdated or false, there are a few ways to get in contact with the Hackits team.</p>
  47 + <p>First of all, security-related issues should always be communicated privately to one of the Hackits <a href="http://www.hackits.be/forum/index.php?action=mlist;sort=id_group;start=0">Administrators</a>, either trough a private message on the forum, or a query on IRC.</p>
  48 + <p>Technical issues or styling (HTML/CSS) issues are probably best discussed with the author of the Courses system, Sling. He is usually available on IRC but you can of course <a href="http://www.hackits.be/forum/index.php?action=pm;sa=send;u=2">PM</a> him on the Forum as well.</p>
  49 + <p>All other feedback can be given publically in the <a href="http://www.hackits.be/forum/index.php?board=11.0">right section in the Forum</a>.</p>
  50 + <h2>Submitting your own course</h2>
  51 + <p>If you want to share your knowledge about a certain topic that hasn't already been covered in a course, feel free to submit your own tutorial on it to <a href="http://www.hackits.be/forum/index.php?topic=11.0">the forum</a>. Staff will check it out and if it meets the quality standards for a course, we will try to get in contact with you to create a new course! If you aren't sure if the topic has been covered or if your idea is suitable for a course, just join us on IRC and we can have a chat!</p>
  52 + <h2>Final words</h2>
  53 + <p>This is all we have to tell you about the courses system itself, head over to the <a href="#">exercise</a> to see how an example exercise looks.</p>
  54 + <p>Welcome again and have a great learning experience!</p>
  55
  56 + ),
  57 + 'exercises' => array(
  58 + 'exercise1' => <<<°
  59 + <h3>Exercise 1:</h3>
  60 + <p>Exercises are small tests you can do yourself to see if you understood the contents of the course. Each exercise has an answer that can be revealed by clicking on the 'Reveal Answer' button.</p>
  61 + <p>Now it would be a bit silly to have an exercise for this course, but we can at least show you how an exercise would look like. So here it goes: the exercise for this course is to reveal the answer to this exercise!</p>
  62 + <div class="revealbutton" onClick="$('#answer1').show(); $('.revealbutton').hide(); ">Reveal Answer</div>
  63 + <div class="answer" id="answer1">
  64 + <p>Well done, you revealed the answer!</p>
  65 + <p>This is the only exercise for this course, think you are ready for the exam? <a href="#/course/General/Intro+to+Hackits+Courses/Exam">Click here</a> to check it out!</p>
  66 + </div>
  67
  68 + ,
  69 + ),
  70 + 'exam' => array(
  71 + 'exam1' => <<<°
  72 + <h2>Exam Time!</h2><br />
  73 + $msg
  74 + <form id="examnform" name="examnform" method="post" action="">
  75 + <div class="question">
  76 + <h3>Question 1</h3><br />
  77 + <p>Why should I do any courses?</p>
  78 + <input type="radio" value="A" id="radio11" name="1" /><label for="radio1">For fun and for learning</label><br />
  79 + <input type="radio" value="B" id="radio12" name="1" /><label for="radio2">They help me with challenges and give Hackits points</label><br />
  80 + <input type="radio" value="C" id="radio13" name="1" /><label for="radio3">All of the above!</label><br />
  81 + </div>
  82 + <div class="question">
  83 + <h3>Question 2</h3><br />
  84 + <p>What should I do when I find a security vulnerability that allows me to complete any course?</p>
  85 + <input type="radio" value="A" id="radio21" name="2" /><label for="radio1">Dont mention it, I could get the highest score in the ranking!</label><br />
  86 + <input type="radio" value="B" id="radio22" name="2" /><label for="radio2">Make a new topic on the forum to warn everybody</label><br />
  87 + <input type="radio" value="C" id="radio23" name="2" /><label for="radio3">Send a private message to one of the Administrators</label><br />
  88 + </div>
  89 + <div id="examnsubmit">
  90 + <button>Submit</button>
  91 + </div>
  92 + </form>
  93
  94 + ),
  95 + )
  96 +);
330 courses/courses/course2.php
... ... @@ -1,166 +1,170 @@
1 1 <?php
2   - require("courseheader.php");
3   -?>
4   -<div id="coursenavigation">
5   - <ol class="tree">
6   - <li class="file"><a href="#" onClick="selectPart('default')">Introduction</a></li>
7   - <li>
8   - <label for="theory">Theory</label><input type="checkbox" checked id="theory" />
9   - <ol>
10   - <li class="file"><a href="#" onClick="selectPart('chapter1')">DHCP</a></li>
11   - <li class="file"><a href="#" onClick="selectPart('chapter2')">Firewalling</a></li>
12   - <li class="file"><a href="#" onClick="selectPart('chapter3')">DNS</a></li>
13   - <li class="file"><a href="#" onClick="selectPart('chapter4')">NTP</a></li>
14   - </ol>
15   - </li>
16   - <li>
17   - <label for="exercises">Exercises</label> <input type="checkbox" checked id="exercises" />
18   - <ol>
19   - <li class="file"><a href="#" onClick="selectPart('exercise1')">Exercise 1</a></li>
20   - </ol>
21   - </li>
22   - <li class="file"><a href="#" onClick="selectPart('examn')">Exam</a></li>
23   - </ol>
24   -</div>
25   -<div id="coursecontent">
26   - <div id="default">
27   - <h1>Welcome to Practical Networks!</h1>
28   - <p>This course's objective is to help you managing your home network with the standard unix tools.</p>
29   - <p>While I will skip the technical details and strip these guides to the essential, some understanding of the underlying protocols will greatly help you though.</p><br />
30   - <p>In this course, we will be considering working on the following example network</p>
31   - <img alt="example network 1" src="images/example_network.png" />
32   - <p>It is connected to the internet through a Modem. Most nowadays ADSL and cable modems have a dhcp server configured trough a limited "clicky friendly" web interface (I don't like this). The box we will be configuring is the Router/Firewall (in the middle), it has 4 network interfaces:</p>
33   - <p>eth0 - 192.168.1.2 - This interface receives it's IP by dhcp.</p>
34   - <p>eth1 - 172.25.3.1 (statically declared) - Is our internal network.</p>
35   - <p>eth2 - 10.192.168.1 (statically declared) - Is our wifi.</p>
36   - <p>eth3 - 10.20.30.1 (statically declared) - Is a DMZ with a server accessible from the internet.</p><br />
37   - <p>The first chapter will explain you how to set a DHCP server, shaping your networks in zones.</p>
38   - <p>The second chapter will guide you trough the setup of the routing and filtering</p>
39   - <p>The third and fourth chapters will help you setup NTP and DNS on your network</p>
40   - <p class="center"><a href="#" onClick="selectPart('chapter1')"> to chapter 1</a></p>
41   - </div>
42   - <div id="chapter1">
43   - <h1>Dynamic Host Configuration Protocol</h1>
44   - <h2>Theory</h2><br />
45   - <p>DHCP stands for Dynamic Host Configuration Protocol and is used for automated/centralized configuration of IP addresses.</p>
46   - <p>This tutorial's objective is to cover the 1% of dhcp capabilities that is sufficient in 99% of it's uses, and to get your dhcp server running.</p>
47   - <p>If you want a deeper understanding of DHCP, please consult <a href=http://tools.ietf.org/html/rfc2131>RFC2131</a></p><br />
48   - <p>Basically, when you connect your computer to a network cable or a wifi network and things just work, it is thanks to DHCP, it gives your computer a free IP address in the right range, the submask, default gateway, DNS server it's supposed to use (and some other things too).</p>
49   - <ul>
50   - <li> You plug the cable in the computer </li>
51   - <li> The DHCP client sends out a DHCPDISCOVER</li>
52   - <li> The DHCP server receives it and sends a DHCPOFFER</li>
53   - <li> The DHCP client confirms responding with a DHCPREQUEST</li>
54   - <li> The DHCP server confirms with a DHCPACK to confirm the settings</li>
55   - <li> Your computer now has an IP address, knows it's network submask and default gateway, as well as the DNS server it's supposed to use (and maybe some other things too).</li>
56   - <li> When leaving the network, the DHCP client sends a DHCPRELEASE.</li>
57   - </ul><br />
58   - <h2>Practice</h2><br />
59   - <h3>Client setup</h3>
60   - <p>To configure the client in windows, set your interface on automatic configuration.</p>
61   - <p>To configure the interface un *nix, use "dhclient [interface]" as root in a console.</p><br />
62   - <p><strong>Now the interesting part: let's configure the server on a *nix.</strong></p><br />
63   - <p>First install the dhcpd package - it's name varies according to distributions ("net-misc/dhcp" in gentoo, "dhcp" in redhat, "dhcp3-server" in debian, installed by default on OpenBSD, ...)</p>
64   - <p>Then configure it : everything happens in the /etc/dhcpd.conf file</p><br />
65   - <p class="code">#dhcpd.conf file - lines starting with # are comments.<br />
66   - #enter your domain here - if you don't have one, you can use quite anything unreal, like "thisis.local"<br />
67   - &nbsp;&nbsp;option domain-name "hackits.be";<br />
68   - #DNS server your clients should use by default (here google's)<br />
69   - &nbsp;&nbsp;option domain-name-servers 8.8.8.8;<br />
70   - #options on the lease time<br />
71   - &nbsp;&nbsp;default-lease-time 86000;<br />
72   - &nbsp;&nbsp;max-lease-time 100000;<br />
73   - #authoritative should be used on your networks primary dhcp.<br />
74   - &nbsp;&nbsp;authoritative;<br /><br />
75   - #now we go to subnet declarations - thes override global settings<br />
76   - # dhcpd automaticaly uses the subnet on the appropriate interface: <br />
77   - # eth1 has 172.25.3.1, thus dhcpd will automaticaly use this subnet on this interface<br />
78   - &nbsp;&nbsp;&nbsp;&nbsp; subnet 172.25.3.0 netmask 255.255.255.0 {<br />
79   - #the range defines a pool of random adresses, the computers defined lower should NOT be in the range!<br />
80   - &nbsp;&nbsp;&nbsp;&nbsp; range 172.25.3.50 172.25.3.229;<br />
81   - #custom domain for this zone, the computers will then be PC1.lan.hackits.be and so on.<br />
82   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option domain-name "lan.hackits.be";<br />
83   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option broadcast-address 172.25.3.255;<br />
84   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option routers 172.25.3.1;<br />
85   - #use a different name server for this zones.<br />
86   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option domain-name-servers 172.25.3.1;<br />
  2 + $msg = !$loggedin ? $notloggedintext : '';
  3 + return array(
  4 + 'nav' => array(
  5 + 'default' => array(
  6 + 'chapter1' => 'DHCP',
  7 + 'chapter2' => 'Firewalling',
  8 + ),
  9 + 'exercises' => array(
  10 + 'exercise1' => 'Exercise 1',
  11 + ),
  12 + 'exam' => array(
  13 + 'exam1' => 'Exam',
  14 + )
  15 + ),
  16 + 'content' => array(
  17 + 'default' => array(
  18 + 'index' => <<<°
  19 + <h1>Welcome to Practical Networks!</h1>
  20 + <p>This course's objective is to help you managing your home network with the standard unix tools.</p>
  21 + <p>While I will skip the technical details and strip these guides to the essential, some understanding of the underlying protocols will greatly help you though.</p><br />
  22 + <p>In this course, we will be considering working on the following example network</p>
  23 + <img alt="example network 1" src="images/example_network.png" />
  24 + <p>It is connected to the internet through a Modem. Most nowadays ADSL and cable modems have a dhcp server configured trough a limited "clicky friendly" web interface (I don't like this). The box we will be configuring is the Router/Firewall (in the middle), it has 4 network interfaces:</p>
  25 + <p>eth0 - 192.168.1.2 - This interface receives it's IP by dhcp.</p>
  26 + <p>eth1 - 172.25.3.1 (statically declared) - Is our internal network.</p>
  27 + <p>eth2 - 10.192.168.1 (statically declared) - Is our wifi.</p>
  28 + <p>eth3 - 10.20.30.1 (statically declared) - Is a DMZ with a server accessible from the internet.</p><br />
  29 + <p>The first chapter will explain you how to set a DHCP server, shaping your networks in zones.</p>
  30 + <p>The second chapter will guide you trough the setup of the routing and filtering</p>
  31 + <p>The third and fourth chapters will help you setup NTP and DNS on your network</p>
  32 + <p class="center"><a href="#"> to chapter 1</a></p>
  33
  34 + ,
  35 + 'chapter1' => <<<°
  36 + <h1>Dynamic Host Configuration Protocol</h1>
  37 + <h2>Theory</h2><br />
  38 + <p>DHCP stands for Dynamic Host Configuration Protocol and is used for automated/centralized configuration of IP addresses.</p>
  39 + <p>This tutorial's objective is to cover the 1% of dhcp capabilities that is sufficient in 99% of it's uses, and to get your dhcp server running.</p>
  40 + <p>If you want a deeper understanding of DHCP, please consult <a href=http://tools.ietf.org/html/rfc2131>RFC2131</a></p><br />
  41 + <p>Basically, when you connect your computer to a network cable or a wifi network and things just work, it is thanks to DHCP, it gives your computer a free IP address in the right range, the submask, default gateway, DNS server it's supposed to use (and some other things too).</p>
  42 + <ul>
  43 + <li> You plug the cable in the computer </li>
  44 + <li> The DHCP client sends out a DHCPDISCOVER</li>
  45 + <li> The DHCP server receives it and sends a DHCPOFFER</li>
  46 + <li> The DHCP client confirms responding with a DHCPREQUEST</li>
  47 + <li> The DHCP server confirms with a DHCPACK to confirm the settings</li>
  48 + <li> Your computer now has an IP address, knows it's network submask and default gateway, as well as the DNS server it's supposed to use (and maybe some other things too).</li>
  49 + <li> When leaving the network, the DHCP client sends a DHCPRELEASE.</li>
  50 + </ul><br />
  51 + <h2>Practice</h2><br />
  52 + <h3>Client setup</h3>
  53 + <p>To configure the client in windows, set your interface on automatic configuration.</p>
  54 + <p>To configure the interface un *nix, use "dhclient [interface]" as root in a console.</p><br />
  55 + <p><strong>Now the interesting part: let's configure the server on a *nix.</strong></p><br />
  56 + <p>First install the dhcpd package - it's name varies according to distributions ("net-misc/dhcp" in gentoo, "dhcp" in redhat, "dhcp3-server" in debian, installed by default on OpenBSD, ...)</p>
  57 + <p>Then configure it : everything happens in the /etc/dhcpd.conf file</p><br />
  58 + <p class="code">#dhcpd.conf file - lines starting with # are comments.<br />
  59 + #enter your domain here - if you don't have one, you can use quite anything unreal, like "thisis.local"<br />
  60 + &nbsp;&nbsp;option domain-name "hackits.be";<br />
  61 + #DNS server your clients should use by default (here google's)<br />
  62 + &nbsp;&nbsp;option domain-name-servers 8.8.8.8;<br />
  63 + #options on the lease time<br />
  64 + &nbsp;&nbsp;default-lease-time 86000;<br />
  65 + &nbsp;&nbsp;max-lease-time 100000;<br />
  66 + #authoritative should be used on your networks primary dhcp.<br />
  67 + &nbsp;&nbsp;authoritative;<br /><br />
  68 + #now we go to subnet declarations - thes override global settings<br />
  69 + # dhcpd automaticaly uses the subnet on the appropriate interface: <br />
  70 + # eth1 has 172.25.3.1, thus dhcpd will automaticaly use this subnet on this interface<br />
  71 + &nbsp;&nbsp;&nbsp;&nbsp; subnet 172.25.3.0 netmask 255.255.255.0 {<br />
  72 + #the range defines a pool of random adresses, the computers defined lower should NOT be in the range!<br />
  73 + &nbsp;&nbsp;&nbsp;&nbsp; range 172.25.3.50 172.25.3.229;<br />
  74 + #custom domain for this zone, the computers will then be PC1.lan.hackits.be and so on.<br />
  75 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option domain-name "lan.hackits.be";<br />
  76 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option broadcast-address 172.25.3.255;<br />
  77 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option routers 172.25.3.1;<br />
  78 + #use a different name server for this zones.<br />
  79 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option domain-name-servers 172.25.3.1;<br />
87 80
88   - #now we bind some mac addresses to IP's, so that those computers always receive the same address.<br />
89   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host PC1 {<br />
90   - #to get the hardware ethernet, use "ifconfig" with *nix or "ipconfig /all" with windows (cmd).<br />
91   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware ethernet 00:11:22:33:44:55;<br />
92   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fixed-address 172.25.3.2;<br />
93   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
94   -<br />
95   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host PC2 {<br />
96   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware ethernet 00:22:33:44:55:66;<br />
97   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fixed-address 172.25.3.3;<br />
98   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
99   -<br />
100   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host Printer {<br />
101   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware ethernet 00:33:44:55:66:77;<br />
102   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fixed-address 172.25.3.4;<br />
103   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
104   -<br />
105   -#and we close the subnet<br />
106   - &nbsp;&nbsp;&nbsp;&nbsp;}<br />
107   -<br />
108   - #our wifi and dmz networks are similar, but with less comments<br />
109   - <br />
110   - &nbsp;&nbsp;&nbsp;&nbsp;subnet 10.192.168.0 netmask 255.255.255.0 {<br />
111   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;range 10.192.168.50 10.192.168.254;<br />
112   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option domain-name "wifi.hackits.be";<br />
113   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option broadcast-address 10.192.168.255;<br />
114   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option routers 10.192.168.1;<br />
115   - &nbsp;&nbsp;&nbsp;&nbsp;}<br />
116   -<br />
117   - &nbsp;&nbsp;&nbsp;&nbsp;subnet 10.20.30.0 netmask 255.255.255.0 {<br />
118   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;range 10.20.30.100 10.20.30.254;<br />
119   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option domain-name "dmz.hackits.be";<br />
120   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option broadcast-address 10.20.30.255;<br />
121   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option routers 10.20.30.1;<br />
122   - #Here you could also declare a tftp server.<br />
123   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option tftp-server-name "10.20.30.1";<br />
124   -<br />
125   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host web1 {<br />
126   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware ethernet 00:11:55:77:99:BB;<br />
127   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fixed-address 10.20.30.40;<br />
128   - &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
129   - &nbsp;&nbsp;&nbsp;&nbsp;}<br />
130   - </p><br />
  81 + #now we bind some mac addresses to IP's, so that those computers always receive the same address.<br />
  82 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host PC1 {<br />
  83 + #to get the hardware ethernet, use "ifconfig" with *nix or "ipconfig /all" with windows (cmd).<br />
  84 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware ethernet 00:11:22:33:44:55;<br />
  85 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fixed-address 172.25.3.2;<br />
  86 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
  87 + <br />
  88 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host PC2 {<br />
  89 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware ethernet 00:22:33:44:55:66;<br />
  90 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fixed-address 172.25.3.3;<br />
  91 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
  92 + <br />
  93 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host Printer {<br />
  94 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware ethernet 00:33:44:55:66:77;<br />
  95 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fixed-address 172.25.3.4;<br />
  96 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
  97 + <br />
  98 + #and we close the subnet<br />
  99 + &nbsp;&nbsp;&nbsp;&nbsp;}<br />
  100 + <br />
  101 + #our wifi and dmz networks are similar, but with less comments<br />
  102 + <br />
  103 + &nbsp;&nbsp;&nbsp;&nbsp;subnet 10.192.168.0 netmask 255.255.255.0 {<br />
  104 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;range 10.192.168.50 10.192.168.254;<br />
  105 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option domain-name "wifi.hackits.be";<br />
  106 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option broadcast-address 10.192.168.255;<br />
  107 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option routers 10.192.168.1;<br />
  108 + &nbsp;&nbsp;&nbsp;&nbsp;}<br />
  109 + <br />
  110 + &nbsp;&nbsp;&nbsp;&nbsp;subnet 10.20.30.0 netmask 255.255.255.0 {<br />
  111 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;range 10.20.30.100 10.20.30.254;<br />
  112 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option domain-name "dmz.hackits.be";<br />
  113 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option broadcast-address 10.20.30.255;<br />
  114 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option routers 10.20.30.1;<br />
  115 + #Here you could also declare a tftp server.<br />
  116 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option tftp-server-name "10.20.30.1";<br />
  117 + <br />
  118 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host web1 {<br />
  119 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware ethernet 00:11:55:77:99:BB;<br />
  120 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fixed-address 10.20.30.40;<br />
  121 + &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
  122 + &nbsp;&nbsp;&nbsp;&nbsp;}<br />
  123 + </p><br />
131 124
132   - <p>Once your configuration is done, save it as /etc/dhcpd.conf, restart dhcpd and things should be working :)</p>
133   - <p>Carefull with the "{ }" and ";" If you miss one, dhcpd will not run!</p><br />
134   - <p>It's nice to have zones... my next tutorial will explain how to enable networking between those zones.</p><br />
135   - <p class="center"><a href="#" onClick="selectPart('chapter2')">>> Next Chapter >></a></p>
136   - </div>
137   - <div id="chapter2">
138   - <h1>Firewalling</h1>
139   - <h2>With Linux</h2>
140   - <p>This course hasn't been written yet.</p>
141   - <h2>With OpenBSD</h2>
142   - <p>This course hasn't been written yet.</p>
143   - </div>
144   - <div id="exercise1">
145   - <h3>Exercise 1:</h3>
146   - <p>Nothingyet</p>
147   - <div class="revealbutton" onClick="$('#answer1').show(); $('.revealbutton').hide(); ">Reveal Answer</div>
148   - <div class="answer" id="answer1">
149   - <p>Well done, you revealed the answer but there's no question yet :)</p>
150   - <p>no exam yet... <a href="#" onClick="selectPart('examn')">Click here</a> to check out the void!</p>
151   - </div>
152   - </div>
153   - <div id="examn">
154   - <h2>No Exam Time yet!</h2><br />
155   - <? if(!$loggedin) echo $notloggedintext; ?>
156   - <form id="examnform" name="examnform" method="post" action="">
157   - <div class="question">
158   - <h3>Question 1</h3><br />
159   - <p>Nothing yet</p>
160   - <input type="radio" value="A" id="radio1" name="1" /><label for="radio1">bla</label><br />
161   - <input type="radio" value="B" id="radio2" name="1" /><label for="radio2">bla</label><br />
162   - <input type="radio" value="C" id="radio3" name="1" /><label for="radio3">bla</label><br />
163   - </div>
164   - </form>
165   - </div>
166   -</div>
  125 + <p>Once your configuration is done, save it as /etc/dhcpd.conf, restart dhcpd and things should be working :)</p>
  126 + <p>Carefull with the "{ }" and ";" If you miss one, dhcpd will not run!</p><br />
  127 + <p>It's nice to have zones... my next tutorial will explain how to enable networking between those zones.</p><br />
  128 + <p class="center"><a href="#">>> Next Chapter >></a></p>
  129
  130 + ,
  131 + 'chapter2' => <<<°
  132 + <h1>Firewalling</h1>
  133 + <h2>With Linux</h2>
  134 + <p>This course hasn't been written yet.</p>
  135 + <h2>With OpenBSD</h2>
  136 + <p>This course hasn't been written yet.</p>
  137 +
  138
  139 + ,
  140 + ),
  141 + 'exercises' => array(
  142 + 'exercise1' => <<<°
  143 + <h3>Exercise 1:</h3>
  144 + <p>Nothingyet</p>
  145 + <div class="revealbutton" onClick="$('#answer1').show(); $('.revealbutton').hide(); ">Reveal Answer</div>
  146 + <div class="answer" id="answer1">
  147 + <p>Well done, you revealed the answer but there's no question yet :)</p>
  148 + <p>no exam yet... <a href="#">Click here</a> to check out the void!</p>
  149 + </div>
  150 +
  151
  152 + ,
  153 + ),
  154 + 'exam' => array(
  155 + 'exam1' => <<<°
  156 + <h2>No Exam Time yet!</h2><br />
  157 + <? if(!$loggedin) echo $notloggedintext; ?>
  158 + <form id="examnform" name="examnform" method="post" action="">
  159 + <div class="question">
  160 + <h3>Question 1</h3><br />
  161 + <p>Nothing yet</p>
  162 + <input type="radio" value="A" id="radio1" name="1" /><label for="radio1">bla</label><br />
  163 + <input type="radio" value="B" id="radio2" name="1" /><label for="radio2">bla</label><br />
  164 + <input type="radio" value="C" id="radio3" name="1" /><label for="radio3">bla</label><br />
  165 + </div>
  166 + </form>
  167
  168 + ),
  169 + )
  170 + );
152 courses/courses/course3.php
... ... @@ -1,99 +1,55 @@
1 1 <?php
2   - require("courseheader.php");
3   -?>
4   -<div id="coursenavigation">
5   - <ol class="tree">
6   - <li class="file"><a href="#" onClick="selectPart('default')">Introduction</a></li>
7   - <li>
8   - <label for="clients">IRC Clients</label><input type="checkbox" checked id="clients" />
9   - <ol>
10   - <li class="file"><a href="#" onClick="selectPart('chapter1')">Webclients</a></li>
11   - <li class="file"><a href="#" onClick="selectPart('chapter2')">Windows</a></li>
12   - <li class="file"><a href="#" onClick="selectPart('chapter3')">Linux</a></li>
13   - </ol>
14   - </li>
15   - <li>
16   - <label for="background">Technical Background</label><input type="checkbox" checked id="background" />
17   - <ol>
18   - <li class="file"><a href="#" onClick="selectPart('chapter4')">How IRC works</a></li>
19   - <li class="file"><a href="#" onClick="selectPart('chapter5')">IRC Security</a></li>
20   - <li class="file"><a href="#" onClick="selectPart('chapter6')">Installing an IRCd</a></li>
21   - </ol>
22   - </li>
23   - <li>
24   - <label for="exercises">Exercises</label> <input type="checkbox" checked id="exercises" />
25   - <ol>
26   - <li class="file"><a href="#" onClick="selectPart('exercise1')">Exercise 1</a></li>
27   - </ol>
28   - </li>
29   - <li class="file"><a href="#" onClick="selectPart('examn')">Exam</a></li>
30   - </ol>
31   -</div>
32   -<div id="coursecontent">
33   - <div id="default">
34   - <h1>Internet Relay Chat (IRC)</h1>
35   - <p>Under construction!</p>
36   - <p class="center"><a href="#" onClick="selectPart('chapter1')">>> Let's start! >></a></p>
37   - </div>
38   - <div id="chapter1">
39   - <h1>Webclients</h1>
40   - <p></p>
41   - <p class="center"><a href="#" onClick="selectPart('chapter2')">>> Next Chapter >></a></p>
42   - </div>
43   - <div id="chapter2">
44   - <h1>Windows Clients</h1>
45   - <p></p>
46   - <p class="center"><a href="#" onClick="selectPart('chapter3')">>> Next Chapter >></a></p>
47   - </div>
48   - <div id="chapter3">
49   - <h1>Linux Clients</h1>
50   - <p></p>
51   - <p class="center"><a href="#" onClick="selectPart('chapter4')">>> Next Chapter >></a></p>
52   - </div>
53   - <div id="chapter4">
54   - <h1>How IRC works</h1>
55   - <p></p>
56   - <p class="center"><a href="#" onClick="selectPart('chapter5')">>> Next Chapter >></a></p>
57   - </div>
58   - <div id="chapter5">
59   - <h1>IRC Security</h1>
60   - <p></p>
61   - <p class="center"><a href="#" onClick="selectPart('chapter6')">>> Next Chapter >></a></p>
62   - </div>
63   - <div id="chapter6">
64   - <h1>Installing an IRCd</h1>
65   - <p></p>
66   - <p class="center"><a href="#" onClick="selectPart('exercise1')">>> Next Chapter >></a></p>
67   - </div>
68   - <div id="exercise1">
69   - <h3>Exercise 1:</h3>
70   - <p>Exercise text</p>
71   - <div class="revealbutton" onClick="$('#answer1').show(); $('.revealbutton').hide(); ">Reveal Answer</div>
72   - <div class="answer" id="answer1">
73   - <p>Answer</p>
74   - </div>
75   - </div>
76   - <div id="examn">
77   - <h2>Exam Time!</h2><br />
78   - <? if(!$loggedin) echo $notloggedintext; ?>
79   - <form id="examnform" name="examnform" method="post" action="">
80   - <div class="question">
81   - <h3>Question 1</h3><br />
82   - <p>X</p>
83   - <input type="radio" value="A" id="radio1" name="1" /><label for="radio1"></label><br />
84   - <input type="radio" value="B" id="radio2" name="1" /><label for="radio2"></label><br />
85   - <input type="radio" value="C" id="radio3" name="1" /><label for="radio3"></label><br />
86   - </div>
87   - <div class="question">
88   - <h3>Question 2</h3><br />
89   - <p>Y</p>
90   - <input type="radio" value="A" id="radio1" name="2" /><label for="radio1"></label><br />
91   - <input type="radio" value="B" id="radio2" name="2" /><label for="radio2"></label><br />
92   - <input type="radio" value="C" id="radio3" name="2" /><label for="radio3"></label><br />
93   - </div>
94   - <div id="examnsubmit">
95   - <button>Submit</button>
96   - </div>
97   - </form>
98   - </div>
99   -</div>
  2 +$msg = !$loggedin ? $notloggedintext : '';
  3 +return array(
  4 + 'nav' => array(
  5 + 'default' => array(
  6 + 'chapter1' => 'How IRC works',
  7 + 'chapter2' => 'IRC Security',
  8 + ),
  9 + 'exercises' => array(
  10 + 'exercise1' => 'Exercise 1',
  11 + ),
  12 + 'exam' => array(
  13 + 'exam1' => 'Exam',
  14 + )
  15 + ),
  16 + 'content' => array(
  17 + 'default' => array(
  18 + 'index' => <<<°
  19 + <h1>Internet Relay Chat (IRC)</h1>
  20 + <p>Under construction!</p>
  21
  22 + ,
  23 + 'chapter1' => <<<°
  24 + <p class="center">How IRC works</p>
  25
  26 + ,
  27 + 'chapter2' => <<<°
  28 + <p class="center">IRC Security</p>
  29
  30 + ,
  31 + ),
  32 + 'exercises' => array(
  33 + 'exercise1' => <<<°
  34 + <h3>Exercise 1:</h3>
  35 + <p>Nothing yet</p>
  36
  37 + ,
  38 + ),
  39 + 'exam' => array(
  40 + 'exam1' => <<<°
  41 + <h2>No Exam Time yet!</h2><br />
  42 + <form id="examnform" name="examnform" method="post" action="">
  43 + <div class="question">
  44 + <h3>Question 1</h3><br />
  45 + <p>Nothing yet</p>
  46 + <input type="radio" value="A" id="radio1" name="1" /><label for="radio1">bla</label><br />
  47 + <input type="radio" value="B" id="radio2" name="1" /><label for="radio2">bla</label><br />
  48 + <input type="radio" value="C" id="radio3" name="1" /><label for="radio3">bla</label><br />
  49 + </div>
  50 + </form>
  51
  52 + ),
  53 + )
  54 +);
  55 +
154 courses/css/hackits-courses.css
@@ -61,11 +61,13 @@ a:hover {
61 61 float: left;
62 62 width: 20%;
63 63 min-width: 185px;
  64 + margin-left: -45px;
64 65 }
65 66
66 67 #coursenavigation a {
67 68 font-weight: normal;
68 69 font-size: 10pt;
  70 + width: 100%;
69 71 }
70 72
71 73 #coursecontent {
@@ -229,70 +231,88 @@ a:hover {
229 231
230 232 /* Course Tree CSS */
231 233
232   - li.tab {
233   - font-size: 12pt;
234   - }
235   - ol.tree
236   - {
237   - margin-top: 0px;
238   - margin-left: 10px;
239   - padding: 0 0 0 0px;
240   - width: 175px;
241   - }
242   - li
243   - {
244   - position: relative;
245   - margin-left: -15px;
246   - list-style: none;
247   - }
248   - li.file
249   - {
250   - margin-left: -1px !important;
251   - }
252   - li.file a
253   - {
254   - background: url(images/document.png) 0 0 no-repeat;
255   - color: #fff;
256   - padding-left: 21px;
257   - text-decoration: none;
258   - display: block;
259   - }
260   - li.file a[href *= '.pdf'] { background: url(images/document.png) 0 0 no-repeat; }
261   - li.file a[href *= '.html'] { background: url(images/document.png) 0 0 no-repeat; }
262   - li.file a[href $= '.css'] { background: url(images/document.png) 0 0 no-repeat; }
263   - li.file a[href $= '.js'] { background: url(images/document.png) 0 0 no-repeat; }
264   - li input
265   - {
266   - position: absolute;
267   - left: 0;
268   - margin-left: 0;
269   - opacity: 0;
270   - z-index: 2;
271   - cursor: pointer;
272   - height: 1em;
273   - width: 1em;
274   - top: 0;
275   - }
276   - li input + ol
277   - {
278   - background: url(images/toggle-small-expand.png) 40px 0 no-repeat;
279   - margin: -0.938em 0 0 -44px; /* 15px */
280   - height: 1em;
281   - }
282   - li input + ol > li { display: none; margin-left: -14px !important; padding-left: 1px; }
283   - li label
284   - {
285   - background: url(images/folder-horizontal.png) 15px 1px no-repeat;
286   - cursor: pointer;
287   - display: block;
288   - padding-left: 37px;
289   - }
290   - li input:checked + ol
291   - {
292   - background: url(images/toggle-small.png) 40px 5px no-repeat;
293   - margin: -1.25em 0 0 -44px; /* 20px */
294   - padding: 1.563em 0 0 80px;
295   - height: auto;
296   - }
297   - li input:checked + ol > li { display: block; margin: 0 0 0.125em; /* 2px */}
298   - li input:checked + ol > li:last-child { margin: 0 0 0.063em; /* 1px */ }
  234 +li.tab {
  235 +font-size: 12pt;
  236 +}
  237 +ol.tree
  238 +{
  239 + margin-top: 0px;
  240 + margin-left: 48px;
  241 + padding: 0 0 0 0px;
  242 + width: 258px;
  243 +}
  244 +li
  245 +{
  246 + position: relative;
  247 + margin-left: -15px;
  248 + list-style: none;
  249 +}
  250 +li.file.selected a{
  251 + background-color: #444;
  252 +}
  253 +li a{
  254 + color: #fff;
  255 + padding-left: 2px;
  256 + padding-bottom: 0px;
  257 + padding-top: 0px;
  258 + text-decoration: none;
  259 + display: block;
  260 + background-repeat: no-repeat;
  261 +}
  262 +li.file a { background-image: url(images/document.png); }
  263 +li.exercises a { background-image: url(images/exercise.png); }
  264 +li.exam a { background-image: url(images/exam.png); }
  265 +li.file a, li.exercises a, li.exam a {
  266 + padding-left: 18px;
  267 + margin-left: 0px;
  268 +}
  269 +li.file a[href *= '.pdf'] { background-image: url(images/document.png); }
  270 +li.file a[href *= '.html'] { background-image: url(images/document.png); }
  271 +li.file a[href $= '.css'] { background-image: url(images/document.png); }
  272 +li.file a[href $= '.js'] { background-image: url(images/document.png); }
  273 +li input
  274 +{
  275 + position: absolute;
  276 + left: 0;
  277 + margin-left: 0;
  278 + opacity: 0;
  279 + z-index: 2;
  280 + cursor: pointer;
  281 + height: 1em;
  282 + width: 1em;
  283 + top: 0;
  284 +}
  285 +li input + ol
  286 +{
  287 + background: url(images/toggle-small-expand.png) 42px -3px no-repeat;
  288 + margin: -0.938em 0 0 -44px; /* 15px */
  289 + height: 1em;
  290 +}
  291 +li input + ol > li { display: none; margin-left: -14px !important; padding-left: 1px; }
  292 +li label
  293 +{
  294 + background: url(images/folder-horizontal.png) 15px 1px no-repeat;
  295 + cursor: pointer;
  296 + display: block;
  297 + padding-left: 37px;
  298 +}
  299 +li input:checked + ol
  300 +{
  301 + background: url(images/toggle-small.png) 42px 1px no-repeat;
  302 + margin: -1.25em 0 0 -44px; /* 20px */
  303 + padding: 1.563em 0 0 80px;
  304 + height: auto;
  305 +}
  306 +li input:checked + ol > li { display: block; margin: 0 0 0.125em; /* 2px */}
  307 +li input:checked + ol > li:last-child { margin: 0 0 0.063em; /* 1px */ }
  308 +
  309 +#ranking table{
  310 + width: 100%;
  311 + border-style: none;
  312 + border-collapse: collapse;
  313 +}
  314 +
  315 +#ranking table th{
  316 + color: #050;
  317 + background-color: #111;
  318 +}
BIN  courses/css/images/exam.png
BIN  courses/css/images/exercise.png
109 courses/index.php
... ... @@ -1,5 +1,4 @@
1 1 <?
2   -
3 2 ///////////////////////////////////////////////////////////////////////////////////
4 3 // 888 888 d8888 .d8888b. 888 d8P 8888888 88888888888 .d8888b. //
5 4 // 888 888 d88888 d88P Y88b 888 d8P 888 888 d88P Y88b //
@@ -23,13 +22,6 @@
23 22
24 23 require("../getsmfuser.php");
25 24
26   -// If an id is passed as argument, load course directly
27   -if(isset($_GET['id']))
28   -{
29   - $id = htmlspecialchars($_GET['id']);
30   - $loadcourse = "$(document).ready(function() { $(\"#course\").load(\"course.php?id=\"+".$id."); $(\"#tabs\").tabs(\"select\" , \"tab-course\") } )";
31   -}
32   -
33 25 // format date for display in header bar
34 26 $showdate = date('F d, o, h:i:s A');
35 27
@@ -40,7 +32,7 @@
40 32 <title>Hackits.be - Courses</title>
41 33 <link rel="stylesheet" href="css/jquery-ui-1.8.17.custom.css">
42 34 <link rel="stylesheet" href="css/hackits-courses.css">
43   - <script src="js/jquery-1.7.1.min.js"></script>
  35 + <script src="js/jquery-1.8.2.js"></script>
44 36 <script src="js/jquery.ui.core.js"></script>
45 37 <script src="js/jquery.ui.widget.js"></script>
46 38 <script src="js/jquery.ui.button.js"></script>
@@ -48,11 +40,79 @@
48 40 <script src="js/jquery.ui.tabs.js"></script>
49 41 <script src="js/jquery.ui.dialog.js"></script>
50 42 <script src="js/jquery.ui.accordion.js"></script>
  43 + <script src="js/jquery.address.js"></script>
  44 +<!-- <script src="js/jquery.history.js"></script>-->
51 45 <script>
52 46 $(function() {
53   - $( "#tabs" ).tabs();
54   - $( "#courses" ).accordion({ autoHeight: false });
55   - });
  47 + var tabStates = { //default states
  48 + overview: '/overview/General',
  49 + course: '/course/General/Intro+to+Hackits+Courses/Hackits+Courses',
  50 + ranking: '/ranking',
  51 + help: '/help'
  52 + },
  53 + selectPart = function(part){
  54 + var part = $("#"+part);
  55 + part.show().siblings().hide();
  56 + },
  57 + getPanelIndex = function(str){
  58 + return $('.ui-accordion-header a').filter(function(){
  59 + return (new RegExp(str)).test($(this).text())
  60 + }).parent().index() / 2;
  61 + },
  62 + updateState = function(e){
  63 + var parts = e.path.split('/')
  64 + , tab = parts[1]
  65 + , panel = parts[2] || ''
  66 + , course = parts[3] || ''
  67 + , chapter = parts[4] || '';
  68 + if(tab.length){ //select tab
  69 + $("#tabs").tabs("select", '#'+tab.replace(/^#/,''));
  70 + }
  71 + if(panel.length){ //select accordion panel
  72 + $("#courses").accordion("activate", getPanelIndex(panel));
  73 + $('a[href$="/course/'+panel+'"]').siblings('input').attr('checked', true);
  74 + }
  75 + if(course.length){ //select course
  76 + $('a[href$="/course/'+panel+'/'+course+'"]').siblings('input').attr('checked', true);
  77 + }
  78 + if(chapter.length){ //select chapter
  79 + $('#coursenavigation li.file a').each(function(){
  80 + $(this).closest('li').toggleClass('selected',
  81 + (new RegExp(e.path.replace(/\+/g, '\\+')+'$', 'i'))
  82 + .test($(this).attr('href')));
  83 + });
  84 + $('#coursecontent').html(
  85 + $('[id="'
  86 + + $('a[href$="/course/'+panel+'/'+course+'/'+chapter+'"]:not([rel=overview])').data('chapterid')
  87 + + '"]').html());
  88 + }
  89 + };
  90 +
  91 + $("#tabs").tabs({
  92 + select: function(event, ui){
  93 + var oldSelected = $('#tabs .ui-tabs-selected a').attr('href').replace(/^#/, '')
  94 + , newSelected = ui.tab.hash.replace(/^#/, '');
  95 + if((new RegExp('^/'+newSelected, 'i')).test($.address.path())){ return; }
  96 + tabStates[oldSelected] = $.address.path();
  97 + $.address.path(tabStates[newSelected]);
  98 + }
  99 + });
  100 + $("#courses").accordion({
  101 + autoHeight: false
  102 + });
  103 +
  104 + $.address.init(function(e){
  105 + if($.address.path() === '/'){
  106 + $.address.path(tabStates.overview); //default to overview
  107 + }
  108 + $('#coursenavigation .file a[data-chapterid]').address(function() {
  109 + return $(this).attr('href');
  110 + });
  111 + tabStates[$.address.path().match(/^\/([^\/]+)/)[0].substr(1)] = $.address.path();
  112 + }).change(updateState)
  113 + .internalChange({}, updateState)
  114 + .externalChange({}, updateState);
  115 + });
56 116 </script>
57 117 </head>
58 118 <body>
@@ -76,25 +136,28 @@
76 136 <div id="tabs">
77 137
78 138 <ul>
79   - <li class="tab"><a href="#tab-overview">Course Overview</a></li>
80   - <li class="tab"><a href="#tab-course">Current Course</a></li>
81   - <li class="tab"><a href="#tab-ranking">Ranking List</a></li>
82   - <li class="tab"><a href="#tab-help">Help</a></li>
  139 + <li class="tab"><a rel="address:/overview" href="#overview">Course Overview</a></li>
  140 + <li class="tab"><a rel="address:/course" href="#course">Current Course</a></li>
  141 + <li class="tab"><a rel="address:/ranking" href="#ranking">Ranking List</a></li>
  142 + <li class="tab"><a rel="address:/help" href="#help">Help</a></li>
83 143 </ul>
84 144
85   - <div id="tab-overview">
  145 + <div id="overview">
86 146 <? include("overview.php"); ?>
87 147 </div>
88 148
89   - <div id="tab-course">
90   - <? include("course.php"); ?>
  149 + <div id="course">
  150 + <?
  151 + require_once("courseheader.php");
  152 + include("course.php");
  153 + ?>
91 154 </div>
92 155
93   - <div id="tab-ranking">
  156 + <div id="ranking">
94 157 <? include("ranking.php"); ?>
95 158 </div>
96 159
97   - <div id="tab-help">
  160 + <div id="help">
98 161 <? include("help.php"); ?>
99 162 </div>
100 163
@@ -103,10 +166,6 @@
103 166 </div> <!-- end-of-container -->
104 167
105 168 <script>
106   - function showCourse(id){
107   - $("#course").load("course.php?id="+id);
108   - $("#tabs").tabs( "select" , "tab-course" )
109   - }
110 169 <? echo isset($loadcourse) ? $loadcourse : ''; ?>
111 170 </script>
112 171 <?php Utils::queryLog(); ?>
9,440 courses/js/jquery-1.8.2.js
9,440 additions, 0 deletions not shown
683 courses/js/jquery.address.js
... ... @@ -0,0 +1,683 @@
  1 +/*
  2 + * jQuery Address Plugin v${version}
  3 + * http://www.asual.com/jquery/address/
  4 + *
  5 + * Copyright (c) 2009-2010 Rostislav Hristov
  6 + * Dual licensed under the MIT or GPL Version 2 licenses.
  7 + * http://jquery.org/license
  8 + *
  9 + * Date: ${timestamp}
  10 + */
  11 +(function ($) {
  12 +
  13 + $.address = (function () {
  14 +
  15 + var _trigger = function(name) {
  16 + var ev = $.extend($.Event(name),
  17 + (function() {
  18 + var parameters = {},
  19 + parameterNames = $.address.parameterNames();
  20 + for (var i = 0, l = parameterNames.length; i < l; i++) {
  21 + parameters[parameterNames[i]] = $.address.parameter(parameterNames[i]);
  22 + }
  23 + return {
  24 + value: $.address.value(),
  25 + path: $.address.path(),
  26 + pathNames: $.address.pathNames(),
  27 + parameterNames: parameterNames,
  28 + parameters: parameters,
  29 + queryString: $.address.queryString()
  30 + };
  31 + }).call($.address)
  32 + );
  33 +
  34 + $($.address).trigger(ev);
  35 + return ev;
  36 + },
  37 + _array = function(obj) {
  38 + return Array.prototype.slice.call(obj);
  39 + },
  40 + _bind = function(value, data, fn) {
  41 + $().bind.apply($($.address), Array.prototype.slice.call(arguments));
  42 + return $.address;
  43 + },
  44 + _unbind = function(value, fn) {
  45 + $().unbind.apply($($.address), Array.prototype.slice.call(arguments));
  46 + return $.address;
  47 + },
  48 + _supportsState = function() {
  49 + return (_h.pushState && _opts.state !== UNDEFINED);
  50 + },
  51 + _hrefState = function() {
  52 + return ('/' + _l.pathname.replace(new RegExp(_opts.state), '') +
  53 + _l.search + (_hrefHash() ? '#' + _hrefHash() : '')).replace(_re, '/');
  54 + },
  55 + _hrefHash = function() {
  56 + var index = _l.href.indexOf('#');
  57 + return index != -1 ? _crawl(_l.href.substr(index + 1), FALSE) : '';
  58 + },
  59 + _href = function() {
  60 + return _supportsState() ? _hrefState() : _hrefHash();
  61 + },
  62 + _window = function() {
  63 + try {
  64 + return top.document !== UNDEFINED && top.document.title !== UNDEFINED ? top : window;
  65 + } catch (e) {
  66 + return window;
  67 + }
  68 + },
  69 + _js = function() {
  70 + return 'javascript';
  71 + },
  72 + _strict = function(value) {
  73 + value = value.toString();
  74 + return (_opts.strict && value.substr(0, 1) != '/' ? '/' : '') + value;
  75 + },
  76 + _crawl = function(value, direction) {
  77 + if (_opts.crawlable && direction) {
  78 + return (value !== '' ? '!' : '') + value;
  79 + }
  80 + return value.replace(/^\!/, '');
  81 + },
  82 + _cssint = function(el, value) {
  83 + return parseInt(el.css(value), 10);
  84 + },
  85 +
  86 + // Hash Change Callback
  87 + _listen = function() {
  88 + if (!_silent) {
  89 + var hash = _href(),
  90 + diff = decodeURI(_value) != decodeURI(hash);
  91 + if (diff) {
  92 + if (_msie && _version < 7) {
  93 + _l.reload();
  94 + } else {
  95 + if (_msie && !_hashchange && _opts.history) {
  96 + _st(_html, 50);
  97 + }
  98 + _old = _value;
  99 + _value = hash;
  100 + _update(FALSE);
  101 + }
  102 + }
  103 + }
  104 + },
  105 +
  106 + _update = function(internal) {
  107 + var changeEv = _trigger(CHANGE),
  108 + xChangeEv = _trigger(internal ? INTERNAL_CHANGE : EXTERNAL_CHANGE);
  109 +
  110 + _st(_track, 10);
  111 +
  112 + if (changeEv.isDefaultPrevented() || xChangeEv.isDefaultPrevented()){
  113 + _preventDefault();
  114 + }
  115 + },
  116 +
  117 + _preventDefault = function(){
  118 + _value = _old;
  119 +
  120 + if (_supportsState()) {
  121 + _h.popState({}, '', _opts.state.replace(/\/$/, '') + (_value === '' ? '/' : _value));
  122 + } else {
  123 + _silent = TRUE;
  124 + if (_webkit) {
  125 + if (_opts.history) {
  126 + _l.hash = '#' + _crawl(_value, TRUE);
  127 + } else {
  128 + _l.replace('#' + _crawl(_value, TRUE));
  129 + }
  130 + } else if (_value != _href()) {
  131 + if (_opts.history) {
  132 + _l.hash = '#' + _crawl(_value, TRUE);
  133 + } else {
  134 + _l.replace('#' + _crawl(_value, TRUE));
  135 + }
  136 + }
  137 + if ((_msie && !_hashchange) && _opts.history) {
  138 + _st(_html, 50);
  139 + }
  140 + if (_webkit) {
  141 + _st(function(){ _silent = FALSE; }, 1);
  142 + } else {
  143 + _silent = FALSE;
  144 + }
  145 + }
  146 +
  147 + },
  148 +
  149 + _track = function() {
  150 + if (_opts.tracker !== 'null' && _opts.tracker !== NULL) {
  151 + var fn = $.isFunction(_opts.tracker) ? _opts.tracker : _t[_opts.tracker],
  152 + value = (_l.pathname + _l.search +
  153 + ($.address && !_supportsState() ? $.address.value() : ''))
  154 + .replace(/\/\//, '/').replace(/^\/$/, '');
  155 + if ($.isFunction(fn)) {
  156 + fn(value);
  157 + } else if ($.isFunction(_t.urchinTracker)) {
  158 + _t.urchinTracker(value);
  159 + } else if (_t.pageTracker !== UNDEFINED && $.isFunction(_t.pageTracker._trackPageview)) {
  160 + _t.pageTracker._trackPageview(value);
  161 + } else if (_t._gaq !== UNDEFINED && $.isFunction(_t._gaq.push)) {
  162 + _t._gaq.push(['_trackPageview', decodeURI(value)]);
  163 + }
  164 + }
  165 + },
  166 + _html = function() {
  167 + var src = _js() + ':' + FALSE + ';document.open();document.writeln(\'<html><head><title>' +
  168 + _d.title.replace(/\'/g, '\\\'') + '</title><script>var ' + ID + ' = "' + encodeURIComponent(_href()).replace(/\'/g, '\\\'') +
  169 + (_d.domain != _l.hostname ? '";document.domain="' + _d.domain : '') +
  170 + '";</' + 'script></head></html>\');document.close();';
  171 + if (_version < 7) {
  172 + _frame.src = src;
  173 + } else {
  174 + _frame.contentWindow.location.replace(src);
  175 + }
  176 + },
  177 + _options = function() {
  178 + if (_url && _qi != -1) {
  179 + var i, param, params = _url.substr(_qi + 1).split('&');
  180 + for (i = 0; i < params.length; i++) {
  181 + param = params[i].split('=');
  182 + if (/^(autoUpdate|crawlable|history|strict|wrap)$/.test(param[0])) {
  183 + _opts[param[0]] = (isNaN(param[1]) ? /^(true|yes)$/i.test(param[1]) : (parseInt(param[1], 10) !== 0));
  184 + }
  185 + if (/^(state|tracker)$/.test(param[0])) {
  186 + _opts[param[0]] = param[1];
  187 + }
  188 + }
  189 + _url = NULL;
  190 + }
  191 + _old = _value;
  192 + _value = _href();
  193 + },
  194 + _load = function() {
  195 + if (!_loaded) {
  196 + _loaded = TRUE;
  197 + _options();
  198 + var complete = function() {
  199 + _enable.call(this);
  200 + _unescape.call(this);
  201 + },
  202 + body = $('body').ajaxComplete(complete);
  203 + complete();
  204 + if (_opts.wrap) {
  205 + var wrap = $('body > *')
  206 + .wrapAll('<div style="padding:' +
  207 + (_cssint(body, 'marginTop') + _cssint(body, 'paddingTop')) + 'px ' +
  208 + (_cssint(body, 'marginRight') + _cssint(body, 'paddingRight')) + 'px ' +
  209 + (_cssint(body, 'marginBottom') + _cssint(body, 'paddingBottom')) + 'px ' +
  210 + (_cssint(body, 'marginLeft') + _cssint(body, 'paddingLeft')) + 'px;" />')
  211 + .parent()
  212 + .wrap('<div id="' + ID + '" style="height:100%;overflow:auto;position:relative;' +
  213 + (_webkit && !window.statusbar.visible ? 'resize:both;' : '') + '" />');
  214 + $('html, body')
  215 + .css({
  216 + height: '100%',
  217 + margin: 0,
  218 + padding: 0,
  219 + overflow: 'hidden'
  220 + });
  221 + if (_webkit) {
  222 + $('<style type="text/css" />')
  223 + .appendTo('head')
  224 + .text('#' + ID + '::-webkit-resizer { background-color: #fff; }');
  225 + }
  226 + }
  227 + if (_msie && !_hashchange) {
  228 + var frameset = _d.getElementsByTagName('frameset')[0];
  229 + _frame = _d.createElement((frameset ? '' : 'i') + 'frame');
  230 + _frame.src = _js() + ':' + FALSE;
  231 + if (frameset) {
  232 + frameset.insertAdjacentElement('beforeEnd', _frame);
  233 + frameset[frameset.cols ? 'cols' : 'rows'] += ',0';
  234 + _frame.noResize = TRUE;
  235 + _frame.frameBorder = _frame.frameSpacing = 0;
  236 + } else {
  237 + _frame.style.display = 'none';
  238 + _frame.style.width = _frame.style.height = 0;
  239 + _frame.tabIndex = -1;
  240 + _d.body.insertAdjacentElement('afterBegin', _frame);
  241 + }
  242 + _st(function() {
  243 + $(_frame).bind('load', function() {
  244 + var win = _frame.contentWindow;
  245 + _old = _value;
  246 + _value = win[ID] !== UNDEFINED ? win[ID] : '';
  247 + if (_value != _href()) {
  248 + _update(FALSE);
  249 + _l.hash = _crawl(_value, TRUE);
  250 + }
  251 + });
  252 + if (_frame.contentWindow[ID] === UNDEFINED) {
  253 + _html();
  254 + }
  255 + }, 50);
  256 + }
  257 + _st(function() {
  258 + _trigger('init');
  259 + _update(FALSE);
  260 + }, 1);
  261 + if (!_supportsState()) {
  262 + if ((_msie && _version > 7) || (!_msie && _hashchange)) {
  263 + if (_t.addEventListener) {
  264 + _t.addEventListener(HASH_CHANGE, _listen, FALSE);
  265 + } else if (_t.attachEvent) {
  266 + _t.attachEvent('on' + HASH_CHANGE, _listen);
  267 + }
  268 + } else {
  269 + _si(_listen, 50);
  270 + }
  271 + }
  272 + if ('state' in window.history) {
  273 + $(window).trigger('popstate');
  274 + }
  275 + }
  276 + },
  277 + _enable = function() {
  278 + var el,
  279 + elements = $('a'),
  280 + length = elements.size(),
  281 + delay = 1,
  282 + index = -1,
  283 + sel = '[rel*="address:"]',
  284 + fn = function() {
  285 + if (++index != length) {
  286 + el = $(elements.get(index));
  287 + if (el.is(sel)) {
  288 + el.address(sel);
  289 + }
  290 + _st(fn, delay);
  291 + }
  292 + };
  293 + _st(fn, delay);
  294 + },
  295 + _popstate = function() {
  296 + if (decodeURI(_value) != decodeURI(_href())) {
  297 + _old = _value;
  298 + _value = _href();
  299 + _update(FALSE);
  300 + }
  301 + },
  302 + _unload = function() {
  303 + if (_t.removeEventListener) {
  304 + _t.removeEventListener(HASH_CHANGE, _listen, FALSE);
  305 + } else if (_t.detachEvent) {
  306 + _t.detachEvent('on' + HASH_CHANGE, _listen);
  307 + }
  308 + },
  309 + _unescape = function() {
  310 + if (_opts.crawlable) {
  311 + var base = _l.pathname.replace(/\/$/, ''),
  312 + fragment = '_escaped_fragment_';
  313 + if ($('body').html().indexOf(fragment) != -1) {
  314 + $('a[href]:not([href^=http]), a[href*="' + document.domain + '"]').each(function() {
  315 + var href = $(this).attr('href').replace(/^http:/, '').replace(new RegExp(base + '/?$'), '');
  316 + if (href === '' || href.indexOf(fragment) != -1) {
  317 + $(this).attr('href', '#' + encodeURI(decodeURIComponent(href.replace(new RegExp('/(.*)\\?' +
  318 + fragment + '=(.*)$'), '!$2'))));
  319 + }
  320 + });
  321 + }
  322 + }
  323 + },
  324 + UNDEFINED,
  325 + NULL = null,
  326 + ID = 'jQueryAddress',
  327 + STRING = 'string',
  328 + HASH_CHANGE = 'hashchange',
  329 + INIT = 'init',
  330 + CHANGE = 'change',
  331 + INTERNAL_CHANGE = 'internalChange',
  332 + EXTERNAL_CHANGE = 'externalChange',
  333 + TRUE = true,
  334 + FALSE = false,
  335 + _opts = {
  336 + autoUpdate: TRUE,
  337 + crawlable: FALSE,
  338 + history: TRUE,
  339 + strict: TRUE,
  340 + wrap: FALSE
  341 + },
  342 + _browser = $.browser,
  343 + _version = parseFloat(_browser.version),
  344 + _msie = !$.support.opacity,
  345 + _webkit = _browser.webkit || _browser.safari,
  346 + _t = _window(),
  347 + _d = _t.document,
  348 + _h = _t.history,
  349 + _l = _t.location,
  350 + _si = setInterval,
  351 + _st = setTimeout,
  352 + _re = /\/{2,9}/g,
  353 + _agent = navigator.userAgent,
  354 + _hashchange = 'on' + HASH_CHANGE in _t,
  355 + _frame,
  356 + _form,
  357 + _url = $('script:last').attr('src'),
  358 + _qi = _url ? _url.indexOf('?') : -1,
  359 + _title = _d.title,
  360 + _silent = FALSE,
  361 + _loaded = FALSE,
  362 + _juststart = TRUE,
  363 + _updating = FALSE,
  364 + _listeners = {},
  365 + _value = _href();
  366 + _old = _value;
  367 +
  368 + if (_msie) {
  369 + _version = parseFloat(_agent.substr(_agent.indexOf('MSIE') + 4));
  370 + if (_d.documentMode && _d.documentMode != _version) {