]> 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>
Wed, 22 May 2013 11:59:07 +0000 (13:59 +0200)
lib/app.php
lib/db.php
lib/user.php

index 0a7069ca60cf1d563ef004827459490bbd0a086b..c6f6e92e60e255d67ece010cf26e432788f70da2 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 5b45f81f99885c58167d3fd3eabad4e2b0127caa..618365518331c20798c805352eb92c0e4e1a9801 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 78f5edfb5f6daf4b444ce12087dfb1ed22d41f3e..32b91c35efcd36f870342175173af69f349bb89d 100644 (file)
@@ -609,7 +609,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'));