diff --git a/components/static.php b/components/static.php index 5a98255b5aef03a1f83da11e93d45003292c7cf9..633c21cb1e7f458eb48dfad5776be6fa90b9b033 100644 --- a/components/static.php +++ b/components/static.php @@ -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']; diff --git a/components/uri.php b/components/uri.php index 37ee595462cdd44d81accde5186cf8e78f910230..705f6bcfe6da49f0aae9b94b5ebfcdbedc581601 100644 --- a/components/uri.php +++ b/components/uri.php @@ -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); } } diff --git a/templates/index.tpl b/templates/index.tpl index 4d642de8d82a1707d944454e6524aebd12686a5e..6f417257246cb6f9f9a0867fee8fb397818f562e 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -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"> diff --git a/templates/uri.tpl b/templates/uri.tpl index 2b7e08a0aaff3f1360975f0667de3558f967480e..ab706b792ddfb1cd83e6dc5fac4630b8a5e4dcc3 100644 --- a/templates/uri.tpl +++ b/templates/uri.tpl @@ -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;">