diff --git a/.gitignore b/.gitignore index 8d78e8b..7a16f6f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ testElastica .htaccess .project -.settings \ No newline at end of file +.settings diff --git a/config.php b/config.php index e8f9a21..0852b30 100644 --- a/config.php +++ b/config.php @@ -19,6 +19,6 @@ * The users that are allowed in. Format 'username' => 'password' */ $config['users'] = array( - 'user' => 'password' + 'admin' => 'admin' ); -?> \ No newline at end of file +?> diff --git a/core/router.php b/core/router.php index 85b8634..a55def1 100644 --- a/core/router.php +++ b/core/router.php @@ -30,6 +30,22 @@ class Router */ protected static $config = array(); + + + + static function appendMessage($message){ + $_SESSION["messages"] = isset($_SESSION["messages"])?array():$_SESSION["messages"]; + $_SESSION["messages"][] = $message; + } + + static function getMessages(){ + if(isset($_SESSION["messages"])){ + $messages = $_SESSION["messages"]; + unset($_SESSION["messages"]); + return $messages; + } + return FALSE; + } /** * The main routing function. Keeps track * on which controllers and views to run. diff --git a/helper/form.php b/helper/form.php index abfe9f7..dc119b4 100644 --- a/helper/form.php +++ b/helper/form.php @@ -43,7 +43,8 @@ public function createForm() // Create a form id that can be used for validation $_SESSION['form_id_' . $name] = md5(time() . $name); - + $this->output = isset($this->output)?$this->output:""; + $this->output .= '