From: Chris S. <san...@us...> - 2005-06-18 09:54:25
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27637/frontend_general Modified Files: Tag: frontend_dev frontend_util.php process_input.php qb_display.php question_bank_util.php Log Message: Index: frontend_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/frontend_util.php,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** frontend_util.php 17 Jun 2005 16:25:28 -0000 1.1.2.3 --- frontend_util.php 18 Jun 2005 09:54:12 -0000 1.1.2.4 *************** *** 1,4 **** <?php - /** * --- 1,3 ---- *************** *** 19,23 **** * @author Juliette White jv...@jv... * - * * * This file contains utility functions used by the front end code --- 18,21 ---- *************** *** 28,33 **** */ ! include_once('scripts/stackUtility.php'); ! /* --- 26,32 ---- */ ! // ********************************************************** ! // General user related functions ! // ********************************************************** /* *************** *** 36,50 **** * @return string $username The username */ ! function stack_get_username($user) { return nsf('username',$user); } - /* - * @param array $errors, The errors array - * @return string - */ - function stack_get_err($errors) { - return nsf($errors,'user'); - } /* --- 35,42 ---- * @return string $username The username */ ! function stack_user_get_name($user) { return nsf('username',$user); } /* Index: qb_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/qb_display.php,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** qb_display.php 17 Jun 2005 16:25:28 -0000 1.1.2.6 --- qb_display.php 18 Jun 2005 09:54:12 -0000 1.1.2.7 *************** *** 43,48 **** echo "<p><a href=\"javascript:SelectQs('export_xml_list');\">Export selected as XML</a> "; echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; - } /* --- 43,48 ---- echo "<p><a href=\"javascript:SelectQs('export_xml_list');\">Export selected as XML</a> "; echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; } + /* *************** *** 57,65 **** include("{$stack_root}/html/qselectform.php"); stack_question_edit_form($question,$errors); ! ! echo "<p><a href=\"javascript:HelpPopup('all','stackQuestion');\">Help with question fields.</a>\n ! <a href=\"javascript:HelpPopup('all','stackOptions');\">Help with options.</a>\n ! <a href=\"javascript:HelpPopup('all','stackAnswerTest');\">Help with answer tests.</a>\n ! <a href=\"javascript:HelpPopup('all','stackQuestionPotResp');\">Help with potential responses.</a></p>"; } --- 57,65 ---- include("{$stack_root}/html/qselectform.php"); stack_question_edit_form($question,$errors); ! ! echo "<p><a href=\"javascript:HelpPopup('all','author_questionfields');\">Help with question fields.</a>\n ! <a href=\"javascript:HelpPopup('all','author_options');\">Help with options.</a>\n ! <a href=\"javascript:HelpPopup('all','author_answertest');\">Help with answer tests.</a>\n ! <a href=\"javascript:HelpPopup('all','author_potresp');\">Help with potential responses.</a></p>"; } *************** *** 93,100 **** stack_db_listquestions('edit_metadata',$question_bank_filter); - // This line appears to be broken - it doesn't save the metadata! echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; } /* * Displays a message saying that the user is not the admin --- 93,101 ---- stack_db_listquestions('edit_metadata',$question_bank_filter); echo "<p><a href=\"javascript:SelectQs('edit_metadata');\">Edit metadata</a> "; } + + /* * Displays a message saying that the user is not the admin *************** *** 104,107 **** --- 105,109 ---- echo "<p><font color='red'>Warning!</font> You are not the admin user and any changes will not be stored in the database.</p>"; } + /* *************** *** 153,159 **** } - // HACK: we need error trapping here. - // HACK: we should return to the user details of what has been uploaded! - echo "</tbody></table>\n"; echo "<h2>Current database of questions</h2>"; --- 155,158 ---- Index: question_bank_util.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/question_bank_util.php,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** question_bank_util.php 17 Jun 2005 16:25:28 -0000 1.1.2.3 --- question_bank_util.php 18 Jun 2005 09:54:12 -0000 1.1.2.4 *************** *** 102,109 **** if ('default' == $source) { $question = stack_get_question_from_session(); ! $question = stack_get_question_from_post(); } else if ('database' == $source) { $questionID = $_POST['questionID']; ! $question=stack_db_getquestion($questionID); } --- 102,111 ---- if ('default' == $source) { $question = stack_get_question_from_session(); ! if (array_key_exists('questionID',$_POST)) { ! $question = stack_get_question_from_post(); ! } } else if ('database' == $source) { $questionID = $_POST['questionID']; ! $question = stack_db_getquestion($questionID); } Index: process_input.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/process_input.php,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** process_input.php 17 Jun 2005 16:25:28 -0000 1.1.2.7 --- process_input.php 18 Jun 2005 09:54:12 -0000 1.1.2.8 *************** *** 25,29 **** * @subpackage Stack */ - include_once('frontend_general/frontend_util.php'); $errors = ''; --- 25,28 ---- *************** *** 74,86 **** // (2.0) Try to establish the user. if (array_key_exists('user',$_SESSION)) { ! $user = $_SESSION['user']; $username = $user['username']; } else { // Make sure the user is logged in as a Guest. // Is a blank user a guest user??? include_once($stack_root."/scripts/stackUser.php"); $user = stack_user_blank(); } ! $username = stack_get_username($user); ?> --- 73,86 ---- // (2.0) Try to establish the user. if (array_key_exists('user',$_SESSION)) { ! $user = $_SESSION['user']; $username = $user['username']; } else { // Make sure the user is logged in as a Guest. // Is a blank user a guest user??? + // CJS: no. A blank user is not a guest user. See stackUser.php, where these are defined. include_once($stack_root."/scripts/stackUser.php"); $user = stack_user_blank(); } ! $username = stack_user_get_name($user); ?> |