Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Dave Goodwin
committed
Oct 20, 2011
1 parent
b4bd6f5
commit 9f15ef8
Showing
95 changed files
with
3,711 additions
and
3,826 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,61 @@ | ||
<?PHP | ||
|
||
require("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 . "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 </div></div></body></html>"; | ||
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 </div></div></body></html>"; | ||
die(); | ||
|
||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.