]> source.dussan.org Git - nextcloud-server.git/commitdiff
use to_char only for oracle, whitespace
authorJörn Friedrich Dreyer <jfd@butonic.de>
Wed, 8 May 2013 14:18:24 +0000 (16:18 +0200)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Fri, 14 Jun 2013 11:16:02 +0000 (13:16 +0200)
lib/app.php
lib/db.php
lib/user.php

index 811d6e4675e51fa9b4382974041e87f38800d669..889d135d7db11511662a018ff401197fb3e5f596 100644 (file)
@@ -172,8 +172,13 @@ class OC_App{
                        return array();
                }
                $apps=array('files');
-               $query = OC_DB::prepare( 'SELECT `appid` FROM `*PREFIX*appconfig`'
-                       .' WHERE `configkey` = \'enabled\' AND to_char(`configvalue`)=\'yes\'' );
+               $sql = 'SELECT `appid` FROM `*PREFIX*appconfig`'
+                       .' WHERE `configkey` = \'enabled\' AND `configvalue`=\'yes\'';
+               if (OC_Config::getValue( 'dbtype', 'sqlite' ) === 'oci') { //FIXME oracle hack
+                       $sql = 'SELECT `appid` FROM `*PREFIX*appconfig`'
+                       .' WHERE `configkey` = \'enabled\' AND to_char(`configvalue`)=\'yes\'';
+               }
+               $query = OC_DB::prepare( $sql );
                $result=$query->execute();
                if( \OC_DB::isError($result)) {
                        throw new DatabaseException($result->getMessage(), $query);
index 013351fcdcfcb1166c3e60270ff6844f13dc0162..7c75dc6786825eff1906cf033e5c5aed9101275d 100644 (file)
@@ -273,12 +273,12 @@ class OC_DB {
                                        break;
                                case 'oci':
                                        $dsn = array(
-                                                       'phptype'  => 'oci8',
-                                                       'username' => $user,
-                                                       'password' => $pass,
-                                                       'service'  => $name,
-                                                       'hostspec' => $host,
-                                                       'charset' => 'AL32UTF8',
+                                               'phptype'  => 'oci8',
+                                               'username' => $user,
+                                               'password' => $pass,
+                                               'service'  => $name,
+                                               'hostspec' => $host,
+                                               'charset' => 'AL32UTF8',
                                        );
                                        break;
                                case 'mssql':
index 64aff3d9373fec580acc453031365b73aad1ad40..1743a4af8f217285c758a92ed6ef7f2f889ea79c 100644 (file)
@@ -610,7 +610,11 @@ class OC_User {
         */
        public static function isEnabled($userid) {
                $sql = 'SELECT `userid` FROM `*PREFIX*preferences`'
-                       .' WHERE `userid` = ? AND `appid` = ? AND `configkey` = ? AND to_char(`configvalue`) = ?';
+                       .' WHERE `userid` = ? AND `appid` = ? AND `configkey` = ? AND `configvalue` = ?';
+               if (OC_Config::getValue( 'dbtype', 'sqlite' ) === 'oci') { //FIXME oracle hack
+                       $sql = 'SELECT `userid` FROM `*PREFIX*preferences`'
+                               .' WHERE `userid` = ? AND `appid` = ? AND `configkey` = ? AND to_char(`configvalue`) = ?';
+               }
                $stmt = OC_DB::prepare($sql);
                if ( ! OC_DB::isError($stmt) ) {
                        $result = $stmt->execute(array($userid, 'core', 'enabled', 'false'));