瀏覽代碼

Avoid indexing bad accounts

Jordi Boggiano 5 年之前
父節點
當前提交
2be233e683
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/Packagist/WebBundle/Resources/views/user/profile.html.twig

+ 6 - 0
src/Packagist/WebBundle/Resources/views/user/profile.html.twig

@@ -4,6 +4,12 @@
 
 {% set isActualUser = app.user and app.user.username is same as(user.username) %}
 
+{% block head_additions %}
+    {% if user.hasRole('ROLE_SPAMMER') %}
+        <meta name="robots" content="noindex, nofollow">
+    {% endif %}
+{% endblock %}
+
 {% block content %}
 <h2 class="title">
     {{ user.username }}