]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
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

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

index e6880e4b593c501c57a0422ceac3b85baa7a6f51..3338b0429ba29fcec65d2fadbca31f336c55490e 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -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 9b10af4003e25aebc15431b6c7887b1d965ceb43..1001eabbdb1dae7df73c32fc2e1611a65d17b145 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/lib/missing.php3 b/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;
+}