More variables renamed to , install/admin_WriteData() is now generic (with open TODO)
[mailer.git] / inc / modules / admin / admin-inc.php
index 7ab5e1283ab55aa84f147e8d87058e4efb97c780..706a4724e41af99c773cf88334a507b9fe1a7920 100644 (file)
@@ -233,76 +233,6 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) {
        // Return result
        return $ret;
 }
-//
-function admin_WriteData ($file, $comment, $prefix, $suffix, $DATA, $seek=0) {
-       // Initialize some variables
-       $done = false;
-       $seek++;
-       $next=-1;
-       $found = false;
-
-       // Is the file there and read-/write-able?
-       if ((FILE_READABLE($file)) && (is_writeable($file))) {
-               $search = "CFG: ".$comment;
-               $tmp = $file.".tmp";
-
-               // Open the source file
-               $fp = @fopen($file, 'r') or OUTPUT_HTML("<strong>READ:</strong> ".$file."<br />");
-
-               // Is the resource valid?
-               if (is_resource($fp)) {
-                       // Open temporary file
-                       $fp_tmp = @fopen($tmp, 'w') or OUTPUT_HTML("<strong>WRITE:</strong> ".$tmp."<br />");
-
-                       // Is the resource again valid?
-                       if (is_resource($fp_tmp)) {
-                               while (!feof($fp)) {
-                                       // Read from source file
-                                       $line = fgets ($fp, 1024);
-
-                                       if (strpos($line, $search) > -1) { $next = 0; $found = true; }
-
-                                       if ($next > -1) {
-                                               if ($next === $seek) {
-                                                       $next = -1;
-                                                       $line = $prefix . $DATA . $suffix."\n";
-                                               } else {
-                                                       $next++;
-                                               }
-                                       }
-
-                                       // Write to temp file
-                                       fputs($fp_tmp, $line);
-                               }
-
-                               // Close temp file
-                               fclose($fp_tmp);
-
-                               // Finished writing tmp file
-                               $done = true;
-                       }
-
-                       // Close source file
-                       fclose($fp);
-
-                       if (($done) && ($found)) {
-                               // Copy back tmp file and delete tmp :-)
-                               @copy($tmp, $file);
-                               @unlink($tmp);
-                               define('_FATAL', false);
-                       } elseif (!$found) {
-                               OUTPUT_HTML("<strong>CHANGE:</strong> 404!");
-                               define('_FATAL', true);
-                       } else {
-                               OUTPUT_HTML("<strong>TMP:</strong> UNDONE!");
-                               define('_FATAL', true);
-                       }
-               }
-       } else {
-               // File not found, not readable or writeable
-               OUTPUT_HTML("<strong>404:</strong> ".$file."<br />");
-       }
-}
 
 //
 function ADMIN_DO_ACTION($wht) {