use to_char only for oracle, whitespace
This commit is contained in:
parent
eceb3c8ed5
commit
cbd5eb9a1a
|
@ -172,8 +172,13 @@ class OC_App{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
$apps=array('files');
|
$apps=array('files');
|
||||||
$query = OC_DB::prepare( 'SELECT `appid` FROM `*PREFIX*appconfig`'
|
$sql = 'SELECT `appid` FROM `*PREFIX*appconfig`'
|
||||||
.' WHERE `configkey` = \'enabled\' AND to_char(`configvalue`)=\'yes\'' );
|
.' 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();
|
$result=$query->execute();
|
||||||
if( \OC_DB::isError($result)) {
|
if( \OC_DB::isError($result)) {
|
||||||
throw new DatabaseException($result->getMessage(), $query);
|
throw new DatabaseException($result->getMessage(), $query);
|
||||||
|
|
12
lib/db.php
12
lib/db.php
|
@ -273,12 +273,12 @@ class OC_DB {
|
||||||
break;
|
break;
|
||||||
case 'oci':
|
case 'oci':
|
||||||
$dsn = array(
|
$dsn = array(
|
||||||
'phptype' => 'oci8',
|
'phptype' => 'oci8',
|
||||||
'username' => $user,
|
'username' => $user,
|
||||||
'password' => $pass,
|
'password' => $pass,
|
||||||
'service' => $name,
|
'service' => $name,
|
||||||
'hostspec' => $host,
|
'hostspec' => $host,
|
||||||
'charset' => 'AL32UTF8',
|
'charset' => 'AL32UTF8',
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'mssql':
|
case 'mssql':
|
||||||
|
|
|
@ -609,7 +609,11 @@ class OC_User {
|
||||||
*/
|
*/
|
||||||
public static function isEnabled($userid) {
|
public static function isEnabled($userid) {
|
||||||
$sql = 'SELECT `userid` FROM `*PREFIX*preferences`'
|
$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);
|
$stmt = OC_DB::prepare($sql);
|
||||||
if ( ! OC_DB::isError($stmt) ) {
|
if ( ! OC_DB::isError($stmt) ) {
|
||||||
$result = $stmt->execute(array($userid, 'core', 'enabled', 'false'));
|
$result = $stmt->execute(array($userid, 'core', 'enabled', 'false'));
|
||||||
|
|
Loading…
Reference in New Issue