removed MySQL < 5 code
This commit is contained in:
@@ -24,52 +24,45 @@ $calling_script = PMA_getenv('PHP_SELF');
|
|||||||
}?>
|
}?>
|
||||||
<fieldset id="fieldset_change_password">
|
<fieldset id="fieldset_change_password">
|
||||||
<legend><?php echo $GLOBALS['strChangePassword']; ?></legend>
|
<legend><?php echo $GLOBALS['strChangePassword']; ?></legend>
|
||||||
<table class="data">
|
<table class="data">
|
||||||
<tr class="odd noclick">
|
<tr class="odd noclick">
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
<input type="radio" name="nopass" value="1" onclick="pma_pw.value = ''; pma_pw2.value = ''; this.checked = true" />
|
<input type="radio" name="nopass" value="1" onclick="pma_pw.value = ''; pma_pw2.value = ''; this.checked = true" />
|
||||||
<?php echo $GLOBALS['strNoPassword'] . "\n"; ?>
|
<?php echo $GLOBALS['strNoPassword'] . "\n"; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="even noclick">
|
<tr class="even noclick">
|
||||||
<td>
|
<td>
|
||||||
<input type="radio" name="nopass" value="0" onclick="document.getElementById('pw_pma_pw').focus();" checked="checked " />
|
<input type="radio" name="nopass" value="0" onclick="document.getElementById('pw_pma_pw').focus();" checked="checked " />
|
||||||
<?php echo $GLOBALS['strPassword']; ?>:
|
<?php echo $GLOBALS['strPassword']; ?>:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="password" name="pma_pw" id="pw_pma_pw" size="10" class="textfield" <?php echo $chg_evt_handler; ?>="nopass[1].checked = true" />
|
<input type="password" name="pma_pw" id="pw_pma_pw" size="10" class="textfield" <?php echo $chg_evt_handler; ?>="nopass[1].checked = true" />
|
||||||
|
|
||||||
<?php echo $GLOBALS['strReType']; ?>:
|
<?php echo $GLOBALS['strReType']; ?>:
|
||||||
<input type="password" name="pma_pw2" id="pw_pma_pw2" size="10" class="textfield" <?php echo $chg_evt_handler; ?>="nopass[1].checked = true" />
|
<input type="password" name="pma_pw2" id="pw_pma_pw2" size="10" class="textfield" <?php echo $chg_evt_handler; ?>="nopass[1].checked = true" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<tr>
|
||||||
|
<td>
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40102) {
|
<?php echo $strPasswordHashing; ?>:
|
||||||
?>
|
</td>
|
||||||
<tr>
|
|
||||||
<td>
|
<td>
|
||||||
<?php echo $strPasswordHashing; ?>:
|
<input type="radio" name="pw_hash" id="radio_pw_hash_new" value="new" checked="checked" />
|
||||||
</td>
|
<label for="radio_pw_hash_new">
|
||||||
<td>
|
MySQL 4.1+
|
||||||
<input type="radio" name="pw_hash" id="radio_pw_hash_new" value="new" checked="checked" />
|
</label>
|
||||||
<label for="radio_pw_hash_new">
|
</td>
|
||||||
MySQL 4.1+
|
</tr>
|
||||||
</label>
|
<tr>
|
||||||
</td>
|
<td> </td>
|
||||||
</tr>
|
<td>
|
||||||
<tr>
|
<input type="radio" name="pw_hash" id="radio_pw_hash_old" value="old" />
|
||||||
<td> </td>
|
<label for="radio_pw_hash_old">
|
||||||
<td>
|
<?php echo $strCompatibleHashing; ?>
|
||||||
<input type="radio" name="pw_hash" id="radio_pw_hash_old" value="old" />
|
</label>
|
||||||
<label for="radio_pw_hash_old">
|
</td>
|
||||||
<?php echo $strCompatibleHashing; ?>
|
</tr>
|
||||||
</label>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset id="fieldset_change_password_footer" class="tblFooters">
|
<fieldset id="fieldset_change_password_footer" class="tblFooters">
|
||||||
|
@@ -19,12 +19,10 @@ if ($is_create_db_priv) {
|
|||||||
<?php echo PMA_generate_common_hidden_inputs('', '', 5); ?>
|
<?php echo PMA_generate_common_hidden_inputs('', '', 5); ?>
|
||||||
<input type="hidden" name="reload" value="1" />
|
<input type="hidden" name="reload" value="1" />
|
||||||
<input type="text" name="db" value="<?php echo $db_to_create; ?>" maxlength="64" class="textfield" id="text_create_db"/>
|
<input type="text" name="db" value="<?php echo $db_to_create; ?>" maxlength="64" class="textfield" id="text_create_db"/>
|
||||||
<?php
|
<?php
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40101) {
|
require_once './libraries/mysql_charsets.lib.php';
|
||||||
require_once './libraries/mysql_charsets.lib.php';
|
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', null, null, TRUE, 5);
|
||||||
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'db_collation', null, null, TRUE, 5);
|
?>
|
||||||
}
|
|
||||||
?>
|
|
||||||
<input type="submit" value="<?php echo $strCreate; ?>" id="buttonGo" />
|
<input type="submit" value="<?php echo $strCreate; ?>" id="buttonGo" />
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
|
@@ -3,6 +3,25 @@
|
|||||||
/**
|
/**
|
||||||
* Displays form for creating a table (if user has privileges for that)
|
* Displays form for creating a table (if user has privileges for that)
|
||||||
*
|
*
|
||||||
|
* for MySQL >= 4.1.0, we should be able to detect if user has a CREATE
|
||||||
|
* privilege by looking at SHOW GRANTS output;
|
||||||
|
* for < 4.1.0, it could be more difficult because the logic tries to
|
||||||
|
* detect the current host and it might be expressed in many ways; also
|
||||||
|
* on a shared server, the user might be unable to define a controluser
|
||||||
|
* that has the proper rights to the "mysql" db;
|
||||||
|
* so we give up and assume that user has the right to create a table
|
||||||
|
*
|
||||||
|
* Note: in this case we could even skip the following "foreach" logic
|
||||||
|
*
|
||||||
|
* Addendum, 2006-01-19: ok, I give up. We got some reports about servers
|
||||||
|
* where the hostname field in mysql.user is not the same as the one
|
||||||
|
* in mysql.db for a user. In this case, SHOW GRANTS does not return
|
||||||
|
* the db-specific privileges. And probably, those users are on a shared
|
||||||
|
* server, so can't set up a control user with rights to the "mysql" db.
|
||||||
|
* We cannot reliably detect the db-specific privileges, so no more
|
||||||
|
* warnings about the lack of privileges for CREATE TABLE. Tested
|
||||||
|
* on MySQL 5.0.18.
|
||||||
|
*
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -11,93 +30,8 @@
|
|||||||
*/
|
*/
|
||||||
require_once './libraries/check_user_privileges.lib.php';
|
require_once './libraries/check_user_privileges.lib.php';
|
||||||
|
|
||||||
// for MySQL >= 4.1.0, we should be able to detect if user has a CREATE
|
|
||||||
// privilege by looking at SHOW GRANTS output;
|
|
||||||
// for < 4.1.0, it could be more difficult because the logic tries to
|
|
||||||
// detect the current host and it might be expressed in many ways; also
|
|
||||||
// on a shared server, the user might be unable to define a controluser
|
|
||||||
// that has the proper rights to the "mysql" db;
|
|
||||||
// so we give up and assume that user has the right to create a table
|
|
||||||
//
|
|
||||||
// Note: in this case we could even skip the following "foreach" logic
|
|
||||||
|
|
||||||
// Addendum, 2006-01-19: ok, I give up. We got some reports about servers
|
|
||||||
// where the hostname field in mysql.user is not the same as the one
|
|
||||||
// in mysql.db for a user. In this case, SHOW GRANTS does not return
|
|
||||||
// the db-specific privileges. And probably, those users are on a shared
|
|
||||||
// server, so can't set up a control user with rights to the "mysql" db.
|
|
||||||
// We cannot reliably detect the db-specific privileges, so no more
|
|
||||||
// warnings about the lack of privileges for CREATE TABLE. Tested
|
|
||||||
// on MySQL 5.0.18.
|
|
||||||
|
|
||||||
$is_create_table_priv = true;
|
$is_create_table_priv = true;
|
||||||
|
|
||||||
/*
|
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40100) {
|
|
||||||
$is_create_table_priv = false;
|
|
||||||
} else {
|
|
||||||
$is_create_table_priv = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($dbs_where_create_table_allowed as $allowed_db) {
|
|
||||||
|
|
||||||
// if we find the exact db name, we stop here
|
|
||||||
if ($allowed_db == $db) {
|
|
||||||
$is_create_table_priv = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// '*' indicates a global CREATE priv
|
|
||||||
if ($allowed_db == '*') {
|
|
||||||
$is_create_table_priv = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ereg('%|_', $allowed_db)) {
|
|
||||||
// take care of wildcards and escaped wildcards,
|
|
||||||
// transforming them into regexp patterns
|
|
||||||
$max_position = strlen($allowed_db) - 1;
|
|
||||||
$i = 0;
|
|
||||||
$pattern = '';
|
|
||||||
while ($i <= $max_position) {
|
|
||||||
if ($allowed_db[$i] == '\\'){
|
|
||||||
if ($i < $max_position - 1 && $allowed_db[$i+1] == '_'){
|
|
||||||
$chunk = '_';
|
|
||||||
$i++;
|
|
||||||
} elseif ($i < $max_position - 1 && $allowed_db[$i+1] == '%'){
|
|
||||||
$chunk = '%';
|
|
||||||
$i++;
|
|
||||||
} else {
|
|
||||||
$chunk = $allowed_db[$i];
|
|
||||||
}
|
|
||||||
} elseif ($allowed_db[$i] == '_'){
|
|
||||||
$chunk = '.';
|
|
||||||
} elseif ($allowed_db[$i] == '%'){
|
|
||||||
$chunk = '(.)*';
|
|
||||||
} else {
|
|
||||||
$chunk = $allowed_db[$i];
|
|
||||||
}
|
|
||||||
$pattern .= $chunk;
|
|
||||||
$i++;
|
|
||||||
} // end while
|
|
||||||
unset($i, $max_position, $chunk);
|
|
||||||
|
|
||||||
$matches = '';
|
|
||||||
if (preg_match('@' .$pattern . '@i', $db, $matches)) {
|
|
||||||
if ($matches[0] == $db) {
|
|
||||||
$is_create_table_priv = TRUE;
|
|
||||||
break;
|
|
||||||
//TODO: maybe receive in $allowed_db also the db names
|
|
||||||
// on which we cannot CREATE, and check them
|
|
||||||
// in this foreach, because if a user is allowed to CREATE
|
|
||||||
// on db foo% but forbidden on db foobar, he should not
|
|
||||||
// see the Create table dialog
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // end foreach
|
|
||||||
unset($i, $max_position, $chunk, $pattern);
|
|
||||||
*/
|
|
||||||
?>
|
?>
|
||||||
<form method="post" action="tbl_create.php"
|
<form method="post" action="tbl_create.php"
|
||||||
onsubmit="return (emptyFormElements(this, 'table') && checkFormElementInRange(this, 'num_fields', '<?php echo str_replace('\'', '\\\'', $GLOBALS['strInvalidFieldCount']); ?>', 1))">
|
onsubmit="return (emptyFormElements(this, 'table') && checkFormElementInRange(this, 'num_fields', '<?php echo str_replace('\'', '\\\'', $GLOBALS['strInvalidFieldCount']); ?>', 1))">
|
||||||
@@ -110,7 +44,6 @@ if ($GLOBALS['cfg']['PropertiesIconic']) {
|
|||||||
echo sprintf($strCreateNewTable, PMA_getDbLink());
|
echo sprintf($strCreateNewTable, PMA_getDbLink());
|
||||||
?>
|
?>
|
||||||
</legend>
|
</legend>
|
||||||
<?php if ($is_create_table_priv) { ?>
|
|
||||||
<?php echo PMA_generate_common_hidden_inputs($db); ?>
|
<?php echo PMA_generate_common_hidden_inputs($db); ?>
|
||||||
<div class="formelement">
|
<div class="formelement">
|
||||||
<?php echo $strName; ?>:
|
<?php echo $strName; ?>:
|
||||||
@@ -124,8 +57,5 @@ echo sprintf($strCreateNewTable, PMA_getDbLink());
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="tblFooters">
|
<fieldset class="tblFooters">
|
||||||
<input type="submit" value="<?php echo $strGo; ?>" />
|
<input type="submit" value="<?php echo $strGo; ?>" />
|
||||||
<?php } else { ?>
|
|
||||||
<div class="error"><?php echo $strNoPrivileges; ?></div>
|
|
||||||
<?php } // end if else ?>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
@@ -106,7 +106,7 @@ if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
|
|||||||
echo '>' . htmlentities($temp_charset) . '</option>' . "\n";
|
echo '>' . htmlentities($temp_charset) . '</option>' . "\n";
|
||||||
}
|
}
|
||||||
echo ' </select><br />' . "\n" . ' ';
|
echo ' </select><br />' . "\n" . ' ';
|
||||||
} elseif (PMA_MYSQL_INT_VERSION >= 40100) {
|
} else {
|
||||||
echo '<label for="charset_of_file">' . $strCharsetOfFile . '</label>' . "\n";
|
echo '<label for="charset_of_file">' . $strCharsetOfFile . '</label>' . "\n";
|
||||||
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', 'charset_of_file', 'utf8', FALSE);
|
echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', 'charset_of_file', 'utf8', FALSE);
|
||||||
} // end if (recoding)
|
} // end if (recoding)
|
||||||
|
@@ -678,8 +678,6 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
|||||||
// 2.0.1 Prepare Display column comments if enabled ($GLOBALS['cfg']['ShowBrowseComments']).
|
// 2.0.1 Prepare Display column comments if enabled ($GLOBALS['cfg']['ShowBrowseComments']).
|
||||||
// Do not show comments, if using horizontalflipped mode, because of space usage
|
// Do not show comments, if using horizontalflipped mode, because of space usage
|
||||||
if ($GLOBALS['cfg']['ShowBrowseComments']
|
if ($GLOBALS['cfg']['ShowBrowseComments']
|
||||||
&& ($GLOBALS['cfgRelation']['commwork']
|
|
||||||
|| PMA_MYSQL_INT_VERSION >= 40100)
|
|
||||||
&& $_SESSION['userconf']['disp_direction'] != 'horizontalflipped') {
|
&& $_SESSION['userconf']['disp_direction'] != 'horizontalflipped') {
|
||||||
$comments_map = array();
|
$comments_map = array();
|
||||||
if (isset($analyzed_sql[0]) && is_array($analyzed_sql[0])) {
|
if (isset($analyzed_sql[0]) && is_array($analyzed_sql[0])) {
|
||||||
@@ -2120,16 +2118,14 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
|
|||||||
* (but see 2006-01-19 note in display_create_table.lib.php,
|
* (but see 2006-01-19 note in display_create_table.lib.php,
|
||||||
* I think we cannot detect db-specific privileges reliably)
|
* I think we cannot detect db-specific privileges reliably)
|
||||||
*/
|
*/
|
||||||
if (PMA_MYSQL_INT_VERSION >= 50000) {
|
if (!$header_shown) {
|
||||||
if (!$header_shown) {
|
echo $header;
|
||||||
echo $header;
|
$header_shown = TRUE;
|
||||||
$header_shown = TRUE;
|
|
||||||
}
|
|
||||||
echo PMA_linkOrButton(
|
|
||||||
'view_create.php' . $url_query,
|
|
||||||
PMA_getIcon('b_views.png', 'CREATE VIEW', false, true),
|
|
||||||
'', true, true, '') . "\n";
|
|
||||||
}
|
}
|
||||||
|
echo PMA_linkOrButton(
|
||||||
|
'view_create.php' . $url_query,
|
||||||
|
PMA_getIcon('b_views.png', 'CREATE VIEW', false, true),
|
||||||
|
'', true, true, '') . "\n";
|
||||||
|
|
||||||
if ($header_shown) {
|
if ($header_shown) {
|
||||||
echo '</fieldset><br />';
|
echo '</fieldset><br />';
|
||||||
|
Reference in New Issue
Block a user