From 9f15ef87ab18eac0263d334ccf1928e76ffe07dc Mon Sep 17 00:00:00 2001 From: Dave Goodwin Date: Thu, 20 Oct 2011 14:28:34 +0000 Subject: [PATCH] remove duplicate requires for database_library, make sure config.php is require_once-ed git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@166 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641 --- data.php | 1 - example.php | 1 - feedback/index.php | 73 +- getfile.php | 115 ++- index.php | 3 +- integration.php | 124 ++- management.php | 2 - modules/xerte/edit.php | 1 - modules/xerte/engine/file_exists.php | 27 +- modules/xerte/engine/save.php | 84 +- modules/xerte/engine/upload.php | 26 +- peer.php | 1 - play.php | 3 +- preview.php | 151 ++-- rss.php | 1 - rss_proxy.php | 7 +- syndicate.php | 2 +- webctlink.php | 171 ++-- website_code/php/folder_library.php | 8 +- .../folder_content_template.php | 54 +- .../folderproperties/folder_rss_template.php | 93 +- .../folderproperties_template.php | 53 +- .../rename_folder_template.php | 91 +- .../php/folders/copy_to_new_folder.php | 30 +- website_code/php/folders/delete_folder.php | 28 +- website_code/php/import/fileupload.php | 56 +- website_code/php/import/import.php | 849 +++++++++--------- website_code/php/import/import_template.php | 453 +++++----- website_code/php/management/categories.php | 8 +- website_code/php/management/change_owner.php | 8 +- .../php/management/delete_error_list.php | 6 +- .../php/management/delete_template.php | 62 +- website_code/php/management/error_list.php | 8 +- website_code/php/management/licenses.php | 8 +- website_code/php/management/new_category.php | 5 +- website_code/php/management/new_license.php | 7 +- website_code/php/management/new_security.php | 5 +- .../php/management/play_security_list.php | 7 +- .../management/play_security_management.php | 9 +- .../php/management/remove_category.php | 8 +- .../php/management/remove_license.php | 8 +- .../php/management/remove_play_security.php | 7 +- website_code/php/management/site.php | 8 +- .../management/site_details_management.php | 4 +- website_code/php/management/syndication.php | 6 +- .../php/management/syndication_remove.php | 8 +- .../template_details_management.php | 8 +- .../management/user_details_management.php | 28 +- .../php/management/user_templates.php | 8 +- website_code/php/management/users.php | 8 +- website_code/php/peer/peer_review.php | 1 - .../php/properties/access_change_template.php | 333 ++++--- .../php/properties/access_template.php | 221 +++-- .../php/properties/delete_file_template.php | 35 +- .../php/properties/export_template.php | 71 +- website_code/php/properties/gift_template.php | 49 +- .../php/properties/gift_this_template.php | 235 +++-- .../properties/media_and_quota_template.php | 273 +++--- .../properties/name_select_gift_template.php | 103 ++- .../php/properties/name_select_template.php | 102 ++- .../php/properties/notes_change_template.php | 75 +- .../php/properties/notes_template.php | 81 +- .../php/properties/peer_change_template.php | 165 ++-- website_code/php/properties/peer_template.php | 129 ++- .../php/properties/properties_template.php | 112 ++- website_code/php/properties/publish.php | 149 ++- .../properties/remove_sharing_template.php | 42 +- .../php/properties/rename_template.php | 99 +- .../php/properties/rss_change_template.php | 23 +- website_code/php/properties/rss_template.php | 90 +- .../php/properties/screen_size_template.php | 46 +- .../set_sharing_rights_template.php | 39 +- .../php/properties/share_this_template.php | 74 +- .../properties/sharing_status_template.php | 153 ++-- .../syndication_change_template.php | 165 ++-- .../php/properties/syndication_template.php | 153 ++-- .../php/properties/xml_change_template.php | 128 ++- website_code/php/properties/xml_template.php | 79 +- website_code/php/publish/publish_template.php | 151 ++-- website_code/php/scorm/export.php | 436 ++++----- .../php/templates/duplicate_template.php | 118 ++- .../php/templates/remove_template.php | 127 ++- website_code/php/templates/sort_templates.php | 29 +- .../php/versioncontrol/template_close.php | 4 +- .../php/versioncontrol/update_file.php | 2 +- .../folder_rss_templates_template.php | 87 +- .../my_properties_template.php | 50 +- .../peer_templates_template.php | 63 +- .../public_templates_template.php | 60 +- .../rss_templates_template.php | 91 +- .../shared_templates_template.php | 64 +- .../syndication_templates_template.php | 77 +- .../usage_templates_template.php | 65 +- .../workspace_templates_template.php | 83 +- .../xml_templates_template.php | 63 +- 95 files changed, 3711 insertions(+), 3826 deletions(-) diff --git a/data.php b/data.php index f8900f3425..16f6ffd6ac 100644 --- a/data.php +++ b/data.php @@ -11,7 +11,6 @@ require_once("config.php"); -require $xerte_toolkits_site->php_library_path . "database_library.php"; require $xerte_toolkits_site->php_library_path . "template_status.php"; require $xerte_toolkits_site->php_library_path . "display_library.php"; diff --git a/example.php b/example.php index 9488bce13f..1b9e3cb5a7 100644 --- a/example.php +++ b/example.php @@ -11,7 +11,6 @@ require_once("config.php"); -require $xerte_toolkits_site->php_library_path . "database_library.php"; require $xerte_toolkits_site->php_library_path . "screen_size_library.php"; require $xerte_toolkits_site->php_library_path . "template_status.php"; require $xerte_toolkits_site->php_library_path . "display_library.php"; diff --git a/feedback/index.php b/feedback/index.php index ef75181ab6..7813328246 100644 --- a/feedback/index.php +++ b/feedback/index.php @@ -1,14 +1,15 @@ - @@ -24,37 +25,37 @@ -
- - -
-
- - + + +
+
+ +Thank you for your feedback

