summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Thomas Rabe <m.rabe@echtzeitraum.de>2011-10-06 22:37:06 +0200
committerMarvin Thomas Rabe <m.rabe@echtzeitraum.de>2011-10-06 22:37:06 +0200
commitbb26fe93008bd6fd5031956d654a5ab9c1950416 (patch)
tree3809d058044e993deceb14df121d05a1848f07b6
parentae56bb63c60f825136be97ddae32cc5b9cf4b062 (diff)
parentc853fc75a1db418b3c892f2e82e723b63489d35e (diff)
downloadnextcloud-server-bb26fe93008bd6fd5031956d654a5ab9c1950416.tar.gz
nextcloud-server-bb26fe93008bd6fd5031956d654a5ab9c1950416.zip
Merge commit 'refs/merge-requests/55' of git://gitorious.org/owncloud/owncloud into merge-requests/55
-rw-r--r--.gitignore5
-rw-r--r--apps/calendar/templates/settings.php73
-rw-r--r--apps/gallery/ajax/cover.php2
-rw-r--r--apps/gallery/ajax/getAlbums.php4
-rw-r--r--apps/gallery/ajax/getCovers.php2
-rw-r--r--apps/gallery/appinfo/info.xml3
-rw-r--r--apps/gallery/lib_scanner.php10
-rw-r--r--apps/remoteStorage/lib_remoteStorage.php2
8 files changed, 41 insertions, 60 deletions
diff --git a/.gitignore b/.gitignore
index ea8e5bd42fa..312dc0433aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,4 +32,7 @@ RCS/*
# netbeans
nbproject
-.DS_Store \ No newline at end of file
+# geany
+*.geany
+
+.DS_Store
diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php
index 3bfda702e9b..afc35bf7f37 100644
--- a/apps/calendar/templates/settings.php
+++ b/apps/calendar/templates/settings.php
@@ -11,57 +11,36 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
?>
<form id="calendar">
<fieldset class="personalblock">
- <table class="nostyle">
- <tr><td><label for="timezone" class="bold"><?php echo $l->t('Timezone');?></label></td><td><select style="display: none;" id="timezone" name="timezone">
+ <table class="nostyle">
+ <tr><td><label for="timezone" class="bold"><?php echo $l->t('Timezone');?></label></td><td><select style="display: none;" id="timezone" name="timezone">
<?php
- $continent = '';
- foreach($_['timezones'] as $timezone):
- if ( preg_match( '/^(America|Antartica|Arctic|Asia|Atlantic|Europe|Indian|Pacific)\//', $timezone ) ):
- $ex=explode('/', $timezone, 2);//obtain continent,city
- if ($continent!=$ex[0]):
- if ($continent!="") echo '</optgroup>';
- echo '<optgroup label="'.$ex[0].'">';
- endif;
- $city=$ex[1];
- $continent=$ex[0];
- echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
- endif;
+ $continent = '';
+ foreach($_['timezones'] as $timezone):
+ $ex=explode('/', $timezone, 2);//obtain continent,city
+ if (!isset($ex[1])) {
+ $ex[1] = $ex[0];
+ $ex[0] = "Other";
+ }
+ if ($continent!=$ex[0]):
+ if ($continent!="") echo '</optgroup>';
+ echo '<optgroup label="'.$ex[0].'">';
+ endif;
+ $city=$ex[1];
+ $continent=$ex[0];
+ echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
endforeach;?>
- </select></td></tr>
+ </select></td></tr>
- <tr><td><label for="timeformat" class="bold"><?php echo $l->t('Timeformat');?></label></td><td>
- <select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
- <option value="24" id="24h"><?php echo $l->t("24h"); ?></option>
- <option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option>
- </select>
- </td></tr>
+ <tr><td><label for="timeformat" class="bold"><?php echo $l->t('Timeformat');?></label></td><td>
+ <select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
+ <option value="24" id="24h"><?php echo $l->t("24h"); ?></option>
+ <option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option>
+ </select>
+ </td></tr>
- <tr><td><label for="firstdayofweek" class="bold"><?php echo $l->t('First day of the week');?></label></td><td>
- <select style="display: none;" id="firstdayofweek" name="firstdayofweek">
- <?php
- $weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
- for($i = 0;$i <= 6;$i++){
- echo '<option value="'.$i.'" id="select_'.$i.'">' . $l->t($weekdays[$i]) . '</option>';
- }
- ?>
- </select>
- </td></tr>
+ </table>
- <tr><td><label for="weekend" class="bold"><?php echo $l->t('Days of weekend');?></label></td><td>
- <select id="weekend" name="weekend[]" style="width: 30em;" multiple="multiple" title="<?php echo $l->t("Weekend"); ?>">
- <?php
- $weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
- for($i = 0;$i <= 6;$i++){
- echo '<option value="'.$weekdays[$i].'" id="selectweekend_' . $weekdays[$i] . '">' . $l->t($weekdays[$i]) . '</option>';
- }
- ?>
- </select>
- </td></tr>
-
- <tr><td><label for="duration" class="bold"><?php echo $l->t('Event duration');?></label></td><td><input type="text" maxlength="3" size="3" style="width: 2em;" id="duration" name="duration" /> <?php echo $l->t("Minutes");?></td></tr>
- </table>
-
- <?php echo $l->t('Calendar CalDAV syncing address:');?>
- <?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?><br />
+ <?php echo $l->t('Calendar CalDAV syncing address:');?>
+ <?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?><br />
</fieldset>
</form>
diff --git a/apps/gallery/ajax/cover.php b/apps/gallery/ajax/cover.php
index 375905ec520..44d73028510 100644
--- a/apps/gallery/ajax/cover.php
+++ b/apps/gallery/ajax/cover.php
@@ -45,7 +45,7 @@ $box_size = 200;
$album_name = $_GET['album'];
$x = $_GET['x'];
-$stmt = OC_DB::prepare('SELECT file_path FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.uid_owner = ? AND album_name = ? AND *PREFIX*gallery_photos.album_id == *PREFIX*gallery_albums.album_id');
+$stmt = OC_DB::prepare('SELECT `file_path` FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.`uid_owner` = ? AND `album_name` = ? AND *PREFIX*gallery_photos.`album_id` == *PREFIX*gallery_albums.`album_id`');
$result = $stmt->execute(array(OC_User::getUser(), $album_name));
$x = min((int)($x/($box_size/$result->numRows())), $result->numRows()-1); // get image to display
$result->seek($x); // never throws
diff --git a/apps/gallery/ajax/getAlbums.php b/apps/gallery/ajax/getAlbums.php
index 6b551ac49d5..2829dae81f3 100644
--- a/apps/gallery/ajax/getAlbums.php
+++ b/apps/gallery/ajax/getAlbums.php
@@ -7,12 +7,12 @@ if (!OC_User::IsLoggedIn()) {
}
$a = array();
-$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ?');
+$stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ?');
$result = $stmt->execute(array(OC_User::getUser()));
while ($r = $result->fetchRow()) {
$album_name = $r['album_name'];
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE album_id = ?');
+ $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ?');
$tmp_res = $stmt->execute(array($r['album_id']));
$a[] = array('name' => $album_name, 'numOfItems' => min($tmp_res->numRows(), 10));
}
diff --git a/apps/gallery/ajax/getCovers.php b/apps/gallery/ajax/getCovers.php
index d56bf6fa4b7..57737f2fdd6 100644
--- a/apps/gallery/ajax/getCovers.php
+++ b/apps/gallery/ajax/getCovers.php
@@ -46,7 +46,7 @@ if( !OC_User::isLoggedIn()){
$box_size = 200;
$album_name= $_GET['album_name'];
-$stmt = OC_DB::prepare('SELECT file_path FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.uid_owner = ? AND album_name = ? AND *PREFIX*gallery_photos.album_id == *PREFIX*gallery_albums.album_id');
+$stmt = OC_DB::prepare('SELECT `file_path` FROM *PREFIX*gallery_photos,*PREFIX*gallery_albums WHERE *PREFIX*gallery_albums.`uid_owner` = ? AND `album_name` = ? AND *PREFIX*gallery_photos.`album_id` = *PREFIX*gallery_albums.`album_id`');
$result = $stmt->execute(array(OC_User::getUser(), $album_name));
$numOfItems = min($result->numRows(),10);
diff --git a/apps/gallery/appinfo/info.xml b/apps/gallery/appinfo/info.xml
index 154b5fcf7ae..054ddb6f139 100644
--- a/apps/gallery/appinfo/info.xml
+++ b/apps/gallery/appinfo/info.xml
@@ -7,5 +7,4 @@
<author>Bartosz Przybylski</author>
<require>2</require>
<description></description>
- <default_enable/>
-</info>
+</info> \ No newline at end of file
diff --git a/apps/gallery/lib_scanner.php b/apps/gallery/lib_scanner.php
index fe14b68add1..5490c4a55ad 100644
--- a/apps/gallery/lib_scanner.php
+++ b/apps/gallery/lib_scanner.php
@@ -28,21 +28,21 @@ class OC_GALLERY_SCANNER {
}
$current_album['imagesCount'] = count($current_album['images']);
$albums[] = $current_album;
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE "uid_owner" = ? AND "album_name" = ?');
+ $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?');
$result = $stmt->execute(array(OC_User::getUser(), $current_album['name']));
if ($result->numRows() == 0 && count($current_album['images'])) {
- $stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES (?, ?)');
+ $stmt = OC_DB::prepare('REPLACE INTO *PREFIX*gallery_albums (`uid_owner`, `album_name`) VALUES (?, ?)');
$stmt->execute(array(OC_User::getUser(), $current_album['name']));
}
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE "uid_owner" = ? AND "album_name" = ?');
+ $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE `uid_owner` = ? AND `album_name` = ?');
$result = $stmt->execute(array(OC_User::getUser(), $current_album['name']));
$albumId = $result->fetchRow();
$albumId = $albumId['album_id'];
foreach ($current_album['images'] as $img) {
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE "album_id" = ? AND "file_path" = ?');
+ $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos WHERE `album_id` = ? AND `file_path` = ?');
$result = $stmt->execute(array($albumId, $img));
if ($result->numRows() == 0) {
- $stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_photos ("album_id", "file_path") VALUES (?, ?)');
+ $stmt = OC_DB::prepare('REPLACE INTO *PREFIX*gallery_photos (`album_id`, `file_path`) VALUES (?, ?)');
$stmt->execute(array($albumId, $img));
}
}
diff --git a/apps/remoteStorage/lib_remoteStorage.php b/apps/remoteStorage/lib_remoteStorage.php
index 259efb0da69..5677ab3c6e0 100644
--- a/apps/remoteStorage/lib_remoteStorage.php
+++ b/apps/remoteStorage/lib_remoteStorage.php
@@ -3,7 +3,7 @@
class OC_remoteStorage {
public static function getValidTokens($ownCloudUser, $userAddress, $dataScope) {
$query=OC_DB::prepare("SELECT token,appUrl FROM *PREFIX*authtoken WHERE user=? AND userAddress=? AND dataScope=? LIMIT 100");
- $result=$query->execute(array($user,$userAddress,$dataScope));
+ $result=$query->execute(array($ownCloudUser,$userAddress,$dataScope));
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';