Changeset 687

Show
Ignore:
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
  • trunk/CHANGELOG

    r684 r687  
    1010|               * gui: disable stats-alias in client menu         | 
    1111\_________________________________________________________________/ 
     12 
     132007-07-03 Raphael Geissert 
     14        - GUI: 
     15                * Fixed (really) #442: Can't create or delete mysql databases 
    1216 
    13172007-07-01 Raphael Geissert 
  • trunk/gui/BSDmakefile

    r659 r687  
    77#    This program is free software; you can redistribute it and/or 
    88#    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 
    1010#    of the License, or (at your option) any later version. 
    1111# 
    1212#    This program is distributed in the hope that it will be useful, 
    1313#    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 
    1515#    MPL Mozilla Public License for more details. 
    16 #     
     16# 
    1717#    You may have received a copy of the MPL Mozilla Public License 
    1818#    along with this program. 
    19 #     
     19# 
    2020#    An on-line copy of the MPL Mozilla Public License can be found 
    2121#    http://www.mozilla.org/MPL/MPL-1.1.html 
     
    3434        cp ./index.php $(SYSTEM_GUI_ROOT)/index.php 
    3535        cp ./lostpassword.php $(SYSTEM_GUI_ROOT)/lostpassword.php 
     36        cp ./imagecode.php $(SYSTEM_GUI_ROOT)/imagecode.php 
    3637        cp ./robots.txt $(SYSTEM_GUI_ROOT)/robots.txt 
    3738        cp -R ./admin $(SYSTEM_GUI_ROOT) 
  • trunk/gui/client/add_sql_database.php

    r685 r687  
    138138  } 
    139139 
    140   $query = 'create database ' . $sql->QMagic($db_name); 
     140  $query = 'create database ' . quoteIdentifier($db_name); 
    141141  $rs = exec_query($sql, $query, array()); 
    142142 
  • trunk/gui/client/sql_add_user.php

    r682 r687  
    315315  // 
    316316  $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)); 
    321321 
    322322  write_log($_SESSION['user_logged'].": add SQL user: ".$db_name ); 
  • trunk/gui/errordocs/index.php

    r596 r687  
    11<html> 
    22 <head> 
    3   <title>ispCP OMEGA ERROR</title> 
     3  <title>ispCP OMEGA - ERROR</title> 
    44  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    55  <meta name="robots" content="noindex"> 
  • trunk/gui/include/client-functions.php

    r685 r687  
    725725 
    726726        $db_id = $rs -> fields['sqld_id']; 
    727         $db_name = $sql->QMagic($rs->fields['sqld_name']); 
     727        $db_name = quoteIdentifier($rs->fields['sqld_name']); 
    728728        $db_user_name = $rs -> fields['sqlu_name']; 
    729729 
     
    10151015  } 
    10161016 
    1017     $db_name = $sql->QMagic($rs -> fields['db_name']); 
     1017    $db_name = quoteIdentifier($rs -> fields['db_name']); 
    10181018 
    10191019    // 
  • trunk/gui/include/sql.php

    r680 r687  
    6666} 
    6767 
    68 function pg_get_record_id(&$sql, $table, $oid) { 
     68function quoteIdentifier($identifier) { 
     69    global $sql; 
    6970 
    70   $query = "select id from $table where oid = '$oid'"
     71    $identifier = str_replace($sql->nameQuote, '\\' . $sql->nameQuote, $identifier)
    7172 
    72   $rs = execute_query($sql, $query); 
    73  
    74   return $rs -> fields['id']; 
    75  
     73    return $sql->nameQuote . $identifier . $sql->nameQuote; 
    7674} 
    7775 
  • trunk/tools/BSDmakefile

    r652 r687  
    44DAEMON_DIR=$(SYSTEM_ROOT)/daemon 
    55 
    6 install: 
    7         cd ./daemon && $(MAKE) ispcp_daemon 
     6build: 
     7    (cd ./daemon; \ 
     8    $(MAKE) ispcp_daemon;) 
     9    touch build 
     10 
     11install: build 
    812        $(SYSTEM_MAKE_DIRS) $(DAEMON_DIR) 
    9         cp ./daemon/ispcp_daemon $(DAEMON_DIR)  
     13        cp ./daemon/ispcp_daemon $(DAEMON_DIR) 
    1014 
    1115uninstall: 
    1216 
    13         cd ./daemon && $(MAKE) uninstall 
     17        (cd ./daemon; \ 
     18        $(MAKE) uninstall;) 
    1419        rm -rf $(DAEMON_DIR) 
     20        rm -rf build 
    1521 
     22 
     23.PHONY: install uninstall 
  • trunk/tools/Makefile

    r652 r687  
    44DAEMON_DIR=$(SYSTEM_ROOT)/daemon 
    55 
    6 install: 
    7         cd ./daemon && $(MAKE) ispcp_daemon 
     6build: 
     7    (cd ./daemon; \ 
     8    $(MAKE) ispcp_daemon;) 
     9    touch build 
     10 
     11install: build 
    812        $(SYSTEM_MAKE_DIRS) $(DAEMON_DIR) 
    9         cp ./daemon/ispcp_daemon $(DAEMON_DIR)  
     13        cp ./daemon/ispcp_daemon $(DAEMON_DIR) 
    1014 
    1115uninstall: 
    1216 
    13         cd ./daemon && $(MAKE) uninstall 
     17        (cd ./daemon; \ 
     18        $(MAKE) uninstall;) 
    1419        rm -rf $(DAEMON_DIR) 
     20        rm -rf build 
    1521 
    1622.PHONY: install uninstall