Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2013-10-07 05:08:56 +0400
committermattab <matthieu.aubry@gmail.com>2013-10-07 05:08:56 +0400
commit9d4e91ee598fa2b19cfc21acac18cb45d8702e39 (patch)
tree687c104e92628ab0ebfed526bb97b4a32c92f597 /plugins
parentcb26fffe12b9b61a53240a8935f1b0ee6a94f1a8 (diff)
Refactoring + improve Trusted Host message
Diffstat (limited to 'plugins')
-rw-r--r--plugins/CoreAdminHome/templates/generalSettings.twig12
-rw-r--r--plugins/CoreHome/templates/_warningInvalidHost.twig10
-rw-r--r--plugins/CorePluginsAdmin/PluginInstaller.php5
-rw-r--r--plugins/Login/templates/login.twig9
-rw-r--r--plugins/Zeitgeist/templates/_iframeBuster.twig12
5 files changed, 25 insertions, 23 deletions
diff --git a/plugins/CoreAdminHome/templates/generalSettings.twig b/plugins/CoreAdminHome/templates/generalSettings.twig
index 15df9d9b08..1ed5b826a1 100644
--- a/plugins/CoreAdminHome/templates/generalSettings.twig
+++ b/plugins/CoreAdminHome/templates/generalSettings.twig
@@ -159,15 +159,9 @@
</div>
<h2 id="trustedHostsSection">{{ 'CoreAdminHome_TrustedHostSettings'|translate }}</h2>
<div id='trustedHostSettings'>
- {# untrusted host warning (display again) #}
- {% if isValidHost is defined and invalidHostMessage is defined and not isValidHost %}
- <div class="ajaxSuccess">
- <a style="float:right;" href="http://piwik.org/faq/troubleshooting/#faq_171" target="_blank">
- <img src="plugins/Zeitgeist/images/help_grey.png"/>
- </a>
- <strong>{{ 'General_Warning'|translate }}:&nbsp;</strong>{{ invalidHostMessage }}
- </div>
- {% endif %}
+
+ {% include "@CoreHome/_warningInvalidHost.twig" %}
+
{% if trustedHosts|length == 1 and (isValidHost is not defined or isValidHost) %}
{{ 'CoreAdminHome_PiwikIsInstalledAt'|translate }}:&nbsp;&nbsp;
<input name="trusted_host" type="text" value="{{ trustedHosts[0] }}"/>
diff --git a/plugins/CoreHome/templates/_warningInvalidHost.twig b/plugins/CoreHome/templates/_warningInvalidHost.twig
index 8251874e27..2e77d9605b 100644
--- a/plugins/CoreHome/templates/_warningInvalidHost.twig
+++ b/plugins/CoreHome/templates/_warningInvalidHost.twig
@@ -2,7 +2,15 @@
{% if (isValidHost is defined and invalidHostMessage is defined and isValidHost == false) %}
<div class="ajaxSuccess" style="clear:both;width:800px;">
<a style="float:right;" href="http://piwik.org/faq/troubleshooting/#faq_171" target="_blank"><img src="plugins/Zeitgeist/images/help_grey.png"/></a>
- <strong>{{ 'General_Warning'|translate }}:&nbsp;</strong>{{ invalidHostMessage }}
+ <strong>{{ 'General_Warning'|translate }}:&nbsp;</strong>{{ invalidHostMessage|raw }}
+
+ <br><hr>
+
+ <small>{{ invalidHostMessageHowToFix|raw }}
+ <br/><br/><a style="float:right;" href="http://piwik.org/faq/troubleshooting/#faq_171" target="_blank">{{ 'General_Help'|translate }}
+ <img style="vertical-align: bottom;" src="plugins/Zeitgeist/images/help_grey.png"/></a><br/>
+ </small>
</div>
+
{% endif %}
diff --git a/plugins/CorePluginsAdmin/PluginInstaller.php b/plugins/CorePluginsAdmin/PluginInstaller.php
index d284ff75c8..849b910e21 100644
--- a/plugins/CorePluginsAdmin/PluginInstaller.php
+++ b/plugins/CorePluginsAdmin/PluginInstaller.php
@@ -142,6 +142,11 @@ class PluginInstaller
throw new PluginInstallerException('Plugin is not valid, the plugin.json file does not specify the plugin name.');
}
+ if (!preg_match('/^[a-zA-Z0-9_-]+$/', $metadata->name)) {
+ throw new PluginInstallerException('The plugin name specified in plugin.json contains illegal characters. ' .
+ 'Plugin name can only contain following characters: [a-zA-Z0-9-_].');
+ }
+
if (empty($metadata->version)) {
throw new PluginInstallerException('Plugin is not valid, the plugin.json file does not specify the plugin version.');
}
diff --git a/plugins/Login/templates/login.twig b/plugins/Login/templates/login.twig
index 8cdc70973d..d3c7a43614 100644
--- a/plugins/Login/templates/login.twig
+++ b/plugins/Login/templates/login.twig
@@ -73,14 +73,7 @@
{# untrusted host warning #}
{% if (isValidHost is defined and invalidHostMessage is defined and isValidHost == false) %}
- <div class="message_error">
- <strong>{{ 'General_Warning'|translate }}:&nbsp;</strong>{{ invalidHostMessage }}
-
- <br><br>{{ invalidHostMessageHowToFix }}
- <br/><br/><a style="float:right;" href="http://piwik.org/faq/troubleshooting/#faq_171"
- target="_blank">{{ 'General_Help'|translate }}
- <img style="vertical-align: bottom;" src="plugins/Zeitgeist/images/help_grey.png"/></a><br/>
- </div>
+ {% include '@CoreHome/_warningInvalidHost.twig' %}
{% else %}
<div id="message_container">
{% if form_data.errors %}
diff --git a/plugins/Zeitgeist/templates/_iframeBuster.twig b/plugins/Zeitgeist/templates/_iframeBuster.twig
index d5bfd4f5d8..b7c1b3784b 100644
--- a/plugins/Zeitgeist/templates/_iframeBuster.twig
+++ b/plugins/Zeitgeist/templates/_iframeBuster.twig
@@ -1,9 +1,11 @@
{% if (enableFrames is defined and enableFrames == false) %}
<script type="text/javascript">
- $('body').css("display", "none");
- if (self == top) {
- var theBody = document.getElementsByTagName('body')[0];
- theBody.style.display = 'block';
- } else { top.location = self.location; }
+ $(function () {
+ $('body').css("display", "none");
+ if (self == top) {
+ var theBody = document.getElementsByTagName('body')[0];
+ theBody.style.display = 'block';
+ } else { top.location = self.location; }
+ });
</script>
{% endif %} \ No newline at end of file