diff --git a/system/admin/admin.php b/system/admin/admin.php index 46c1855..afb62f4 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -5,7 +5,9 @@ function user($key, $user=null) { static $_config = array(); if (file_exists($value)) { $_config = parse_ini_file($value, true); - return $_config[$key]; + if(!empty($_config[$key])) { + return $_config[$key]; + } } } diff --git a/system/admin/views/delete-page.html.php b/system/admin/views/delete-page.html.php index 56c4e6d..5db0fd6 100644 --- a/system/admin/views/delete-page.html.php +++ b/system/admin/views/delete-page.html.php @@ -1,5 +1,7 @@ file; $dir = substr($url, 0, strrpos($url, '/')); @@ -8,11 +10,17 @@ $post = site_url() . $oldmd; - if($destination == 'post') { - $back = $post; + if(isset($destination)) { + + if($destination == 'post') { + $back = $post; + } + else { + $back = site_url() . $destination; + } } else { - $back = site_url() . $destination; + $back = site_url(); } ?> diff --git a/system/admin/views/delete-post.html.php b/system/admin/views/delete-post.html.php index adea149..13e16bf 100644 --- a/system/admin/views/delete-post.html.php +++ b/system/admin/views/delete-post.html.php @@ -1,5 +1,7 @@ file; $oldurl = explode('_', $url); $oldtag = $oldurl[1]; @@ -15,11 +17,17 @@ // The post URL $post = site_url().date('Y/m', $postdate).'/'.$oldmd; - if($destination == 'post') { - $back = $post; + if(isset($destination)) { + + if($destination == 'post') { + $back = $post; + } + else { + $back = site_url() . $destination; + } } else { - $back = site_url() . $destination; + $back = site_url(); } ?> diff --git a/system/admin/views/denied.html.php b/system/admin/views/denied.html.php new file mode 100644 index 0000000..4ad1fac --- /dev/null +++ b/system/admin/views/denied.html.php @@ -0,0 +1 @@ +

You don't have permission to access this page

\ No newline at end of file diff --git a/system/admin/views/edit-page.html.php b/system/admin/views/edit-page.html.php index 039c3ce..9a4c17e 100644 --- a/system/admin/views/edit-page.html.php +++ b/system/admin/views/edit-page.html.php @@ -17,7 +17,12 @@ $oldcontent = ltrim($arr[0]); } - $destination = $_GET['destination']; + if(isset($_GET['destination'])) { + $destination = $_GET['destination']; + } + else { + $destination = 'admin'; + } $dir = substr($url, 0, strrpos($url, '/')); $oldurl = str_replace($dir . '/','',$url); $oldmd = str_replace('.md','',$oldurl); diff --git a/system/admin/views/edit-post.html.php b/system/admin/views/edit-post.html.php index 0d4f79b..6cc9eb5 100644 --- a/system/admin/views/edit-post.html.php +++ b/system/admin/views/edit-post.html.php @@ -25,7 +25,12 @@ $oldmd = str_replace('.md','',$oldurl[2]); - $destination = $_GET['destination']; + if(isset($_GET['destination'])) { + $destination = $_GET['destination']; + } + else { + $destination = 'admin'; + } $replaced = substr($oldurl[0], 0,strrpos($oldurl[0], '/')) . '/'; $dt = str_replace($replaced,'',$oldurl[0]); $t = str_replace('-','',$dt); diff --git a/system/admin/views/layout.html.php b/system/admin/views/layout.html.php index 6a4a1cf..3ad773b 100644 --- a/system/admin/views/layout.html.php +++ b/system/admin/views/layout.html.php @@ -23,21 +23,7 @@ - - -
- -
- +