summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-12-11 23:57:59 +0100
committerRobin Appelman <icewind@owncloud.com>2012-12-11 23:57:59 +0100
commit7969d6e64617235744889df42d0e671085a779a8 (patch)
tree23733e41a7d58cb2903429e3dfb417327c39d835 /lib
parentcc0a0df88b3b6fdd2b1f9c85349683eb640f9670 (diff)
parentf7f462f2733117cc2e3be0421e7ebca85bac1562 (diff)
downloadnextcloud-server-7969d6e64617235744889df42d0e671085a779a8.tar.gz
nextcloud-server-7969d6e64617235744889df42d0e671085a779a8.zip
Merge branch 'master' into filesystem
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php8
-rw-r--r--lib/db.php25
-rw-r--r--lib/l10n/de.php2
-rw-r--r--lib/l10n/de_DE.php2
-rw-r--r--lib/l10n/gl.php18
-rw-r--r--lib/l10n/ko.php36
-rwxr-xr-xlib/util.php10
7 files changed, 55 insertions, 46 deletions
diff --git a/lib/base.php b/lib/base.php
index 5df70425d02..79d0ed87d7a 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -512,6 +512,12 @@ class OC{
require_once 'core/setup.php';
exit();
}
+ // Handle redirect URL for logged in users
+ if(isset($_REQUEST['redirect_url']) && OC_User::isLoggedIn()) {
+ $location = OC_Helper::makeURLAbsolute(urldecode($_REQUEST['redirect_url']));
+ header( 'Location: '.$location );
+ return;
+ }
// Handle WebDAV
if($_SERVER['REQUEST_METHOD']=='PROPFIND') {
header('location: '.OC_Helper::linkToRemote('webdav'));
@@ -676,7 +682,7 @@ class OC{
else {
OC_User::unsetMagicInCookie();
}
- header( 'Location: '.$_SERVER['REQUEST_URI'] );
+ OC_Util::redirectToDefaultPage();
exit();
}
return true;
diff --git a/lib/db.php b/lib/db.php
index e63a7a20c81..6524db7581a 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -20,6 +20,19 @@
*
*/
+class DatabaseException extends Exception{
+ private $query;
+
+ public function __construct($message, $query){
+ parent::__construct($message);
+ $this->query = $query;
+ }
+
+ public function getQuery(){
+ return $this->query;
+ }
+}
+
/**
* This class manages the access to the database. It basically is a wrapper for
* MDB2 with some adaptions.
@@ -320,21 +333,13 @@ class OC_DB {
// Die if we have an error (error means: bad query, not 0 results!)
if( PEAR::isError($result)) {
- $entry = 'DB Error: "'.$result->getMessage().'"<br />';
- $entry .= 'Offending command was: '.htmlentities($query).'<br />';
- OC_Log::write('core', $entry, OC_Log::FATAL);
- error_log('DB error: '.$entry);
- OC_Template::printErrorPage( $entry );
+ throw new DatabaseException($result->getMessage(), $query);
}
}else{
try{
$result=self::$connection->prepare($query);
}catch(PDOException $e) {
- $entry = 'DB Error: "'.$e->getMessage().'"<br />';
- $entry .= 'Offending command was: '.htmlentities($query).'<br />';
- OC_Log::write('core', $entry, OC_Log::FATAL);
- error_log('DB error: '.$entry);
- OC_Template::printErrorPage( $entry );
+ throw new DatabaseException($e->getMessage(), $query);
}
$result=new PDOStatementWrapper($result);
}
diff --git a/lib/l10n/de.php b/lib/l10n/de.php
index 7724d8c684f..4b77bf7210d 100644
--- a/lib/l10n/de.php
+++ b/lib/l10n/de.php
@@ -26,7 +26,7 @@
"last month" => "Letzten Monat",
"%d months ago" => "Vor %d Monaten",
"last year" => "Letztes Jahr",
-"years ago" => "Vor wenigen Jahren",
+"years ago" => "Vor Jahren",
"%s is available. Get <a href=\"%s\">more information</a>" => "%s ist verfügbar. <a href=\"%s\">Weitere Informationen</a>",
"up to date" => "aktuell",
"updates check is disabled" => "Die Update-Überprüfung ist ausgeschaltet",
diff --git a/lib/l10n/de_DE.php b/lib/l10n/de_DE.php
index 95596a7a33a..e9f0f34a0e1 100644
--- a/lib/l10n/de_DE.php
+++ b/lib/l10n/de_DE.php
@@ -26,7 +26,7 @@
"last month" => "Letzten Monat",
"%d months ago" => "Vor %d Monaten",
"last year" => "Letztes Jahr",
-"years ago" => "Vor wenigen Jahren",
+"years ago" => "Vor Jahren",
"%s is available. Get <a href=\"%s\">more information</a>" => "%s ist verfügbar. <a href=\"%s\">Weitere Informationen</a>",
"up to date" => "aktuell",
"updates check is disabled" => "Die Update-Überprüfung ist ausgeschaltet",
diff --git a/lib/l10n/gl.php b/lib/l10n/gl.php
index fd59cff02fa..1e897959e41 100644
--- a/lib/l10n/gl.php
+++ b/lib/l10n/gl.php
@@ -1,34 +1,34 @@
<?php $TRANSLATIONS = array(
"Help" => "Axuda",
-"Personal" => "Personal",
+"Personal" => "Persoal",
"Settings" => "Configuracións",
"Users" => "Usuarios",
"Apps" => "Aplicativos",
"Admin" => "Administración",
"ZIP download is turned off." => "As descargas ZIP están desactivadas",
-"Files need to be downloaded one by one." => "Os ficheiros necesitan ser descargados de un en un.",
+"Files need to be downloaded one by one." => "Os ficheiros necesitan seren descargados de un en un.",
"Back to Files" => "Volver aos ficheiros",
"Selected files too large to generate zip file." => "Os ficheiros seleccionados son demasiado grandes como para xerar un ficheiro zip.",
"Application is not enabled" => "O aplicativo non está activado",
-"Authentication error" => "Erro na autenticación",
-"Token expired. Please reload page." => "Token caducado. Recarga a páxina.",
+"Authentication error" => "Produciuse un erro na autenticación",
+"Token expired. Please reload page." => "Testemuña caducada. Recargue a páxina.",
"Files" => "Ficheiros",
"Text" => "Texto",
"Images" => "Imaxes",
"seconds ago" => "hai segundos",
"1 minute ago" => "hai 1 minuto",
"%d minutes ago" => "hai %d minutos",
-"1 hour ago" => "1 hora antes",
-"%d hours ago" => "%d horas antes",
+"1 hour ago" => "Vai 1 hora",
+"%d hours ago" => "Vai %d horas",
"today" => "hoxe",
"yesterday" => "onte",
"%d days ago" => "hai %d días",
"last month" => "último mes",
-"%d months ago" => "%d meses antes",
+"%d months ago" => "Vai %d meses",
"last year" => "último ano",
"years ago" => "anos atrás",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s está dispoñible. Obtén <a href=\"%s\">máis información</a>",
+"%s is available. Get <a href=\"%s\">more information</a>" => "%s está dispoñíbel. Obtéña <a href=\"%s\">máis información</a>",
"up to date" => "ao día",
"updates check is disabled" => "a comprobación de actualizacións está desactivada",
-"Could not find category \"%s\"" => "Non se puido atopar a categoría «%s»"
+"Could not find category \"%s\"" => "Non foi posíbel atopar a categoría «%s»"
);
diff --git a/lib/l10n/ko.php b/lib/l10n/ko.php
index 6f32e3b54ec..c4716f9f8bd 100644
--- a/lib/l10n/ko.php
+++ b/lib/l10n/ko.php
@@ -1,34 +1,34 @@
<?php $TRANSLATIONS = array(
"Help" => "도움말",
-"Personal" => "개인의",
+"Personal" => "개인",
"Settings" => "설정",
"Users" => "사용자",
-"Apps" => "어플리케이션",
+"Apps" => "앱",
"Admin" => "관리자",
-"ZIP download is turned off." => "ZIP 다운로드가 꺼졌습니다.",
-"Files need to be downloaded one by one." => "파일 차례대로 다운로드가 필요합니다.",
+"ZIP download is turned off." => "ZIP 다운로드가 비활성화되었습니다.",
+"Files need to be downloaded one by one." => "파일을 개별적으로 다운로드해야 합니다.",
"Back to Files" => "파일로 돌아가기",
-"Selected files too large to generate zip file." => "zip 파일 생성하기 위한 너무 많은 파일들이 선택되었습니다.",
-"Application is not enabled" => "응용프로그램이 사용 가능하지 않습니다.",
+"Selected files too large to generate zip file." => "선택한 파일들은 ZIP 파일을 생성하기에 너무 큽니다.",
+"Application is not enabled" => "앱이 활성화되지 않았습니다",
"Authentication error" => "인증 오류",
-"Token expired. Please reload page." => "토큰 만료. 페이지를 새로고침 해주세요.",
+"Token expired. Please reload page." => "토큰이 만료되었습니다. 페이지를 새로 고치십시오.",
"Files" => "파일",
-"Text" => "문자 번호",
+"Text" => "텍스트",
"Images" => "그림",
"seconds ago" => "초 전",
"1 minute ago" => "1분 전",
-"%d minutes ago" => "%d 분 전",
-"1 hour ago" => "1 시간 전",
-"%d hours ago" => "%d 시간 전",
+"%d minutes ago" => "%d분 전",
+"1 hour ago" => "1시간 전",
+"%d hours ago" => "%d시간 전",
"today" => "오늘",
"yesterday" => "어제",
-"%d days ago" => "%d 일 전",
+"%d days ago" => "%d일 전",
"last month" => "지난 달",
-"%d months ago" => "%d 달 전",
-"last year" => "지난 해",
-"years ago" => "작년",
-"%s is available. Get <a href=\"%s\">more information</a>" => "%s은 가능합니다. 더 자세한 정보는 <a href=\"%s\">이곳</a>으로..",
+"%d months ago" => "%d개월 전",
+"last year" => "작년",
+"years ago" => "년 전",
+"%s is available. Get <a href=\"%s\">more information</a>" => "%s을(를) 사용할 수 있습니다. <a href=\"%s\">자세한 정보 보기</a>",
"up to date" => "최신",
-"updates check is disabled" => "업데이트 확인이 비활성화 되어있습니다.",
-"Could not find category \"%s\"" => "\"%s\" 카테고리를 찾을 수 없습니다."
+"updates check is disabled" => "업데이트 확인이 비활성화됨",
+"Could not find category \"%s\"" => "분류 \"%s\"을(를) 찾을 수 없습니다."
);
diff --git a/lib/util.php b/lib/util.php
index 4a434114480..7cbac3a572b 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -320,10 +320,8 @@ class OC_Util {
}
if (isset($_REQUEST['redirect_url'])) {
$redirect_url = OC_Util::sanitizeHTML($_REQUEST['redirect_url']);
- } else {
- $redirect_url = $_SERVER['REQUEST_URI'];
- }
- $parameters['redirect_url'] = $redirect_url;
+ $parameters['redirect_url'] = urlencode($redirect_url);
+ }
OC_Template::printGuestPage("", "login", $parameters);
}
@@ -419,8 +417,8 @@ class OC_Util {
* Redirect to the user default page
*/
public static function redirectToDefaultPage() {
- if(isset($_REQUEST['redirect_url']) && (substr($_REQUEST['redirect_url'], 0, strlen(OC::$WEBROOT)) == OC::$WEBROOT || $_REQUEST['redirect_url'][0] == '/')) {
- $location = $_REQUEST['redirect_url'];
+ if(isset($_REQUEST['redirect_url'])) {
+ $location = OC_Helper::makeURLAbsolute(urldecode($_REQUEST['redirect_url']));
}
else if (isset(OC::$REQUESTEDAPP) && !empty(OC::$REQUESTEDAPP)) {
$location = OC_Helper::linkToAbsolute( OC::$REQUESTEDAPP, 'index.php' );