Skip to content

Commit

Permalink
I think this is the up to date file fro 1 .8
Browse files Browse the repository at this point in the history
git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@264 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
juliantenney committed Mar 1, 2012
1 parent a6dd34c commit a2ee5fd
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions edit.php
Expand Up @@ -17,8 +17,6 @@
require $xerte_toolkits_site->php_library_path . "user_library.php";
require_once(dirname(__FILE__) . '/modules/xerte/module_functions.php');

require_once dirname(__FILE__) . '/modules/xerte/module_functions.php';

/**
*
* Function update_access_time
Expand All @@ -41,26 +39,27 @@ function update_access_time($row_edit){
/*
* Check the template ID is numeric
*/

if(!isset($_GET['template_id']) || !is_numeric($_GET['template_id'])) {
_debug("Template id is not numeric. ->" . $_GET['template_id']);
require $xerte_toolkits_site->root_file_path . "modules/xerte/edit.php";
require $xerte_toolkits_site->root_file_path . "modules/" . $row_edit['template_framework'] . "/edit.php";
dont_show_template();
exit(0);
}

/*
* Find out if this user has rights to the template
*/

$safe_template_id = (int) $_GET['template_id'];

$query_for_edit_content_strip = str_replace("\" . \$xerte_toolkits_site->database_table_prefix . \"", $xerte_toolkits_site->database_table_prefix, $xerte_toolkits_site->play_edit_preview_query);

$query_for_edit_content = str_replace("TEMPLATE_ID_TO_REPLACE", $safe_template_id, $query_for_edit_content_strip);

$row_edit = db_query_one($query_for_edit_content);
$query_for_edit_content_response = mysql_query($query_for_edit_content);

if(empty($row_edit)) {
die("Cannot find that template; perhaps it has been deleted?");
}
$row_edit = mysql_fetch_array($query_for_edit_content_response);

if(has_rights_to_this_template($safe_template_id,$_SESSION['toolkits_logon_id'])){

Expand Down Expand Up @@ -241,8 +240,7 @@ function update_access_time($row_edit){

}

}
else if(is_user_admin()){
}else if(is_user_admin()){

/*
* Is the current user an administrator - If so access here.
Expand Down Expand Up @@ -281,3 +279,4 @@ function update_access_time($row_edit){
}

}

0 comments on commit a2ee5fd

Please sign in to comment.