Revision: 1649
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1649&view=rev
Author:   cimorrison
Date:     2010-11-25 17:23:58 +0000 (Thu, 25 Nov 2010)

Log Message:
-----------
- Removed the warning about the use of $provisional_enabled
- Added $provisional_enabled to the list of deprecated config variables that 
are now replaced by something else, but still supported for the moment in order 
to make upgrading easier
- Changed the way that the $mail_settings deprecated variables are treated and 
stopped trying to do anything too smart

Modified Paths:
--------------
    mrbs/trunk/web/internalconfig.inc.php
    mrbs/trunk/web/upgrade/21/post.inc

Modified: mrbs/trunk/web/internalconfig.inc.php
===================================================================
--- mrbs/trunk/web/internalconfig.inc.php       2010-11-25 10:40:21 UTC (rev 
1648)
+++ mrbs/trunk/web/internalconfig.inc.php       2010-11-25 17:23:58 UTC (rev 
1649)
@@ -5,7 +5,38 @@
 // This file contains internal configuration settings and checking.   You 
should not
 // need to change this file unless you are making changes to the MRBS code.
 
+
 /********************************************************
+ * Deprecated configuration variables
+ ********************************************************/
+
+// If they are still using some of the old configuration variables
+// then replace them with their new equivalents.   (Should maybe warn
+// the site admin somehow if they are being used?   Perhaps when a 
+// database upgrade is performed?)
+
+// Variables deprecated in versions of MRBS > 1.4.4.1
+if (isset($provisional_enabled))
+{
+  $approval_enabled = ($provisional_enabled) ? TRUE : FALSE;
+}
+
+// Variables deprecated in versions of MRBS > 1.4.5
+
+if (isset($mail_settings['admin_all']))
+{
+  // We won't set $mail_settings['on_new'] because the default is TRUE
+  // which gives the same behaviour as before, and if it's been set to FALSE
+  // it means the site admin has deliberately changed it.
+  $mail_settings['on_change'] = ($mail_settings['admin_all']) ? TRUE : FALSE;
+}
+if (isset($mail_settings['admin_on_delete']))
+{
+  $mail_settings['on_delete'] = ($mail_settings['admin_on_delete']) ? TRUE : 
FALSE;
+}
+
+
+/********************************************************
  * Checking
  ********************************************************/
 // Do some consistency checking of user settings from config.inc.php
@@ -183,26 +214,6 @@
 $area_defaults['confirmation_enabled']   = $confirmation_enabled;
 $area_defaults['confirmed_default']      = $confirmed_default;
 
-/********************************************************
- * Deprecated configuration variables
- ********************************************************/
-
-// If they are still using some of the old configuration variables
-// then replace them with their new equivalents.   (Should maybe warn
-// the site admin somehow if they are being used?   Perhaps when a 
-// database upgrade is performed?)
-
-// Variables deprecated in versions of MRBS > 1.4.5
-
-if (!empty($mail_settings['admin_all']))
-{
-  $mail_settings['on_new'] = TRUE;
-  $mail_settings['on_change'] = TRUE;
-}
-if (!empty($mail_settings['admin_on_delete']))
-{
-  $mail_settings['on_delete'] = TRUE;
-}
                
 /********************************************************
  * PHP System Configuration - internal use, do not change

Modified: mrbs/trunk/web/upgrade/21/post.inc
===================================================================
--- mrbs/trunk/web/upgrade/21/post.inc  2010-11-25 10:40:21 UTC (rev 1648)
+++ mrbs/trunk/web/upgrade/21/post.inc  2010-11-25 17:23:58 UTC (rev 1649)
@@ -5,44 +5,8 @@
 // Go through the area table and if any of the per-area settings are NULL then
 // set them to the area defaults
 
-require_once "standard_vars.inc.php";  // won't have been included yet and we 
need it for $area_defaults
-
 global $tbl_area, $area_defaults, $boolean_fields;
-global $provisional_enabled, $approval_enabled;
 
-// $provisional_enabled has now been renamed $approval_enabled, to avoid 
confusion with
-// tentative bookings.   If $provisional_enabled is still being used in the 
config file
-// then we need to warn them.   Furthermore, if $provisional_enabled is TRUE 
and 
-// $approval_enabled is still FALSE, ie the system default, then we assume 
that they really
-// meant to set $approval_enabled to TRUE and we will use that.   Otherwise 
they will find
-// that areas that have still got the field set to NULL will have approval 
disabled when
-// previously it was enabled.
-if (isset($provisional_enabled))
-{
-  echo "<p class=\"warning\">";
-  echo 'Warning:  you are still using <code>$provisional_enabled</code> in 
your config file.
-        This has now been replaced by <code>$approval_enabled</code>.   Please 
';
-  if ($area_defaults['approval_enabled'])
-  {
-    // As they have changed the default setting they must already have 
$approval_enabled
-    // in their config file, so they just need to delete the old variable
-    echo 'delete <code>$provisional_enabled</code> from your config file';
-  }
-  else
-  {
-    // otherwise they should rename it
-    echo 'rename <code>$provisional_enabled</code> to 
<code>$approval_enabled</code>';
-  }
-  echo ' once this upgrade is complete.';
-  if (!$area_defaults['approval_enabled']  && $provisional_enabled)
-  {
-    echo '<p class="warning">As you have <code>$provisional_enabled = 
TRUE;</code> MRBS is assuming
-          <code>$approval_enabled = TRUE;</code> as the default setting during 
this upgrade.</p>';
-    $area_defaults['approval_enabled'] = TRUE;
-  }
-  echo "</p>\n";
-}
-
 $fields = sql_field_info($tbl_area);
 foreach ($fields as $field)
 {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to