Skip to content
Snippets Groups Projects
Commit 454817b0 authored by Graham Cole's avatar Graham Cole
Browse files

More components updated to use generic error handling. Refs #49

parent 5229c188
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ if (isset($session->groups[$permission])) {
case "Save":
// ...save the file
$savesuccess = @file_put_contents($myfile, $_REQUEST['body'], LOCK_EX);
if (!$savesuccess) $smarty->assign("fileerror", "Write failed");
if (!$savesuccess) trigger_error("Write failed", E_USER_ERROR);
$id = $DB->GetOne("select id from static where path=?", array($path));
$record = array();
$record['summary'] = $_REQUEST['summary'];
......
......@@ -39,7 +39,7 @@ if (isset($pathlist[3])) {
$headers=get_headers($_REQUEST['uri'], 1);
if ($headers) {
if (preg_match("/ 4/", $headers[0])) {
$smarty->assign("errormsg", "HTTP 4xx error detected - not creating ShortURI");
trigger_error("HTTP 4xx error detected - not creating ShortURI", E_USER_WARNING);
} else {
$record['url'] = @$_REQUEST['uri'];
$record['creator'] = $session->username;
......@@ -48,7 +48,7 @@ if (isset($pathlist[3])) {
$shorturi=$DB->GetOne("select id from $uritable where url=?", array(@$_REQUEST['uri']));
}
} else {
$smarty->assign("errormsg", "URI supplied is not valid");
trigger_error("URI supplied is not valid", E_USER_WARNING);
}
}
......@@ -56,7 +56,7 @@ if (isset($pathlist[3])) {
}
} else {
$smarty->assign("errormsg", "You are not logged in");
trigger_error("You are not logged in", E_USER_WARNING);
}
}
......
......@@ -5,13 +5,6 @@
</div></div></div>
</div>
{/if}
{if $fileerror}
<div class="errorbar">
<div><div><div>
File error: {$fileerror}
</div></div></div>
</div>
{/if}
{if $secondary}
<div id="primary">
......
......@@ -8,14 +8,6 @@ $script .= "</script>";
$this->append('extra_scripts', $script);
{/php}
{if $errormsg}
<div class="errorbar">
<div><div><div>
ShortURI: {$errormsg}
</div></div></div>
</div>
{/if}
{if $session->loggedin}
<div class="box" style="width: 80%; margin: auto;">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment