Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2006-10-03 17:11:35 +0400
committerMichal Čihař <michal@cihar.com>2006-10-03 17:11:35 +0400
commitccc6a049742369bcf1989e832837a3c409853167 (patch)
tree1ab5c8003cbcaae7b5a6c1d99cde45d7af77e1c6 /scripts
parent530a41aed3d5c781e1db9caf9b9885b15ff5aed0 (diff)
Sync token name, move it's definition to one place (bug #1569612).
Diffstat (limited to 'scripts')
-rw-r--r--scripts/setup.php41
1 files changed, 25 insertions, 16 deletions
diff --git a/scripts/setup.php b/scripts/setup.php
index aa77326159..8106905ced 100644
--- a/scripts/setup.php
+++ b/scripts/setup.php
@@ -12,7 +12,7 @@
* @version CVS: $Id$
*/
/* $Id$ */
-/* vim: expandtab sw=4 ts=4 sts=4: */
+//vim: expandtab sw=4 ts=4 sts=4:
// Grab phpMyAdmin version and PMA_dl function
define( 'PMA_MINIMUM_COMMON', TRUE );
@@ -332,6 +332,15 @@ function get_hidden_cfg() {
}
/**
+ * Returns needed hidden input for forms.
+ *
+ * @return string HTML with hidden inputs
+ */
+function get_hidden_inputs() {
+ return '<input type="hidden" name="token" value="' . $_SESSION[' PMA_token '] . '" />';
+}
+
+/**
* Creates form for some action
*
* @param string action name
@@ -343,7 +352,7 @@ function get_hidden_cfg() {
function get_action($name, $title, $added = '', $enabled = TRUE) {
$ret = '';
$ret .= '<form class="action" method="post" action="">';
- $ret .= '<input type="hidden" name="token" value="' . $_SESSION['PMA_token'] . '" />';
+ $ret .= get_hidden_inputs();
$ret .= '<input type="hidden" name="action" value="' . $name . '" />';
$ret .= $added;
$ret .= '<input type="submit" value="' . $title . '"';
@@ -369,7 +378,7 @@ function get_action($name, $title, $added = '', $enabled = TRUE) {
function get_url_action($url, $title, $params = array()) {
$ret = '';
$ret .= '<form class="action" method="get" action="' . $url . '" target="_blank">';
- $ret .= '<input type="hidden" name="token" value="' . $_SESSION['PMA_token'] . '" />';
+ $ret .= get_hidden_inputs();
foreach ($params as $key => $val) {
$ret .= '<input type="hidden" name="' . $key . '" value="' . $val . '" />';
}
@@ -778,7 +787,7 @@ function show_config_form($list, $legend, $help, $defaults = array(), $save = ''
function show_security_form($defaults = array()) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="feat_security_real" />
<?php
echo get_hidden_cfg();
@@ -809,7 +818,7 @@ function show_security_form($defaults = array()) {
function show_manual_form($defaults = array()) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="feat_manual_real" />
<?php
echo get_hidden_cfg();
@@ -836,7 +845,7 @@ function show_charset_form($defaults = array()) {
global $PMA_Config_Setup;
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="feat_charset_real" />
<?php
echo get_hidden_cfg();
@@ -864,7 +873,7 @@ function show_charset_form($defaults = array()) {
function show_extensions_form($defaults = array()) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="feat_extensions_real" />
<?php
echo get_hidden_cfg();
@@ -890,7 +899,7 @@ function show_relation_form($defaults = array()) {
global $PMA_Config_Setup;
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="feat_relation_real" />
<?php
echo get_hidden_cfg();
@@ -918,7 +927,7 @@ function show_relation_form($defaults = array()) {
function show_upload_form($defaults = array()) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="feat_upload_real" />
<?php
echo get_hidden_cfg();
@@ -945,7 +954,7 @@ function show_upload_form($defaults = array()) {
function show_server_form($defaults = array(), $number = FALSE) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="addserver_real" />
<?php
echo get_hidden_cfg();
@@ -995,7 +1004,7 @@ function show_server_form($defaults = array(), $number = FALSE) {
function show_left_form($defaults = array()) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="lay_left_real" />
<?php
echo get_hidden_cfg();
@@ -1027,7 +1036,7 @@ function show_left_form($defaults = array()) {
function show_tabs_form($defaults = array()) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="lay_tabs_real" />
<?php
echo get_hidden_cfg();
@@ -1055,7 +1064,7 @@ function show_tabs_form($defaults = array()) {
function show_icons_form($defaults = array()) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="lay_icons_real" />
<?php
echo get_hidden_cfg();
@@ -1084,7 +1093,7 @@ function show_icons_form($defaults = array()) {
function show_browse_form($defaults = array()) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="lay_browse_real" />
<?php
echo get_hidden_cfg();
@@ -1114,7 +1123,7 @@ function show_browse_form($defaults = array()) {
function show_edit_form($defaults = array()) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="lay_edit_real" />
<?php
echo get_hidden_cfg();
@@ -1148,7 +1157,7 @@ function show_edit_form($defaults = array()) {
function show_window_form($defaults = array()) {
?>
<form method="post" action="">
- <input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
+ <?php echo get_hidden_inputs();?>
<input type="hidden" name="action" value="lay_window_real" />
<?php
echo get_hidden_cfg();