Skip to content

Commit

Permalink
Fixes to management.php
Browse files Browse the repository at this point in the history
git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@290 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
pgogy committed Mar 30, 2012
1 parent e7f1b6f commit 8ea351e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 71 deletions.
2 changes: 0 additions & 2 deletions languages/en-gb/website_code/php/management/site.inc
Expand Up @@ -93,8 +93,6 @@

define("MANAGEMENT_SITE_ERROR_EMAIL_ACCOUNT", "The error log message is (Set to true to log errors)");

define("MANAGEMENT_SITE_ERROR_EMAIL", "The email error message is (Set to true to email errors)");

define("MANAGEMENT_SITE_ERROR_MAX", "The maximum error size is (The maximum number of entries per error log)");

define("MANAGEMENT_SITE_LDAP", "LDAP settings ");
Expand Down
84 changes: 17 additions & 67 deletions management.php
Expand Up @@ -108,36 +108,19 @@ function mgt_page($xerte_toolkits_site, $extra){

require $xerte_toolkits_site->php_library_path . "login_library.php";

require $xerte_toolkits_site->php_library_path . "login_library.php";

/*
* As with index.php, check for posts and similar
*/


if((!isset($_POST["login"]))&&(!isset($_POST["password"]))){

mgt_page($xerte_toolkits_site, MANAGEMENT_USERNAME_AND_PASSWORD_EMPTY);

$buffer .= login_page_format_bottom(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_bottom"));

echo $buffer;

}

if(($_POST["login"]=="")&&($_POST["password"]=="")){
if(empty($_POST["login"])&&empty($_POST["password"])){

mgt_page($xerte_toolkits_site, MANAGEMENT_USERNAME_AND_PASSWORD_EMPTY);

$buffer = login_page_format_top(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "mgt_top"));

mgt_page($xerte_toolkits_site, MANAGEMENT_USERNAME_EMPTY);

/*
* Password left empty
*/

}else if($_POST["password"]==""){
}else if(empty($_POST["password"])){

mgt_page($xerte_toolkits_site, MANAGEMENT_PASSWORD_EMPTY);

Expand All @@ -152,51 +135,32 @@ function mgt_page($xerte_toolkits_site, $extra){

$_SESSION['toolkits_logon_id'] = "site_administrator";


echo $buffer;

/*
* Password left empty
*/

$mysql_id=database_connect("management.php database connect success","management.php database connect fail");

/*
* Check the user is set as an admin in the usertype record in the logindetails table, and display the page
* Password and username provided, so try to authenticate
*/

?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head>

<!--
University of Nottingham Xerte Online Toolkits
HTML to use to set up the template management page
Version 1.0
-->

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Welcome to Xerte Web Toolkits</title>

<link href="website_code/styles/folder_popup.css" media="screen" type="text/css" rel="stylesheet" />
<link href="website_code/styles/management.css" media="screen" type="text/css" rel="stylesheet" /><?PHP

echo "<script type=\"text/javascript\"> // JAVASCRIPT library for fixed variables\n // management of javascript is set up here\n // SITE SETTINGS\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?PHP echo $xerte_toolkits_site->site_title; ?></title>

$buffer .= "<p>Please enter your password</p>";
<link href="website_code/styles/frontpage.css" media="screen" type="text/css" rel="stylesheet" />
<link href="website_code/styles/management.css" media="screen" type="text/css" rel="stylesheet" />

$buffer .= login_page_format_bottom(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_bottom"));
<!--
echo $buffer;
University of Nottingham Xerte Online Toolkits
HTML to use to set up the login page
The {{}} pairs are replaced in the page formatting functions in display library
/*
* Password and username provided, so try to authenticate
*/
Version 1.0
?>
-->
<script type="text/javascript" language="javascript" src="website_code/scripts/file_system.js"></script>
<script type="text/javascript" language="javascript" src="languages/<?PHP echo $_SESSION['toolkits_language']; ?>/website_code/scripts/file_system.js"></script>
<script type="text/javascript" language="javascript" src="website_code/scripts/screen_display.js"></script>
Expand Down Expand Up @@ -307,22 +271,8 @@ function mgt_page($xerte_toolkits_site, $extra){
echo file_get_contents($xerte_toolkits_site->website_code_path . "admin_middle");


}else{

/*
* Wrong password message
*/

$buffer = login_page_format_top(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_top"));

$buffer .= "<p>Sorry that password combination was not correct</p>";

$buffer .= login_page_format_bottom(file_get_contents($xerte_toolkits_site->root_file_path . $xerte_toolkits_site->website_code_path . "login_bottom"));
echo $buffer;

}

}

}

Expand Down
2 changes: 0 additions & 2 deletions website_code/php/management/site.php
Expand Up @@ -106,8 +106,6 @@

echo "<div class=\"template\" id=\"errordetails\"><p>" . MANAGEMENT_SITE_ERROR_HANDLING . "<a href=\"javascript:templates_display('errordetails')\">" . MANAGEMENT_VIEW . "</a></p></div><div class=\"template_details\" id=\"errordetails_child\">";

echo "<p>" . MANAGEMENT_SITE_ERROR_EMAIL . "<form><textarea id=\"email_error_list\">" . $row['email_error_list'] . "</textarea></form></p>";

echo "<p>" . MANAGEMENT_SITE_ERROR_EMAIL_ACCOUNT . "<form><textarea id=\"error_log_message\">" . $row['error_log_message'] . "</textarea></form></p>";

echo "<p>" . MANAGEMENT_SITE_ERROR_EMAIL . "<form><textarea id=\"error_email_message\">" . $row['error_email_message'] . "</textarea></form></p>";
Expand Down

0 comments on commit 8ea351e

Please sign in to comment.