Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit c23e98c000d6818979ef4a75fd0c549899cc9def @phoboslab committed Jul 14, 2012
Showing with 3,362 additions and 0 deletions.
  1. +10 −0 .htaccess
  2. +83 −0 admin/index.php
  3. +322 −0 admin/install.php
  4. +184 −0 admin/post.js.php
  5. +45 −0 admin/post.php
  6. +29 −0 admin/templates/add-user.html.php
  7. +341 −0 admin/templates/admin.css
  8. BIN admin/templates/asaph.ico
  9. +349 −0 admin/templates/calendar.js
  10. +47 −0 admin/templates/edit-post.html.php
  11. +32 −0 admin/templates/edit-user.html.php
  12. +6 −0 admin/templates/foot.html.php
  13. +23 −0 admin/templates/head.html.php
  14. +32 −0 admin/templates/login.html.php
  15. +140 −0 admin/templates/post.css
  16. +50 −0 admin/templates/posts.html.php
  17. BIN admin/templates/remote-background.png
  18. +28 −0 admin/templates/remote-login.html.php
  19. +56 −0 admin/templates/remote-post.html.php
  20. +17 −0 admin/templates/remote-success.html.php
  21. +14 −0 admin/templates/users.html.php
  22. +39 −0 index.php
  23. +105 −0 lib/asaph.class.php
  24. +299 −0 lib/asaph_admin.class.php
  25. +61 −0 lib/asaph_config.class.php
  26. +197 −0 lib/asaph_post.class.php
  27. +140 −0 lib/db.class.php
  28. +122 −0 readme.txt
  29. +31 −0 templates/rss.xml.php
  30. +22 −0 templates/stickney/about.html.php
  31. BIN templates/stickney/asaph.ico
  32. BIN templates/stickney/loading.gif
  33. +59 −0 templates/stickney/posts.html.php
  34. +121 −0 templates/stickney/stickney.css
  35. +83 −0 templates/stickney/whitebox.js
  36. +22 −0 templates/whiteout/about.html.php
  37. BIN templates/whiteout/asaph.ico
  38. BIN templates/whiteout/loading.gif
  39. +57 −0 templates/whiteout/posts.html.php
  40. +83 −0 templates/whiteout/whitebox.js
  41. +113 −0 templates/whiteout/whiteout.css
@@ -0,0 +1,10 @@
+<IfModule mod_rewrite.c>
+ # Add 'rw' parameter, so we can detect whether mod_rewrite is enabled
+ RewriteEngine on
+ RewriteRule ^$ index.php?rw
+
+ # Rewrite everything to index.php if it is not a real file or directory
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^(.*)$ index.php?rw=$1
+</IfModule>
@@ -0,0 +1,83 @@
+<?php
+define( 'ASAPH_PATH', '../' );
+require_once( ASAPH_PATH.'lib/asaph_admin.class.php' );
+
+header( 'Content-type: text/html; charset=utf-8' );
+
+$asaphAdmin = new Asaph_Admin( Asaph_Config::$adminPostsPerPage );
+if( isset($_POST['login']) ) {
+ if( $asaphAdmin->login($_POST['name'], $_POST['pass']) ) {
+ header( 'Location: '.Asaph_Config::$absolutePath.'admin/' );
+ }
+ else {
+ $loginError = true;
+ include( ASAPH_PATH.'admin/templates/login.html.php' );
+ }
+}
+else if( $asaphAdmin->checkLogin() ) {
+ if( isset($_GET['logout']) ) {
+ $asaphAdmin->logout();
+ header( 'Location: '.Asaph_Config::$absolutePath.'admin/' );
+ exit;
+ }
+
+ // Users
+ else if( isset($_GET['users']) ) {
+ $users = $asaphAdmin->getUsers();
+ include( ASAPH_PATH.'admin/templates/users.html.php' );
+ }
+ else if( !empty($_GET['user']) ) {
+ $user = $asaphAdmin->getUser( $_GET['user'] );
+ include( ASAPH_PATH.'admin/templates/edit-user.html.php' );
+ }
+ else if( isset($_GET['addUser']) ) {
+ include( ASAPH_PATH.'admin/templates/add-user.html.php' );
+ }
+ else if( isset($_POST['deleteUser']) ) {
+ $asaphAdmin->deleteUser( $_POST['id'] );
+ header( 'Location: '.Asaph_Config::$absolutePath.'admin/?users' );
+ }
+ else if( isset($_POST['updateUser']) ) {
+ $status = $asaphAdmin->updateUser( $_POST['id'], $_POST['name'], $_POST['password'], $_POST['password2'] );
+ if( $status === true ) {
+ header( 'Location: '.Asaph_Config::$absolutePath.'admin/?users' );
+ } else {
+ $user = array(
+ 'id' => intval($_POST['id']),
+ 'name' => $_POST['name']
+ );
+ include( ASAPH_PATH.'admin/templates/edit-user.html.php' );
+ }
+ }
+ else if( isset($_POST['addUser']) ) {
+ $status = $asaphAdmin->addUser( $_POST['name'], $_POST['password'], $_POST['password2'] );
+ if( $status === true ) {
+ header( 'Location: '.Asaph_Config::$absolutePath.'admin/?users' );
+ } else {
+ include( ASAPH_PATH.'admin/templates/add-user.html.php' );
+ }
+ }
+
+ // Posts
+ else if( !empty($_GET['post']) ) {
+ $post = $asaphAdmin->getPost( $_GET['post'] );
+ include( ASAPH_PATH.'admin/templates/edit-post.html.php' );
+ }
+ else if( isset($_POST['deletePost']) ) {
+ $asaphAdmin->deletePost( $_POST['id'] );
+ header( 'Location: '.Asaph_Config::$absolutePath.'admin/' );
+ }
+ else if( isset($_POST['updatePost']) ) {
+ $asaphAdmin->updatePost( $_POST['id'], $_POST['created'], $_POST['source'], $_POST['title'] );
+ header( 'Location: '.Asaph_Config::$absolutePath.'admin/' );
+ }
+ else {
+ $posts = $asaphAdmin->getPosts( empty($_GET['page']) ? 0 : $_GET['page']-1 );
+ $pages = $asaphAdmin->getPages();
+ include( ASAPH_PATH.'admin/templates/posts.html.php' );
+ }
+} else {
+ include( ASAPH_PATH.'admin/templates/login.html.php' );
+}
+
+?>
Oops, something went wrong.

0 comments on commit c23e98c

Please sign in to comment.