diff -urp 5/backup.module 6/backup.module
--- 5/backup.module	2008-03-01 16:05:10.000000000 +0600
+++ 6/backup.module	2008-03-01 16:05:12.000000000 +0600
@@ -20,7 +20,7 @@
 /**
  * Implementation of hook_help().
  */
-function backup_help($section = "") {
+function backup_help($section = "", $arg) {
   switch ($section) {
     case 'admin/modules#description':
       return t("Backs up your Drupal installation.");
@@ -40,7 +40,7 @@ function backup_perm() {  
 * Display the menu items for this module.
 *
 */
-function backup_menu($may_cache) {
+function backup_menu() {
 
 	$retval = array();
 
@@ -48,28 +48,26 @@ function backup_menu($may_cache) {
 	// To re-create the menu after you make changes here, load the
 	// /admin/build/menu page.
 	//
-	if ($may_cache) {
+
 		$menu_type = MENU_CALLBACK |MENU_VISIBLE_IN_TREE 
 			|MENU_MODIFIABLE_BY_ADMIN;
-		$retval[] = array(
-			"path" => "admin/content/backup",
+		$retval["admin/content/backup"] = array(
 			"title" => t("Backup"),
-			"access" => user_access('make backups'),
-			"callback" => "backup_page",
+			"access arguments" => array('make backups'),
+			"page callback" => "backup_page",
 			"description" => "Back up your Drupal installation.",
 			"type" => $menu_type,
 			);
 
 		$menu_type = MENU_CALLBACK |MENU_MODIFIABLE_BY_ADMIN;
-		$retval[] = array(
-			"path" => "admin/content/backup/phpinfo",
+		$retval["admin/content/backup/phpinfo"] = array(
 			"title" => t("Backup"),
-			"access" => user_access('make backups'),
-			"callback" => "backup_page_phpinfo",
+			"access arguments" => array('make backups'),
+			"page callback" => "backup_page_phpinfo",
 			"type" => $menu_type,
 			);
 
-	}
+
 
 	return($retval);
 
@@ -83,7 +81,7 @@ function backup_menu($may_cache) {
 */
 function backup_form() {
 
-	include("forms.inc.php");
+ 	include("forms.inc.php");
 
 	$form = array();
 	$error = "";
@@ -132,7 +130,7 @@ function backup_action_backup() {
 	//
 	$target = variable_get("backup_target", "");
 
-	watchdog("backup", t("Starting backup..."));
+	watchdog("backup", "Starting backup...");
 
 	//
 	// If we are not backing up to the Drupal root directory, then let's set
@@ -144,7 +142,7 @@ function backup_action_backup() {
 		if (!empty($error)) {
 			$error = "backup_database(): " . $error;
 			drupal_set_message($error, "error");
-			watchdog("backup", $error, WATCHDOG_ERROR);
+			watchdog("backup", $error, array(), WATCHDOG_ERROR);
 			return(null);
 		}
 
@@ -152,7 +150,7 @@ function backup_action_backup() {
 		if (!empty($error)) {
 			$error = "backup_database(): " . $error;
 			drupal_set_message($error, "error");
-			watchdog("backup", $error, WATCHDOG_ERROR);
+			watchdog("backup", $error, array(), WATCHDOG_ERROR);
 			return(null);
 		}
 
@@ -162,7 +160,7 @@ function backup_action_backup() {
 	if (!empty($error)) {
 		$error = "backup_database(): " . $error;
 		drupal_set_message($error, "error");
-		watchdog("backup", $error, WATCHDOG_ERROR);
+		watchdog("backup", $error, array(), WATCHDOG_ERROR);
 		return(null);
 	}
 
@@ -177,7 +175,7 @@ function backup_action_backup() {
 	if (!empty($error)) {
 		$error = "backup_files(): " . $error;
 		drupal_set_message($error, "error");
-		watchdog("backup", $error, WATCHDOG_ERROR);
+		watchdog("backup", $error, array(), WATCHDOG_ERROR);
 		return(null);
 	}
 
@@ -191,7 +189,7 @@ function backup_action_backup() {
 		if (!empty($error)) {
 			$error = "backup_database(): " . $error;
 			drupal_set_message($error, "error");
-			watchdog("backup", $error, WATCHDOG_ERROR);
+			watchdog("backup", $error, array(), WATCHDOG_ERROR);
 			return(null);
 		}
 
@@ -263,15 +261,11 @@ function backup_action_delete(&$data) {
 		$filename = $target . "/" . $key;
 
 		if (!unlink($filename)) {
-			$error = t("Unable to delete file %filename%",
-				array("%filename%" => $filename));
 			drupal_set_message($error, "error");
-			watchdog("backup", $error, WATCHDOG_ERROR);
+			watchdog("backup", "Unable to delete file %filename%", array("%filename%" => $filename), WATCHDOG_ERROR);
 		} else {
-			$message = t("File %filename% deleted!",
-				array("%filename%" => $filename));
 			drupal_set_message($message);
-			watchdog("backup", $message);
+			watchdog("backup", "File %filename% deleted!", array("%filename%" => $filename));
 		}
 
 	}
@@ -286,52 +280,56 @@ function backup_action_delete(&$data) {
 *
 * @param array $form_values Associative array of form values.
 */
-function backup_form_submit($form_id, $form_values) {
+function backup_form_submit($form, &$form_state) {
 
 	// Debugging
-	//print "<pre>"; print_r($form_values); print "</pre>"; exit();
-
-	include_once("functions.inc.php");
+	//print "<pre>"; print_r($form_state); print "</pre>"; exit();
 
-	$op = $form_values["op"];
+  	include_once("functions.inc.php");
 
+	$op = $form_state['clicked_button']['#value'];
+		
 	//
 	// Are we saving our config, or making a backup?
 	//
 	if ($op == t("Save Config")) {
-		backup_action_save_config($form_values);
+		backup_action_save_config($form_state['values']);
 
 	} else if ($op == t("Delete Selected Backups")) {
-		backup_action_delete($form_values);
+		backup_action_delete($form_state['values']);
 
 	} else {
 		backup_action_backup();
 
 	}
 
+
 } // End of backup_form_submit()
 
 
+
+
 /**
 * Make sure that our directory is writable.
 */
-function backup_form_validate($form_id, $form_values) {
+function backup_form_validate($form, &$form_state) {
+ // print_r(&$form_state);
 
-	if (!empty($form_values["from_parent"])) {
+	if (!empty($form_state['values']["from_parent"])) {
 		$parent_dir = backup_get_dirname() . "/";
 		$tmp = chdir("..");
 		if (empty($tmp)) {
-			$error = t("Unable to chdir() to parent directory. ")
-				. t("Cannot backup from parent directory.")
+			$error = "Unable to chdir() to parent directory. "
+				. "Cannot backup from parent directory."
 				;
-			watchdog("backup", $error, WATCHDOG_ERROR);
+			watchdog("backup", $error, array(), WATCHDOG_ERROR);
 			form_set_error("target", $error);
 		}
 		chdir($parent_dir);
 	}
 
 
-	$target = $form_values["target"];
+	$target = $form_state['values']["target"];
 
 	//
 	// Default to Drupal's root directory
@@ -349,12 +347,12 @@ function backup_form_validate($form_id, 
 	// Make sure the directory is writeable
 	//
 	if (!is_writable($target)) {
-		$error = t("Path '". realpath($target) ."' is not writable. ")
-			. t("Note that the user the webserver runs as may be different "
-				. "from the user that owns that directory. ")
-			. t("Please contact your SysAdmin for further assistance.")
+		$error = "Path '". realpath($target) ."' is not writable. "
+			. "Note that the user the webserver runs as may be different "
+				. "from the user that owns that directory. "
+			. "Please contact your SysAdmin for further assistance."
 			;
-		watchdog("backup", $error, WATCHDOG_ERROR);
+		watchdog("backup", $error, array(), WATCHDOG_ERROR);
 		form_set_error("target", $error);
 	}
 
@@ -367,8 +365,8 @@ function backup_form_validate($form_id, 
 
 		$fp = opendir($target);
 		if (empty($fp)) {
-			$error = t("Unable to open directory '$target' for reading!");
-			watchdog("backup", $error, WATCHDOG_ERROR);
+			$error = "Unable to open directory '$target' for reading!";
+			watchdog("backup", $error, array(), WATCHDOG_ERROR);
 			form_set_error("target", $error);
 		}
 
@@ -387,7 +385,7 @@ function backup_form_validate($form_id, 
 			}
 
 			$error = t("File '$file' in backup directory does not appear to be a backup!  For safety reasons, I cannot allow non-backup files in that directory.  Please clear any non-backup files out of the directory and try again.");
-			watchdog("backup", $error, WATCHDOG_ERROR);
+			watchdog("backup", $error, array(), WATCHDOG_ERROR);
 			form_set_error("target", $error);
 
 		}
@@ -395,6 +393,8 @@ function backup_form_validate($form_id, 
 		closedir($fp);
 
 	}
+	
+	
 
 } // End of backup_form_validate()
 
@@ -592,4 +592,27 @@ function backup_get_path() {
 } // End of backup_get_path()
 
 
-?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -urp 5/forms.inc.php 6/forms.inc.php
--- 5/forms.inc.php	2007-06-12 09:19:41.000000000 +0700
+++ 6/forms.inc.php	2008-02-26 02:38:06.000000000 +0600
@@ -9,7 +9,7 @@
 *	thousands of lines long.
 *
 */
-
+  include_once("functions.inc.php");
 
 /**
 * This function creates the "backup this installation" button.
@@ -152,7 +152,8 @@ function backup_form_config() {
 		variable_get("backup_from_parent", "");
 
 	$form["save"]["#type"] = "submit";
-	$form["save"]["#value"] = t("Save Config");
+  $form["save"]["#value"] = t("Save Config");
+//  $form["save"]["#submit"] = array('backup_action_save_config');
 
 	return($form);
 
@@ -166,7 +167,12 @@ function backup_form_config() {
 */
 function backup_form_files() {
 
-	include_once("functions.inc.php");
+  $retval = "";
+
+  $target = variable_get("backup_target", "");
+  if (empty($target)) {
+    $target = ".";
+  }
 
 	$form = array();
 
@@ -220,20 +226,33 @@ function backup_form_files() {
 		$row["size"]["#description"] = $size . t(" bytes");
 		$row["delete"][$delete["#name"]] = $delete;
 		
-		$form["files"][] = $row;
+	//	$form["files"][] = $row;
+
+    $filename = $target . "/" . rawurldecode($name);
+
+		
+		$form["files"][$name] = array(
+      '#type' => 'checkbox',
+      '#title' => l(t("Backup from ") . $date, $filename).' - <b>'.$size . t(" bytes").'</b>',
+      '#description' => $filename,      
+    );
+		
+		
 	}
 
 	//
 	// Specify a custom theme function for displaying these files.
 	//
-	$form["files"]["#theme"] = "form_files";
 
+  $form["files"]["#theme"] = "form_files";
+  
 	//
 	// The delete button
 	//
 	$form["delete"] = array();
 	$form["delete"]["#type"] = "submit";
 	$form["delete"]["#value"] = t("Delete Selected Backups");
+// $form["delete"]["#submit"] = array('backup_action_delete');
 
 	return($form);
 
@@ -248,9 +267,10 @@ function backup_form_files() {
 * @return string Rendered HTML with a table and form elements.
 */
 function theme_form_files($form) {
-
+  
+  $rows = array();
+  
 	$retval = "";
-	$rows = array();
 
 	$target = variable_get("backup_target", "");
 	if (empty($target)) {
@@ -291,5 +311,3 @@ function theme_form_files($form) {
 	return($retval);
 
 } // End of theme_form_files()
-
-?>
diff -urp 5/functions.inc.php 6/functions.inc.php
--- 5/functions.inc.php	2007-06-12 09:19:41.000000000 +0700
+++ 6/functions.inc.php	2008-02-26 02:28:58.000000000 +0600
@@ -28,6 +28,7 @@ function backup_database(&$db_file, $pre
 	//
 	// Create our database temp file
 	//
+
 	$db_file_tmp = tempnam("/tmp", "drupal-backup-db-");
 
 	//
@@ -79,6 +80,7 @@ function backup_database(&$db_file, $pre
 	// Move the temp file into the current directory (with a new name)
 	// so that it can be included in the tarball.
 	//
+
 	if (!rename($db_file_tmp, $db_file)) {
 		$error = "Renaming file '$db_file_tmp' to '$db_file' failed";
 		return($error);
@@ -435,7 +437,7 @@ function backup_permission_null(&$files)
 
 	foreach ($files as $key => $value) {
 		$file = $value["filename"];
-		if (!chmod($file, 0000)) {
+		if (!chmod($file, 0600)) {
 			$error = "Unable to chmod file '$file'";
 			return("backup_permission_null(): " . $error);
 		}
