Add a missing.php3 file with functions that may be missing from the PHP version used...
authorkkalev <kkalev>
Fri, 9 Jul 2004 12:14:39 +0000 (12:14 +0000)
committerkkalev <kkalev>
Fri, 9 Jul 2004 12:14:39 +0000 (12:14 +0000)
if a function is missing. Currently only array_change_key_case() is included

dialup_admin/Changelog
dialup_admin/conf/config.php3
dialup_admin/lib/missing.php3 [new file with mode: 0644]

index e6880e4..3338b04 100644 (file)
@@ -15,6 +15,8 @@ Ver 1.72:
   have different mappings for each administrator.
 * Use require_once instead of require when including xlat.php3
 * Add debug statements in sql connect functions
+* Add a missing.php3 file with functions that may be missing from the PHP version used. Include it
+  if a function is missing. Currently only array_change_key_case() is included
 Ver 1.70:
 * Add the /bin postgresql compatibility patch from Guy Fraser
 * Add ldap_userdn as a configuration directive. If set we use that for
index 9b10af4..1001eab 100644 (file)
@@ -96,4 +96,8 @@ if (!isset($mappings) && $config[general_username_mappings_file] != ''){
        if ($config[general_use_session] == 'yes')
                session_register('mappings');
 }
+
+//Include missing.php3 if needed
+if (!function_exists('array_change_key_case'))
+       include_once('../lib/missing.php3');
 ?>
diff --git a/dialup_admin/lib/missing.php3 b/dialup_admin/lib/missing.php3
new file mode 100644 (file)
index 0000000..af2bb8e
--- /dev/null
@@ -0,0 +1,13 @@
+function array_change_key_case($input,$case)
+{
+       $NEW_ARR = array();
+       foreach ($input as $val => $key){
+               if ($case == CASE_UPPER)
+                       $K = strtoupper($key);
+               else if ($case == CASE_LOWER)
+                       $K = strtolower($key);
+               $NEW_ARR[$K] = $val;
+       }
+
+       return $NEW_ARR;
+}