# HG changeset patch # User Dan # Date 1182639256 14400 # Node ID 5d003b6c9e89ad2221c29202c84d6208c4c2eb48 # Parent edfc244087696ea274955586d936580b31d993dd Added demo mode functionality to various parts of Enano (unlocked only with a plugin) and fixed groups table diff -r edfc24408769 -r 5d003b6c9e89 includes/functions.php --- a/includes/functions.php Sat Jun 23 10:38:24 2007 -0400 +++ b/includes/functions.php Sat Jun 23 18:54:16 2007 -0400 @@ -906,7 +906,14 @@ { ob_start(); echo '
'; - debug_print_backtrace(); + if ( function_exists('debug_print_backtrace') ) + { + debug_print_backtrace(); + } + else + { + echo 'Warning: No debug_print_backtrace() support!'; + } echo ''; $c = ob_get_contents(); ob_end_clean(); diff -r edfc24408769 -r 5d003b6c9e89 includes/pageutils.php --- a/includes/pageutils.php Sat Jun 23 10:38:24 2007 -0400 +++ b/includes/pageutils.php Sat Jun 23 18:54:16 2007 -0400 @@ -1784,6 +1784,10 @@ break; case 'save_new': case 'save_edit': + if ( defined('ENANO_DEMO_MODE') ) + { + return Array('mode'=>'error','error'=>'Editing access control lists is disabled in the administration demo.'); + } $q = $db->sql_query('DELETE FROM '.table_prefix.'acl WHERE target_type='.intval($parms['target_type']).' AND target_id='.intval($parms['target_id']).' '.$page_where_clause_lite.';'); if(!$q) @@ -1811,6 +1815,10 @@ ); break; case 'delete': + if ( defined('ENANO_DEMO_MODE') ) + { + return Array('mode'=>'error','error'=>'Editing access control lists is disabled in the administration demo.'); + } $q = $db->sql_query('DELETE FROM '.table_prefix.'acl WHERE target_type='.intval($parms['target_type']).' AND target_id='.intval($parms['target_id']).' '.$page_where_clause_lite.';'); if(!$q) diff -r edfc24408769 -r 5d003b6c9e89 plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Sat Jun 23 10:38:24 2007 -0400 +++ b/plugins/SpecialAdmin.php Sat Jun 23 18:54:16 2007 -0400 @@ -10,7 +10,7 @@ /* * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between - * Version 1.0 release candidate 2 + * Version 1.0 release candidate 3 * Copyright (C) 2006-2007 Dan Fuhry * * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License @@ -58,8 +58,15 @@ Using the links on the left you can control every aspect of your website\'s look and feel, plus you can manage users, work with pages, and install plugins to make your Enano installation even better.'); + // Demo mode + if ( defined('ENANO_DEMO_MODE') ) + { + echo '
If you borked something up, or if you\'re done testing, you can reset this site. The site is reset automatically once every two hours. When a reset is performed, all custom modifications to the site are lost and replaced with default values.
'; + } + // Check for the installer scripts - if(file_exists(ENANO_ROOT.'/install.php') || file_exists(ENANO_ROOT.'/schema.sql')) + if( ( file_exists(ENANO_ROOT.'/install.php') || file_exists(ENANO_ROOT.'/schema.sql') ) && !defined('ENANO_DEMO_MODE') ) { echo '