Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix typo
git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@998 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
JohnSmith-LT committed Jun 25, 2013
1 parent 96959ea commit d94bb60
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions edit.php
@@ -1,7 +1,7 @@
<?php

/**
*
*
* Edit page, brings up the xerte editor window
*
* @author Patrick Lockley
Expand Down Expand Up @@ -44,7 +44,7 @@ function update_access_time($row_edit){
}

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

$safe_template_id = (int) $_GET['template_id'];
Expand All @@ -56,12 +56,12 @@ function update_access_time($row_edit){
$row_edit = db_query_one($query_for_edit_content);

if(empty($row_edit)) {
die("Invalid template_id (could not find in DB)");
die("Invalid template_id (could not find in DB)");
}

if(isset($_SESSION['toolkits_logon_id'])){

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

// Check if user is editor (could be read only)

Expand All @@ -70,7 +70,7 @@ function update_access_time($row_edit){
// Check for multiple editors
if(has_template_multiple_editors($safe_template_id)){

// Check for lock file. A lock file is created to prevent more than one
// Check for lock file. A lock file is created to prevent more than one
if(file_exists($xerte_toolkits_site->users_file_area_full . $row_edit['template_id'] . "-" . $row_edit['username'] . "-" . $row_edit['template_name'] . "/lockfile.txt")){

// Lock file exists, so open it up and see who created it
Expand All @@ -79,7 +79,7 @@ function update_access_time($row_edit){
$temp = explode("*",$lock_file_data);

if(count($temp)==1){
$temp = explode(" ",$lock_file_data);
$temp = explode(" ",$lock_file_data);
}

$lock_file_creator = $temp[0];
Expand All @@ -92,7 +92,7 @@ function update_access_time($row_edit){
if(update_access_time($row_edit)) {
// Display the editor
require $xerte_toolkits_site->root_file_path . "modules/" . $row_edit['template_framework'] . "/edit.php";
output_editor_code($row_edit, $xerte_toolkits_site, "true", true);
output_editor_code($row_edit, $xerte_toolkits_site, "true", true);
}
else {
// show error
Expand Down Expand Up @@ -120,13 +120,13 @@ function update_access_time($row_edit){
if(update_access_time($row_edit)){

require $xerte_toolkits_site->root_file_path . "modules/" . $row_edit['template_framework'] . "/edit.php";
output_editor_code($row_edit, $xerte_toolkits_site, "true", true);
output_editor_code($row_edit, $xerte_toolkits_site, "true", true);
}
else {
error_show_template();
exit(0);
}
}
}
else {

// Update the lock file. The lock file format is creator id*id that tried to access 1 <space> id that tried to access 2 and so on
Expand All @@ -148,7 +148,7 @@ function update_access_time($row_edit){
// Update the time this template was last edited
if(update_access_time($row_edit)){
require $xerte_toolkits_site->root_file_path . "modules/" . $row_edit['template_framework'] . "/edit.php";
output_editor_code($row_edit, $xerte_toolkits_site, "true", true);
output_editor_code($row_edit, $xerte_toolkits_site, "true", true);
}else{
error_show_template();
exit(0);
Expand All @@ -158,13 +158,13 @@ function update_access_time($row_edit){

}
else {
// One editor (but shared) for this prohect, so continue without creating a lock file
// One editor (but shared) for this project, so continue without creating a lock file
if(update_access_time($row_edit)){
require $xerte_toolkits_site->root_file_path . "modules/" . $row_edit['template_framework'] . "/edit.php";
output_editor_code($row_edit, $xerte_toolkits_site, "true", false);
}
output_editor_code($row_edit, $xerte_toolkits_site, "true", false);
}
else {
error_show_template();
error_show_template();
exit(0);
}
}
Expand All @@ -174,33 +174,33 @@ function update_access_time($row_edit){
if(update_access_time($row_edit)){
_debug("editphp - no sharing etc");
require $xerte_toolkits_site->root_file_path . "modules/" . $row_edit['template_framework'] . "/edit.php";
output_editor_code($row_edit, $xerte_toolkits_site, "false", false);
output_editor_code($row_edit, $xerte_toolkits_site, "false", false);
}
else {
error_show_template();
error_show_template();
exit(0);
}
}
}
else if(is_user_admin()) {
// Is the current user an administrator - If so access here.
require $xerte_toolkits_site->root_file_path . "modules/" . $row_edit['template_framework'] . "/edit.php";
output_editor_code($row_edit, $xerte_toolkits_site, "false", false);
output_editor_code($row_edit, $xerte_toolkits_site, "false", false);
}
else {
// Wiki mode - check to see if template allows anonymous editing.

$string_for_flash_xml = $xerte_toolkits_site->users_file_area_short . $row_edit['template_id'] . "-" . $row_edit['username'] . "-" . $row_edit['template_name'] . "/data.xml";
$buffer = file_get_contents($string_for_flash_xml);
if(strpos($buffer,"editable=true")==false){
if(strpos($buffer,"editable=true")==false){
// so the user sees a blank page?
}else{
// Wiki mode set
require $xerte_toolkits_site->root_file_path . "modules/" . $row_edit['template_framework'] . "/edit.php";
output_editor_code($row_edit, $xerte_toolkits_site, "true", false);
output_editor_code($row_edit, $xerte_toolkits_site, "true", false);
}
}

}else{
die("Session ID not set");
die("Session ID not set");
}

0 comments on commit d94bb60

Please sign in to comment.