Project

General

Profile

« Previous | Next » 

Revision db95baf1

Added by Viktor Gurov about 5 years ago

status.php: Add config history. Implements #10696

View differences:

src/etc/rc.restore_config_backup
30 30

  
31 31
$fp = fopen('php://stdin', 'r');
32 32

  
33
function print_backup_info($backup_info, $number) {
34
	if ($backup_info['time'] != 0) {
35
		$date = date(gettext("n/j/y H:i:s"), $backup_info['time']);
36
	} else {
37
		$date = gettext("Unknown");
38
	}
39

  
40
	list($page, $reason) = explode(": ", $backup_info['description'], 2);
41
	if (empty($reason)) {
42
		$reason = $page;
43
		$page = gettext("Unknown Page");
44
	}
45

  
46
	echo sprintf("%02d", $number) . ". {$date}\tv{$backup_info['version']}\t{$page}\n";
47
	if ($reason) {
48
		echo "    {$reason}\n";
49
	}
50
}
51

  
52 33
function list_backups($which="all", $return=false) {
53 34
	global $confvers;
54 35

  
......
61 42
		if (is_numeric($which) && ($c != $which)) {
62 43
			continue;
63 44
		}
64
		print_backup_info($confvers[$c], $c+1);
45
		echo backup_info($confvers[$c], $c+1);
65 46
		echo "\n";
66 47
	}
67 48
}

Also available in: Unified diff