"; +if(isset($_POST['feedback'])){ - mail($xerte_toolkits_site->feedback_list, "Xerte Online Feedback", "Name " . mysql_real_escape_string($_POST['name']) . "
Message
" . mysql_real_escape_string($_POST['feedback']), $xerte_toolkits_site->headers); + echo "

Thank you for your feedback

"; - }else{ - - /** - * Else display the page - */ + mail($xerte_toolkits_site->feedback_list, "Xerte Online Feedback", "Name " . mysql_real_escape_string($_POST['name']) . "
Message
" . mysql_real_escape_string($_POST['feedback']), $xerte_toolkits_site->headers); - echo "

Welcome to Xerte on-line Toolkits Feedback page

Please leave your feedback here. All feedback is anonymous, unless you would like a response, and if you do, please leave your name opposite and some contact details in the box below. Thank you, the IS Learning Team.
"; +}else{ - echo "
NameFeedback
"; + /** + * Else display the page + */ - echo "
"; + echo "

Welcome to Xerte on-line Toolkits Feedback page

Please leave your feedback here. All feedback is anonymous, unless you would like a response, and if you do, please leave your name opposite and some contact details in the box below. Thank you, the IS Learning Team.
"; - } + echo "
NameFeedback
"; - ?> -
+ echo ""; + +} + +?> + - \ No newline at end of file + diff --git a/getfile.php b/getfile.php index 6e545f3595..02324e730f 100644 --- a/getfile.php +++ b/getfile.php @@ -1,62 +1,61 @@ php_library_path . "login_library.php"; - require $xerte_toolkits_site->php_library_path . "user_library.php"; - require $xerte_toolkits_site->php_library_path . "database_library.php"; - require $xerte_toolkits_site->php_library_path . "template_library.php"; - require $xerte_toolkits_site->php_library_path . "template_status.php"; - require $xerte_toolkits_site->php_library_path . "display_library.php"; - - $mysql_id=database_connect("Successful database connect for play queries","Failed database connect for play queries"); - - /* - * Check the template ID is numeric - */ - - $safe_file_path = mysql_real_escape_string($_GET['file']); - - $data_from_file_name = explode("-",$safe_file_path); - - if(is_numeric($data_from_file_name[0])){ - - if(has_rights_to_this_template($data_from_file_name[0],$_SESSION['toolkits_logon_id'])){ - - /* - * Check if user is editor (could be read only) - */ - - if(is_user_an_editor($data_from_file_name[0],$_SESSION['toolkits_logon_id'])){ - - if($data_from_file_name[1]==$_SESSION['toolkits_logon_username']){ - - $file = $xerte_toolkits_site->users_file_area_full . $safe_file_path; - - header("Cache-Control: public"); - header("Content-Description: File Transfer"); - header("Content-Disposition: attachment; filename=$file"); - header("Content-Transfer-Encoding: binary"); - - readfile($file); - - } - - } - - - } - - }else{ - - /* - * Was not numeric, so display error message - */ - - echo edit_xerte_page_format_top(file_get_contents($xerte_toolkits_site->website_code_path . "error_top")) . " Sorry this resource does not exist "; - die(); - - - } +require_once("config.php"); + +require $xerte_toolkits_site->php_library_path . "login_library.php"; +require $xerte_toolkits_site->php_library_path . "user_library.php"; +require $xerte_toolkits_site->php_library_path . "template_library.php"; +require $xerte_toolkits_site->php_library_path . "template_status.php"; +require $xerte_toolkits_site->php_library_path . "display_library.php"; + +$mysql_id=database_connect("Successful database connect for play queries","Failed database connect for play queries"); + +/* + * Check the template ID is numeric + */ + +$safe_file_path = mysql_real_escape_string($_GET['file']); + +$data_from_file_name = explode("-",$safe_file_path); + +if(is_numeric($data_from_file_name[0])){ + + if(has_rights_to_this_template($data_from_file_name[0],$_SESSION['toolkits_logon_id'])){ + + /* + * Check if user is editor (could be read only) + */ + + if(is_user_an_editor($data_from_file_name[0],$_SESSION['toolkits_logon_id'])){ + + if($data_from_file_name[1]==$_SESSION['toolkits_logon_username']){ + + $file = $xerte_toolkits_site->users_file_area_full . $safe_file_path; + + header("Cache-Control: public"); + header("Content-Description: File Transfer"); + header("Content-Disposition: attachment; filename=$file"); + header("Content-Transfer-Encoding: binary"); + + readfile($file); + + } + + } + + + } + +}else{ + + /* + * Was not numeric, so display error message + */ + + echo edit_xerte_page_format_top(file_get_contents($xerte_toolkits_site->website_code_path . "error_top")) . " Sorry this resource does not exist "; + die(); + + +} ?> diff --git a/index.php b/index.php index 495e0f2cdc..755ea4403a 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ php_library_path . "database_library.php"; require_once $xerte_toolkits_site->php_library_path . "user_library.php"; diff --git a/integration.php b/integration.php index b5ed93a9f2..3b94eecca8 100644 --- a/integration.php +++ b/integration.php @@ -1,95 +1,93 @@ -php_library_path . "login_library.php"; +include $xerte_toolkits_site->php_library_path . "login_library.php"; - include $xerte_toolkits_site->php_library_path . "display_library.php"; +include $xerte_toolkits_site->php_library_path . "display_library.php"; - $_SESSION['toolkits_firstname'] = "INSERTFIRSTNAMEHERE"; - - $_SESSION['toolkits_surname'] = "INSERTSURNAMEHERE"; +$_SESSION['toolkits_firstname'] = "INSERTFIRSTNAMEHERE"; - include $xerte_toolkits_site->php_library_path . "database_library.php"; +$_SESSION['toolkits_surname'] = "INSERTSURNAMEHERE"; - include $xerte_toolkits_site->php_library_path . "user_library.php"; +include $xerte_toolkits_site->php_library_path . "user_library.php"; - $mysql_id=database_connect("index.php database connect success","index.php database connect fail"); +$mysql_id=database_connect("index.php database connect success","index.php database connect fail"); - $_SESSION['toolkits_logon_username'] = "INSERTUSERNAMEHERE"; +$_SESSION['toolkits_logon_username'] = "INSERTUSERNAMEHERE"; - /* - * Check to see if this is a users' first time on the site - */ +/* + * Check to see if this is a users' first time on the site + */ - if(check_if_first_time($_SESSION['toolkits_logon_username'])){ +if(check_if_first_time($_SESSION['toolkits_logon_username'])){ - /* - * create the user a new id - */ + /* + * create the user a new id + */ - $_SESSION['toolkits_logon_id'] = create_user_id(); + $_SESSION['toolkits_logon_id'] = create_user_id(); - /* - * create a virtual root folder for this user - */ + /* + * create a virtual root folder for this user + */ - create_a_virtual_root_folder(); + create_a_virtual_root_folder(); - }else{ - - /* - * User exists so update the user settings - */ +}else{ - $_SESSION['toolkits_logon_id'] = get_user_id(); + /* + * User exists so update the user settings + */ - update_user_logon_time(); - - } + $_SESSION['toolkits_logon_id'] = get_user_id(); - recycle_bin(); + update_user_logon_time(); - /* - * Output the main page, including the user's and blank templates - */ - - echo file_get_contents($xerte_toolkits_site->website_code_path . "management_headers"); +} - echo "