summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-30 13:20:28 -0700
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-30 13:20:28 -0700
commitd3e610f589735f78737a22c4b080428e6ace3b5d (patch)
treead3121ac7bd4b8bc38ce024bb194ae042b267bd7 /apps/files_sharing
parentdc8132f3a39c687b6315616f9f9f4ed9f81245b0 (diff)
parent15e9e95817a2d58951400c8a01ffdd89a573c9b3 (diff)
downloadnextcloud-server-d3e610f589735f78737a22c4b080428e6ace3b5d.tar.gz
nextcloud-server-d3e610f589735f78737a22c4b080428e6ace3b5d.zip
Merge pull request #4225 from owncloud/better-404
More verbose 404, closes #3225
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/css/404.css12
-rw-r--r--apps/files_sharing/public.php6
-rw-r--r--apps/files_sharing/templates/part.404.php12
3 files changed, 30 insertions, 0 deletions
diff --git a/apps/files_sharing/css/404.css b/apps/files_sharing/css/404.css
new file mode 100644
index 00000000000..2ed81df3b86
--- /dev/null
+++ b/apps/files_sharing/css/404.css
@@ -0,0 +1,12 @@
+
+#body-login .error-broken-link{
+ text-align:left;color:#fff;
+}
+
+#body-login .error-broken-link ul{
+ margin:10px 0 10px 0;
+}
+
+#body-login .error-broken-link ul li{
+ list-style: disc;list-style-position:inside;cursor:default;
+}
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 3f8e29345a7..741ab145384 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -234,6 +234,12 @@ if (isset($path)) {
} else {
OCP\Util::writeLog('share', 'could not resolve linkItem', \OCP\Util::DEBUG);
}
+
+$errorTemplate = new OCP\Template('files_sharing', 'part.404', '');
+$errorContent = $errorTemplate->fetchPage();
+
header('HTTP/1.0 404 Not Found');
+OCP\Util::addStyle('files_sharing', '404');
$tmpl = new OCP\Template('', '404', 'guest');
+$tmpl->assign('content', $errorContent);
$tmpl->printPage();
diff --git a/apps/files_sharing/templates/part.404.php b/apps/files_sharing/templates/part.404.php
new file mode 100644
index 00000000000..b5152e1511a
--- /dev/null
+++ b/apps/files_sharing/templates/part.404.php
@@ -0,0 +1,12 @@
+<ul>
+ <li class="error error-broken-link">
+ <p><?php p($l->t('Sorry, this link doesn’t seem to work anymore.')) ?></p>
+ <p><?php p($l->t('Reasons might be:')); ?></p>
+ <ul>
+ <li><?php p($l->t('the item was removed')); ?></li>
+ <li><?php p($l->t('the link expired')); ?></li>
+ <li><?php p($l->t('sharing is disabled')); ?></li>
+ </ul>
+ <p><?php p($l->t('For more info, please ask the person who sent this link.')); ?></p>
+ </li>
+</ul> \ No newline at end of file