This fix makes the plugin backward compatible with conf.pl
authorphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 29 Jan 2002 16:28:09 +0000 (16:28 +0000)
committerphilippe_mingo <philippe_mingo@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 29 Jan 2002 16:28:09 +0000 (16:28 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2285 7612ce4b-ef26-0410-bec9-ea0150e637f0

plugins/administrator/options.php

index 79ddf48..cc45f04 100644 (file)
@@ -299,20 +299,24 @@ foreach ( $newcfg as $k => $v ) {
                     fwrite( $fp, ', ' );
                 }
                 fwrite( $fp, substr( $k, 0, $i) );
-                $not_first = TRUE;
             }
         } else {
             if( $not_first ) {
                 fwrite( $fp, ', ' );
-            }
+            }        
             fwrite( $fp, $k );
-            $not_first = TRUE;
         }
+        $not_first = TRUE;
     }
 }
 fwrite( $fp, ";\n" );
 foreach ( $newcfg as $k => $v ) {
     if ( $k{0} == '$' ) {
+        if ( substr( $k, 1, 11 ) == 'ldap_server' ) {
+            $v = substr( $v, 0, strlen( $v ) - 1 ) . "\n)";
+            $v = str_replace( 'array(', "array(\n\t", $v );
+            $v = str_replace( "',", "',\n\t", $v );
+        }
         fwrite( $fp, "$k = $v;\n" );
     }
 }