diff --git a/admin/includes/auth.php b/admin/includes/auth.php deleted file mode 100644 index 60e1d04..0000000 --- a/admin/includes/auth.php +++ /dev/null @@ -1,18 +0,0 @@ -
- - - - - - - - - - - -
\ No newline at end of file diff --git a/admin/includes/create_post.php b/admin/includes/create_post.php index c688257..610bf97 100644 --- a/admin/includes/create_post.php +++ b/admin/includes/create_post.php @@ -1,9 +1,30 @@ @@ -18,37 +39,12 @@ include '../includes/session.php';
- - - - - -
Tag:


@@ -77,4 +73,5 @@ include '../includes/session.php';
- \ No newline at end of file + + \ No newline at end of file diff --git a/admin/includes/edit_post.php b/admin/includes/edit_post.php index 65b46e0..69a5787 100644 --- a/admin/includes/edit_post.php +++ b/admin/includes/edit_post.php @@ -3,14 +3,25 @@ date_default_timezone_set('Asia/Jakarta'); require '../../system/includes/dispatch.php'; config('source', '../../admin/config.ini'); - include '../includes/session.php';; + include '../includes/session.php'; + if(isset($_GET['url'])) { $url = $_GET['url']; } else { header('location: ../index.php'); } -?> + + if(isset($_POST['submit'])) { + $post_content = $_POST['content']; + } + if(!empty($post_content)) { + file_put_contents('../'. $url, print_r($post_content, true)); + header('location: ../index.php'); + } + + if (login()) { +?> @@ -24,49 +35,38 @@
- - - - - -
+

-
-
- + + var editor = new Markdown.Editor(converter); + + editor.run(); + })(); +
- \ No newline at end of file + + \ No newline at end of file diff --git a/admin/includes/login.php b/admin/includes/login.php index a32d6bd..b16eea9 100644 --- a/admin/includes/login.php +++ b/admin/includes/login.php @@ -1,32 +1,74 @@ + + + Admin Panel + + + +
+
+

Password and username not match!

+

Login Form

+
+ User:
+

+ Pass:
+

+ +
+
+
+ + +EOF; } } else { - echo 'Please create username.txt inside "admin/users" folder and put your password inside it.'; + echo << + + + Admin Panel + + + +
+
+

Please create username.txt inside "admin/users" folder and put your password inside it.

+

Login Form

+
+ User:
+

+ Pass:
+

+ +
+
+
+ + +EOF; } - - } -?> -

Login Form

-
- User:
-

- Pass:
-

- -
\ No newline at end of file + } + else { + header('location: ../index.php'); + } +?> \ No newline at end of file diff --git a/admin/includes/post_list.php b/admin/includes/post_list.php index f5f2f2c..d8e01e5 100644 --- a/admin/includes/post_list.php +++ b/admin/includes/post_list.php @@ -112,23 +112,20 @@ function get_profile($profile, $page, $perpage){ } -?> +if (isset($_SESSION['user'])) { - -'; + foreach($posts as $p) { + echo ''; + echo ''; + echo ''; + echo ''; + } + echo '
' . $p->file . '
'; - foreach($posts as $p) { - echo ''; - echo '' . $p->file . ''; - echo '
'; - echo ''; } - -} - -?> - \ No newline at end of file +} \ No newline at end of file diff --git a/admin/includes/session.php b/admin/includes/session.php index d44e20b..8aa8c5a 100644 --- a/admin/includes/session.php +++ b/admin/includes/session.php @@ -11,6 +11,4 @@ function login() { return false; } -} - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/admin/index.php b/admin/index.php index f268dae..48e4e0e 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,9 +1,8 @@ @@ -13,9 +12,31 @@ include 'includes/session.php';
-
- -
+
+ + + + + + + +

Login Form

+
+ User:
+

+ Pass:
+

+ +
+ + +
- + \ No newline at end of file