use to_char only for oracle, whitespace
This commit is contained in:
parent
eceb3c8ed5
commit
cbd5eb9a1a
3 changed files with 18 additions and 9 deletions
|
@ -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);
|
||||
|
|
12
lib/db.php
12
lib/db.php
|
@ -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':
|
||||
|
|
|
@ -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'));
|
||||
|
|
Loading…
Reference in a new issue