itizawa 5 роки тому
батько
коміт
3175a6e10a

+ 6 - 0
src/server/routes/page.js

@@ -454,6 +454,12 @@ module.exports = function(crowi, app) {
       return res.render(`layout-${layoutName}/not_found_shared_page`);
       return res.render(`layout-${layoutName}/not_found_shared_page`);
     }
     }
 
 
+    // check if share link is expired
+    if (shareLink.createdAt.getTime() < new Date().getTime()) {
+      // page is not found
+      return res.render(`layout-${layoutName}/expired_shared_page`);
+    }
+
     const renderVars = {};
     const renderVars = {};
 
 
     renderVars.sharelink = shareLink;
     renderVars.sharelink = shareLink;

+ 13 - 0
src/server/views/layout-growi/expired_shared_page.html

@@ -0,0 +1,13 @@
+{% extends './shared_page.html' %}
+
+{% block content_header %}
+{% endblock %}
+
+{% block content_page %}
+  <div class="col-md-12">
+    <h2 class="text-muted">
+      <i class="icon-ban" aria-hidden="true"></i>
+      Page is expired
+    </h2>
+  </div>
+{% endblock %}