From 85049635de65fbfa0e739231615454c861ebc6d8 Mon Sep 17 00:00:00 2001 From: jeena Date: Mon, 8 Jul 2013 23:43:30 +0200 Subject: [PATCH 1/3] added check if file is there --- application/controller/AdminController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/controller/AdminController.php b/application/controller/AdminController.php index 9513371..38492c9 100644 --- a/application/controller/AdminController.php +++ b/application/controller/AdminController.php @@ -34,7 +34,10 @@ class AdminController extends Katharsis_Controller_Abstract private function getPassword() { - $admin_ini = parse_ini_file('config/admin.ini'); + $path = 'config/admin.ini'; + if(!is_readable($path)) die($path . " not found"); + + $admin_ini = parse_ini_file($path); $password = $admin_ini["password"]; return $password; From 1fe7cf3a6e7ee7a2df85e3104f0110d81fd78164 Mon Sep 17 00:00:00 2001 From: jeena Date: Mon, 8 Jul 2013 23:44:07 +0200 Subject: [PATCH 2/3] fixed syntax error --- application/view/main.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/view/main.phtml b/application/view/main.phtml index e9fa602..bc345a1 100644 --- a/application/view/main.phtml +++ b/application/view/main.phtml @@ -54,7 +54,7 @@
headerImage): ?> - +

From 42a1a40f4afe2c73299c5702e90f65eda24508a0 Mon Sep 17 00:00:00 2001 From: jeena Date: Mon, 8 Jul 2013 23:44:21 +0200 Subject: [PATCH 3/3] better init db --- application/view/AdminPage/image.phtml | 2 +- config/dbinit.sql | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/application/view/AdminPage/image.phtml b/application/view/AdminPage/image.phtml index 63f3eac..3aa028a 100644 --- a/application/view/AdminPage/image.phtml +++ b/application/view/AdminPage/image.phtml @@ -4,7 +4,7 @@ - +
diff --git a/config/dbinit.sql b/config/dbinit.sql index f6ebfc9..7a891b9 100644 --- a/config/dbinit.sql +++ b/config/dbinit.sql @@ -16,7 +16,7 @@ CREATE TABLE `navigation` ( `active` tinyint(1) NOT NULL DEFAULT '1', `sorting` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM AUTO_INCREMENT=69 DEFAULT CHARSET=utf8; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; -- -- Table structure for table `page` @@ -26,10 +26,17 @@ DROP TABLE IF EXISTS `page`; CREATE TABLE `page` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(256) NOT NULL, - `subtitle` varchar(256) NOT NULL, + `subtitle` varchar(256) DEFAULT NULL, `url` varchar(256) NOT NULL, - `content` text NOT NULL, + `content` text DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT '1', + `header_image` varchar(256) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM AUTO_INCREMENT=36 DEFAULT CHARSET=utf8; +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +-- +-- Data +-- + +INSERT INTO `page` (`title`, `url`, `content`) VALUES ("Home", "home", "Wilkommen bei Katharsis"); +INSERT INTO `navigation` (`name`, `controller`, `action`) VALUES ("Home", "page", "home");