Permalink
Browse files

Changed admin area to make full use of Dispatcher and moved admin dir…

…ectory.
  • Loading branch information...
1 parent 4201a8b commit 5eba796295ea4be5b9014d80b482317dd2c0d64f @mvdkleijn mvdkleijn committed May 17, 2010
Showing with 9,691 additions and 85 deletions.
  1. +0 −6 _.htaccess
  2. +1 −0 docs/changelog.txt
  3. +48 −6 index.php
  4. +1 −1 public/themes/simple/screen.css
  5. +1 −1 public/themes/wolf/screen.css
  6. +1 −0 wolf/Framework.php
  7. BIN wolf/admin/images/clear.gif
  8. BIN wolf/admin/images/collapse.png
  9. BIN wolf/admin/images/drag-disabled.gif
  10. BIN wolf/admin/images/drag.gif
  11. BIN wolf/admin/images/drag_to_copy.gif
  12. BIN wolf/admin/images/drag_to_sort.gif
  13. BIN wolf/admin/images/expand.png
  14. BIN wolf/admin/images/file.png
  15. BIN wolf/admin/images/icon-remove-disabled.gif
  16. BIN wolf/admin/images/icon-remove.gif
  17. BIN wolf/admin/images/icon-rename.gif
  18. BIN wolf/admin/images/icon_cal.gif
  19. BIN wolf/admin/images/layout.png
  20. BIN wolf/admin/images/magnify.png
  21. BIN wolf/admin/images/minus.png
  22. BIN wolf/admin/images/page.png
  23. BIN wolf/admin/images/plus.png
  24. BIN wolf/admin/images/snippet.png
  25. BIN wolf/admin/images/spinner.gif
  26. BIN wolf/admin/images/toolbar-icons.gif
  27. BIN wolf/admin/images/user.png
  28. +465 −0 wolf/admin/javascripts/calendar.js
  29. +115 −0 wolf/admin/javascripts/control.textarea.js
  30. +1 −0 wolf/admin/javascripts/cp-datepicker.js
  31. +974 −0 wolf/admin/javascripts/dragdrop.js
  32. +1,122 −0 wolf/admin/javascripts/effects.js
  33. +19 −0 wolf/admin/javascripts/jquery-1.3.2.min.js
  34. +298 −0 wolf/admin/javascripts/jquery-ui-1.7.2.custom.min.js
  35. +4,184 −0 wolf/admin/javascripts/prototype.js
  36. +4 −0 wolf/admin/javascripts/unitpngfix.js
  37. +651 −0 wolf/admin/javascripts/wolf.js
  38. +1,062 −0 wolf/admin/stylesheets/admin.css
  39. +158 −0 wolf/admin/stylesheets/login.css
  40. +101 −0 wolf/admin/stylesheets/toolbar.css
  41. +181 −0 wolf/admin/themes/black_and_white/styles.css
  42. +26 −0 wolf/admin/themes/brown_and_blue/styles.css
  43. +207 −0 wolf/admin/themes/brown_and_green/styles.css
  44. +1 −1 wolf/app/i18n/bn-message.php
  45. +1 −1 wolf/app/i18n/da-message.php
  46. +1 −1 wolf/app/i18n/es-message.php
  47. +1 −1 wolf/app/i18n/pt-message.php
  48. +1 −1 wolf/app/i18n/ro-message.php
  49. +12 −12 wolf/app/layouts/backend.php
  50. +1 −1 wolf/app/models/Setting.php
  51. +4 −4 wolf/app/views/layout/index.php
  52. +1 −1 wolf/app/views/layout/sidebar.php
  53. +5 −5 wolf/app/views/login/forgot.php
  54. +5 −5 wolf/app/views/login/login.php
  55. +8 −8 wolf/app/views/page/children.php
  56. +5 −5 wolf/app/views/page/edit.php
  57. +5 −5 wolf/app/views/page/index.php
  58. +1 −1 wolf/app/views/setting/index.php
  59. +4 −4 wolf/app/views/snippet/index.php
  60. +1 −1 wolf/app/views/snippet/sidebar.php
  61. +2 −2 wolf/app/views/translate/sidebar.php
  62. +3 −3 wolf/app/views/user/index.php
  63. +1 −1 wolf/app/views/user/sidebar.php
  64. +1 −1 wolf/install/config.tmpl
  65. +1 −1 wolf/plugins/comment/i18n/hr-message.php
  66. +1 −1 wolf/plugins/comment/i18n/pl-message.php
  67. +1 −1 wolf/plugins/comment/i18n/ro-message.php
  68. +1 −1 wolf/plugins/file_manager/i18n/hr-message.php
  69. +2 −2 wolf/plugins/file_manager/views/index.php
  70. +1 −1 wolf/plugins/skeleton/i18n/pl-message.php
