Update of /cvsroot/stack/stack-1-0
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21600
Modified Files:
choosequiz.php
Log Message:
Index: choosequiz.php
===================================================================
RCS file: /cvsroot/stack/stack-1-0/choosequiz.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** choosequiz.php 7 Sep 2005 14:19:35 -0000 1.1
--- choosequiz.php 7 Sep 2005 14:28:58 -0000 1.2
***************
*** 17,20 ****
--- 17,26 ----
require_once('stackLib.php');
+ /**
+ * To use this script, add a variable $choosequiz_store
+ * to stackConfig.php which is an array of the subjectID numbers
+ * of subjects you wish to be available through this page.
+ */
+
$user = stack_user_guest();
***************
*** 22,28 ****
if (array_key_exists('subjectID',$_GET)) {
- $subjectID = $_GET['subjectID'];
// Check this is permitted.
$subject = stack_db_subject_get($subjectID,FALSE);
--- 28,44 ----
if (array_key_exists('subjectID',$_GET)) {
// Check this is permitted.
+ if (isset($choosequiz_store)) {
+ if (FALSE !== array_search($_GET['subjectID'],$choosequiz_store)) {
+ $subjectID = $_GET['subjectID'];
+ } else {
+ echo "This subject is not available through this page.";
+ die();
+ }
+ } else {
+ echo "The administrator of this STACK server has not released any subjects.";
+ die();
+ }
$subject = stack_db_subject_get($subjectID,FALSE);
|