Changeset 687
- Timestamp:
- 07/03/07 23:55:36
(1 year ago)
- Author:
- raphael
- Message:
Fixed (really) #442: Can't create or delete mysql databases
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r684 |
r687 |
|
| 10 | 10 | | * gui: disable stats-alias in client menu | |
|---|
| 11 | 11 | \_________________________________________________________________/ |
|---|
| | 12 | |
|---|
| | 13 | 2007-07-03 Raphael Geissert |
|---|
| | 14 | - GUI: |
|---|
| | 15 | * Fixed (really) #442: Can't create or delete mysql databases |
|---|
| 12 | 16 | |
|---|
| 13 | 17 | 2007-07-01 Raphael Geissert |
|---|
| r659 |
r687 |
|
| 7 | 7 | # This program is free software; you can redistribute it and/or |
|---|
| 8 | 8 | # modify it under the terms of the MPL Mozilla Public License |
|---|
| 9 | | # as published by the Free Software Foundation; either version 1.1 |
|---|
| | 9 | # as published by the Free Software Foundation; either version 1.1 |
|---|
| 10 | 10 | # of the License, or (at your option) any later version. |
|---|
| 11 | 11 | # |
|---|
| 12 | 12 | # This program is distributed in the hope that it will be useful, |
|---|
| 13 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | 15 | # MPL Mozilla Public License for more details. |
|---|
| 16 | | # |
|---|
| | 16 | # |
|---|
| 17 | 17 | # You may have received a copy of the MPL Mozilla Public License |
|---|
| 18 | 18 | # along with this program. |
|---|
| 19 | | # |
|---|
| | 19 | # |
|---|
| 20 | 20 | # An on-line copy of the MPL Mozilla Public License can be found |
|---|
| 21 | 21 | # http://www.mozilla.org/MPL/MPL-1.1.html |
|---|
| … | … | |
| 34 | 34 | cp ./index.php $(SYSTEM_GUI_ROOT)/index.php |
|---|
| 35 | 35 | cp ./lostpassword.php $(SYSTEM_GUI_ROOT)/lostpassword.php |
|---|
| | 36 | cp ./imagecode.php $(SYSTEM_GUI_ROOT)/imagecode.php |
|---|
| 36 | 37 | cp ./robots.txt $(SYSTEM_GUI_ROOT)/robots.txt |
|---|
| 37 | 38 | cp -R ./admin $(SYSTEM_GUI_ROOT) |
|---|
| r685 |
r687 |
|
| 138 | 138 | } |
|---|
| 139 | 139 | |
|---|
| 140 | | $query = 'create database ' . $sql->QMagic($db_name); |
|---|
| | 140 | $query = 'create database ' . quoteIdentifier($db_name); |
|---|
| 141 | 141 | $rs = exec_query($sql, $query, array()); |
|---|
| 142 | 142 | |
|---|
| r682 |
r687 |
|
| 315 | 315 | // |
|---|
| 316 | 316 | $new_db_name = ereg_replace("_", "\\_", $db_name); |
|---|
| 317 | | $query = 'grant all on ?.* to ?@\'localhost\' identified by ?'; |
|---|
| 318 | | $rs = exec_query($sql, $query, array($new_db_name, $db_user, $user_pass)); |
|---|
| 319 | | $query = 'grant all on ?.* to ?@\'%\' identified by ?'; |
|---|
| 320 | | $rs = exec_query($sql, $query, array($new_db_name, $db_user, $user_pass)); |
|---|
| | 317 | $query = 'grant all on ' . quoteIdentifier($new_db_name) . '.* to ?@\'localhost\' identified by ?'; |
|---|
| | 318 | $rs = exec_query($sql, $query, array($db_user, $user_pass)); |
|---|
| | 319 | $query = 'grant all on ' . quoteIdentifier($new_db_name) . '.* to ?@\'%\' identified by ?'; |
|---|
| | 320 | $rs = exec_query($sql, $query, array($db_user, $user_pass)); |
|---|
| 321 | 321 | |
|---|
| 322 | 322 | write_log($_SESSION['user_logged'].": add SQL user: ".$db_name ); |
|---|
| r596 |
r687 |
|
| 1 | 1 | <html> |
|---|
| 2 | 2 | <head> |
|---|
| 3 | | <title>ispCP OMEGA ERROR</title> |
|---|
| | 3 | <title>ispCP OMEGA - ERROR</title> |
|---|
| 4 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
|---|
| 5 | 5 | <meta name="robots" content="noindex"> |
|---|
| r685 |
r687 |
|
| 725 | 725 | |
|---|
| 726 | 726 | $db_id = $rs -> fields['sqld_id']; |
|---|
| 727 | | $db_name = $sql->QMagic($rs->fields['sqld_name']); |
|---|
| | 727 | $db_name = quoteIdentifier($rs->fields['sqld_name']); |
|---|
| 728 | 728 | $db_user_name = $rs -> fields['sqlu_name']; |
|---|
| 729 | 729 | |
|---|
| … | … | |
| 1015 | 1015 | } |
|---|
| 1016 | 1016 | |
|---|
| 1017 | | $db_name = $sql->QMagic($rs -> fields['db_name']); |
|---|
| | 1017 | $db_name = quoteIdentifier($rs -> fields['db_name']); |
|---|
| 1018 | 1018 | |
|---|
| 1019 | 1019 | // |
|---|
| r680 |
r687 |
|
| 66 | 66 | } |
|---|
| 67 | 67 | |
|---|
| 68 | | function pg_get_record_id(&$sql, $table, $oid) { |
|---|
| | 68 | function quoteIdentifier($identifier) { |
|---|
| | 69 | global $sql; |
|---|
| 69 | 70 | |
|---|
| 70 | | $query = "select id from $table where oid = '$oid'"; |
|---|
| | 71 | $identifier = str_replace($sql->nameQuote, '\\' . $sql->nameQuote, $identifier); |
|---|
| 71 | 72 | |
|---|
| 72 | | $rs = execute_query($sql, $query); |
|---|
| 73 | | |
|---|
| 74 | | return $rs -> fields['id']; |
|---|
| 75 | | |
|---|
| | 73 | return $sql->nameQuote . $identifier . $sql->nameQuote; |
|---|
| 76 | 74 | } |
|---|
| 77 | 75 | |
|---|
| r652 |
r687 |
|
| 4 | 4 | DAEMON_DIR=$(SYSTEM_ROOT)/daemon |
|---|
| 5 | 5 | |
|---|
| 6 | | install: |
|---|
| 7 | | cd ./daemon && $(MAKE) ispcp_daemon |
|---|
| | 6 | build: |
|---|
| | 7 | (cd ./daemon; \ |
|---|
| | 8 | $(MAKE) ispcp_daemon;) |
|---|
| | 9 | touch build |
|---|
| | 10 | |
|---|
| | 11 | install: build |
|---|
| 8 | 12 | $(SYSTEM_MAKE_DIRS) $(DAEMON_DIR) |
|---|
| 9 | | cp ./daemon/ispcp_daemon $(DAEMON_DIR) |
|---|
| | 13 | cp ./daemon/ispcp_daemon $(DAEMON_DIR) |
|---|
| 10 | 14 | |
|---|
| 11 | 15 | uninstall: |
|---|
| 12 | 16 | |
|---|
| 13 | | cd ./daemon && $(MAKE) uninstall |
|---|
| | 17 | (cd ./daemon; \ |
|---|
| | 18 | $(MAKE) uninstall;) |
|---|
| 14 | 19 | rm -rf $(DAEMON_DIR) |
|---|
| | 20 | rm -rf build |
|---|
| 15 | 21 | |
|---|
| | 22 | |
|---|
| | 23 | .PHONY: install uninstall |
|---|
| r652 |
r687 |
|
| 4 | 4 | DAEMON_DIR=$(SYSTEM_ROOT)/daemon |
|---|
| 5 | 5 | |
|---|
| 6 | | install: |
|---|
| 7 | | cd ./daemon && $(MAKE) ispcp_daemon |
|---|
| | 6 | build: |
|---|
| | 7 | (cd ./daemon; \ |
|---|
| | 8 | $(MAKE) ispcp_daemon;) |
|---|
| | 9 | touch build |
|---|
| | 10 | |
|---|
| | 11 | install: build |
|---|
| 8 | 12 | $(SYSTEM_MAKE_DIRS) $(DAEMON_DIR) |
|---|
| 9 | | cp ./daemon/ispcp_daemon $(DAEMON_DIR) |
|---|
| | 13 | cp ./daemon/ispcp_daemon $(DAEMON_DIR) |
|---|
| 10 | 14 | |
|---|
| 11 | 15 | uninstall: |
|---|
| 12 | 16 | |
|---|
| 13 | | cd ./daemon && $(MAKE) uninstall |
|---|
| | 17 | (cd ./daemon; \ |
|---|
| | 18 | $(MAKE) uninstall;) |
|---|
| 14 | 19 | rm -rf $(DAEMON_DIR) |
|---|
| | 20 | rm -rf build |
|---|
| 15 | 21 | |
|---|
| 16 | 22 | .PHONY: install uninstall |
|---|
|
Download in other formats:
#########################################################################
# Site footer - Contents are automatically inserted after main Trac HTML
?>