View
@@ -26,12 +26,6 @@ Options -Indexes +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
- # Administration URL rewriting.
- RewriteRule ^admin(.*)$ admin/index.php?$1 [L,QSA]
-
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_FILENAME} !-l
# Main URL rewriting.
RewriteRule ^(.*)$ index.php?WOLFPAGE=$1 [L,QSA]
View
@@ -9,6 +9,7 @@ Sigla:
0.7.0 - released 2010-??-??
++ Changed admin area to make full use of Dispatcher and moved admin directory.
+ Added new Helper, Hash, which basically is Crypt_Hash from phpseclib.
+ Added tracking of failed login count and last failed login attempt.
+ Added session regeneration upon user privilege increase. (login for now)
View
@@ -30,22 +30,22 @@
// Constants ---------------------------------------------------------------
define('IN_CMS', true);
+define('CMS_VERSION', '0.6.0');
define('CMS_ROOT', dirname(__FILE__));
-define('FROG_ROOT', CMS_ROOT); // DEFINED ONLY FOR BACKWARDS SUPPORT - to be taken out before 0.9.0
define('CORE_ROOT', CMS_ROOT.'/wolf');
define('PLUGINS_ROOT', CORE_ROOT.'/plugins');
-
define('APP_PATH', CORE_ROOT.'/app');
require_once(CORE_ROOT.'/utils.php');
$config_file = CMS_ROOT.'/config.php';
-
require_once($config_file);
// if you have installed wolf and see this line, you can comment it or delete it :)
if ( ! defined('DEBUG')) { header('Location: wolf/install/'); exit(); }
+$url = URL_PUBLIC;
+
// Figure out what the public URI is based on URL_PUBLIC.
// @todo improve
$changedurl = str_replace('//','|',URL_PUBLIC);
@@ -57,6 +57,28 @@
define('URI_PUBLIC', substr($changedurl, $lastslash));
}
+// Determine URI for backend check
+if (USE_MOD_REWRITE && isset($_GET['WOLFPAGE'])) {
+ $admin_check = $_GET['WOLFPAGE'];
+}
+else {
+ $admin_check = urldecode($_SERVER['QUERY_STRING']);
+}
+
+// Are we in frontend or backend?
+if (startsWith($admin_check, 'admin') || startsWith($admin_check, '/admin') || isset($_GET['WOLFAJAX'])) {
+ define('CMS_BACKEND', true);
+ if (defined('USE_HTTPS') && USE_HTTPS) {
+ $url = str_replace('http://', 'https://', $url);
+ }
+ define('BASE_URL', $url . (endsWith($url, '/') ? '': '/') . (USE_MOD_REWRITE ? '': '?/') . ADMIN_DIR . (endsWith(ADMIN_DIR, '/') ? '': '/'));
+ define('BASE_URI', URI_PUBLIC . (endsWith($url, '/') ? '': '/') . (USE_MOD_REWRITE ? '': '?/') . ADMIN_DIR . (endsWith(ADMIN_DIR, '/') ? '': '/'));
+}
+else {
+ define('BASE_URL', URL_PUBLIC . (endsWith(URL_PUBLIC, '/') ? '': '/') . (USE_MOD_REWRITE ? '': '?'));
+ define('BASE_URI', URI_PUBLIC . (endsWith(URI_PUBLIC, '/') ? '': '/') . (USE_MOD_REWRITE ? '': '?'));
+}
+
define('PLUGINS_URI', URI_PUBLIC.'wolf/plugins/');
if (!defined('THEMES_ROOT')) { define('THEMES_ROOT', CMS_ROOT.'/public/themes'); }
if (!defined('THEMES_URI')) { define('THEMES_URI', URI_PUBLIC.'public/themes/'); }
@@ -77,8 +99,11 @@
// Init --------------------------------------------------------------------
-define('BASE_URL', URL_PUBLIC . (endsWith(URL_PUBLIC, '/') ? '': '/') . (USE_MOD_REWRITE ? '': '?'));
-define('BASE_URI', URI_PUBLIC . (endsWith(URI_PUBLIC, '/') ? '': '/') . (USE_MOD_REWRITE ? '': '?'));
+define('SESSION_LIFETIME', 3600);
+define('REMEMBER_LOGIN_LIFETIME', 1209600); // two weeks
+
+define('DEFAULT_CONTROLLER', 'page');
+define('DEFAULT_ACTION', 'index');
require CORE_ROOT.'/Framework.php';
@@ -114,7 +139,13 @@ function mysql_function_date_format($date, $format) {
Setting::init();
use_helper('I18n');
-I18n::setLocale(Setting::get('language'));
+AuthUser::load();
+if (AuthUser::isLoggedIn()) {
+ I18n::setLocale(AuthUser::getRecord()->language);
+}
+else {
+ I18n::setLocale(Setting::get('language'));
+}
// Only add the cron web bug when necessary
if (defined('USE_POORMANSCRON') && USE_POORMANSCRON && defined('POORMANSCRON_INTERVAL')) {
@@ -131,5 +162,16 @@ function run_cron() {
}
}
+Plugin::init();
+
+// Setup admin routes
+$admin_routes = array (
+ '/'.ADMIN_DIR => Setting::get('default_tab'),
+ '/'.ADMIN_DIR.'/' => Setting::get('default_tab'),
+ '/'.ADMIN_DIR.'/:any' => '$1'
+);
+
+Dispatcher::addRoute($admin_routes);
+
// run everything!
require APP_PATH.'/main.php';
@@ -1,4 +1,4 @@
-/* Simple CSS for Wolf CMS */
+/* Simple CSS for Wolf CMS */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,input,textarea,p,blockquote,th,td { margin:0; padding:0; }
table { border-collapse:collapse; border-spacing:0; }
@@ -1,4 +1,4 @@
-/* WOLF cms CSS
+/* WOLF cms CSS
*
* Initial public release: 20090801
* Appearance inspired by EveryBlock = http://www.everyblock.com/
View
@@ -112,6 +112,7 @@
*/
public static function addRoute($route, $destination=null) {
if ($destination != null && !is_array($route)) {
+ //if (!is_array($route)) {
$route = array($route => $destination);
}
self::$routes = array_merge(self::$routes, $route);
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 5eba796

Please sign in to comment.