From e6a47585c6d41a0e956c9d9a617d968fca24d18e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 2 Jul 2005 15:47:41 +0000 Subject: [PATCH] r276: Add confirm to lang_file_import.php --- docs/lang_file_import.php | 44 +++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/docs/lang_file_import.php b/docs/lang_file_import.php index 7565251..94708fd 100644 --- a/docs/lang_file_import.php +++ b/docs/lang_file_import.php @@ -7,26 +7,34 @@ chdir('./../'); require_once('./global.php'); -$db->query("TRUNCATE TABLE " . TABLE_PREFIX . "phrase"); - -$sql = " - INSERT INTO " . TABLE_PREFIX . "phrase - (varname, phrasetext, imported) - VALUES"; - - -require('./docs/lang_file_master.php'); - -foreach ($language AS $varname => $phrase) +if (empty($_REQUEST['do'])) { - $sqlbits[] = " - ('" . $bugsys->escape($varname) . "', '" . $bugsys->escape($phrase) . "', " . time() . ")"; + echo "are you sure? yes"; } -$sql .= implode(',', $sqlbits); - -echo "
$sql
"; - -$db->query($sql); +if ($_REQUEST['do'] == 1) +{ + $db->query("TRUNCATE TABLE " . TABLE_PREFIX . "phrase"); + + $sql = " + INSERT INTO " . TABLE_PREFIX . "phrase + (varname, phrasetext, imported) + VALUES"; + + + require('./docs/lang_file_master.php'); + + foreach ($language AS $varname => $phrase) + { + $sqlbits[] = " + ('" . $bugsys->escape($varname) . "', '" . $bugsys->escape($phrase) . "', " . time() . ")"; + } + + $sql .= implode(',', $sqlbits); + + echo "
$sql
"; + + $db->query($sql); +} ?> \ No newline at end of file -- 2.43.5