]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow apps to have own 404 content, closes #3225
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>
Mon, 29 Jul 2013 13:33:23 +0000 (16:33 +0300)
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>
Mon, 29 Jul 2013 13:54:19 +0000 (16:54 +0300)
apps/files_sharing/public.php
apps/files_sharing/templates/part.404.php [new file with mode: 0644]
core/css/styles.css
core/templates/404.php

index 3f8e29345a7f2e0118986a6afe4a66f2ed90537c..6878109f7b987e29c5da7a3df8757a7792777ad2 100644 (file)
@@ -234,6 +234,11 @@ 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');
 $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 (file)
index 0000000..400dd6b
--- /dev/null
@@ -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 for this ownCloud')); ?></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
index 0dd66fb5b7c3ae3eb07ad40b5622bec63ad3c62d..1e2ce3862a32808448f5313a3ef844ed3bc8bf60 100644 (file)
@@ -304,6 +304,18 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; }
 #body-login form .errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 2em; padding:1em; }
 #body-login .success { background:#d7fed7; border:1px solid #0f0; width: 35%; margin: 30px auto; padding:1em; text-align: center;}
 
+#body-login .error-broken-link{
+ text-align:left;
+}
+
+#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;    
+}
+
 /* Show password toggle */
 #show, #dbpassword {
        position: absolute;
index ee17f0de8e1957c5b66335010ee163005a52409a..bf1e03e6bc9852acb23bda8f7824c66a891efeb5 100644 (file)
@@ -7,9 +7,13 @@ if(!isset($_)) {//also provide standalone error page
        exit;
 }
 ?>
-<ul>
-       <li class='error'>
-               <?php p($l->t( 'Cloud not found' )); ?><br/>
-               <p class='hint'><?php if(isset($_['file'])) p($_['file'])?></p>
-       </li>
-</ul>
+<?php if (isset($_['content'])): ?>
+       <?php print_unescaped($_['content']) ?>
+<?php else: ?>
+       <ul>
+               <li class="error">
+                       <?php p($l->t( 'Cloud not found' )); ?><br/>
+                       <p class='hint'><?php if(isset($_['file'])) p($_['file'])?></p>
+               </li>
+       </ul>
+<?php endif; ?>