зеркало из https://github.com/mozilla/pjs.git
Added install.php support, modified install.js to work in prod. Fixed footers to have disclaimer. Added support page link to from disclaimer.
This commit is contained in:
Родитель
411ab49ef4
Коммит
85a5a1f649
|
@ -440,3 +440,12 @@
|
|||
#comments-sort {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.disclaimer {
|
||||
text-align: center;
|
||||
color: #ccc;
|
||||
font-size: x-small;
|
||||
width: 600px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
/**
|
||||
* Install script to log downloads.
|
||||
* @package amo
|
||||
* @subpackage docs
|
||||
*/
|
||||
require_once('includes.php');
|
||||
|
||||
$uri = mysql_real_escape_string(str_replace(" ","+",$_GET["uri"]));
|
||||
$db->query("
|
||||
SELECT
|
||||
vid,
|
||||
m.id,
|
||||
uri
|
||||
FROM version v
|
||||
INNER JOIN main m ON m.id=v.id
|
||||
WHERE
|
||||
uri='$uri'
|
||||
LIMIT
|
||||
1
|
||||
", SQL_INIT, SQL_ASSOC);
|
||||
|
||||
if (empty($db->record)) {
|
||||
echo 'nope';
|
||||
exit;
|
||||
} else {
|
||||
$row=$db->record;
|
||||
$uri=$row['uri'];
|
||||
$id = $row['id'];
|
||||
$vid = $row['vid'];
|
||||
}
|
||||
|
||||
//Are we behind a proxy and given the IP via an alternate enviroment variable? If so, use it.
|
||||
if (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
|
||||
$remote_addr = mysql_real_escape_string($_SERVER["HTTP_X_FORWARDED_FOR"]);
|
||||
} else {
|
||||
$remote_addr = mysql_real_escape_string($_SERVER["REMOTE_ADDR"]);
|
||||
}
|
||||
|
||||
// Clean the user agent string.
|
||||
$http_user_agent = mysql_real_escape_string($_SERVER['HTTP_USER_AGENT']);
|
||||
|
||||
// Rate limit set to 10 minutes.
|
||||
$sql = "
|
||||
SELECT
|
||||
did
|
||||
FROM
|
||||
downloads
|
||||
WHERE
|
||||
id='$id' AND
|
||||
vid='$vid' AND
|
||||
user_ip='$remote_addr' AND
|
||||
user_agent='$http_user_agent' AND
|
||||
date>DATE_SUB(NOW(), INTERVAL 10 MINUTE)
|
||||
LIMIT
|
||||
1
|
||||
";
|
||||
$db->query($sql,SQL_INIT,SQL_ASSOC);
|
||||
|
||||
if (empty($db->record)) {
|
||||
$db->query("
|
||||
INSERT INTO
|
||||
downloads (ID, date, vID, user_ip, user_agent)
|
||||
VALUES
|
||||
('${id}',NOW(),'{$vid}', '{$remote_addr}', '{$http_user_agent}')
|
||||
",SQL_NONE);
|
||||
}
|
||||
|
||||
header('Location: '.$uri);
|
||||
exit;
|
||||
?>
|
|
@ -32,16 +32,36 @@ function getPlatformName()
|
|||
}
|
||||
|
||||
function install( aEvent, extName, iconURL) {
|
||||
var p = new XMLHttpRequest();
|
||||
p.open("GET", "/core/install.php?uri="+aEvent.target.href, false);
|
||||
p.send(null);
|
||||
|
||||
var params = new Array();
|
||||
params[extName] = {
|
||||
URL: aEvent.target.href,
|
||||
IconURL: iconURL,
|
||||
toString: function () { return this.URL; }
|
||||
};
|
||||
InstallTrigger.install(params);
|
||||
if (aEvent.target.href.match(/^.+\.xpi$/)) {
|
||||
|
||||
var params = new Array();
|
||||
|
||||
params[extName] = {
|
||||
URL: aEvent.target.href,
|
||||
IconURL: iconURL,
|
||||
toString: function () { return this.URL; }
|
||||
};
|
||||
|
||||
InstallTrigger.install(params);
|
||||
|
||||
try {
|
||||
var p = new XMLHttpRequest();
|
||||
p.open("GET", "/install.php?uri="+aEvent.target.href, true);
|
||||
p.send(null);
|
||||
} catch(e) { }
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function installTheme( aEvent, extName) {
|
||||
InstallTrigger.installChrome(InstallTrigger.SKIN,aEvent.target.href,extName);
|
||||
|
||||
try {
|
||||
var p = new XMLHttpRequest();
|
||||
p.open("GET", "/install.php?uri="+aEvent.target.href, true);
|
||||
p.send(null);
|
||||
} catch(e) { }
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
/**
|
||||
* Support page.
|
||||
* @package amo
|
||||
* @subpackage docs
|
||||
*/
|
||||
startProcessing('support.tpl',$memcacheId,$compileId,'nonav');
|
||||
$tpl->assign(
|
||||
array( 'title' => 'Support',
|
||||
'content' => 'support.tpl')
|
||||
);
|
||||
?>
|
|
@ -16,5 +16,9 @@
|
|||
</div>
|
||||
<!-- close container -->
|
||||
|
||||
<div class="disclaimer">
|
||||
Mozilla is providing links to these applications as a courtesy, and makes no representations regarding the applications or any information related thereto. Any questions, complaints or claims regarding the applications must be directed to the appropriate software vendor. See our <a href="{$config.webpath}/support.php">Support Page</a> for support information and contacts.
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -11,5 +11,9 @@
|
|||
</div>
|
||||
<!-- close container -->
|
||||
|
||||
<div class="disclaimer">
|
||||
Mozilla is providing links to these applications as a courtesy, and makes no representations regarding the applications or any information related thereto. Any questions, complaints or claims regarding the applications must be directed to the appropriate software vendor. See our <a href="{$config.webpath}/support.php">Support Page</a> for support information and contacts.
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<div id="mBody">
|
||||
<h1>Support</h1>
|
||||
|
||||
<p>This is a list of different ways to get support for Mozilla Add-ons, which includes Themes and Extensions.</p>
|
||||
|
||||
<dl>
|
||||
<dt><a href="http://forums.mozillazine.org/">MozillaZine Forums</a></dt>
|
||||
<dd>People in the MozillaZine forums are often helpful and know a lot about Mozilla Add-ons.</dd>
|
||||
|
||||
<dt>IRC Chat</dt>
|
||||
<dd>IRC is probably the best way to find support. You should find people who can help in <b>#umo</b> or <b>#firefox</b> on <b>irc.mozilla.org</b>. If you don't have an IRC client, you can use <a href="<?=WEB_PATH?>/extensions/moreinfo.php?id=16&application=firefox">ChatZilla</a>.</dd>
|
||||
|
||||
<dt><a href="http://developer.mozilla.org/en/docs/Extensions">developer.mozilla.org (DevMo) Extensions Page</a></dt>
|
||||
<dd>Extensions developers can look for documentation on how to create their own extensions here.</dd>
|
||||
|
||||
<dt><a href="http://developer.mozilla.org/en/docs/Themes">DevMo Themes Page</a></dt>
|
||||
<dd>Theme designers interesting in making themes for Mozilla applications should read this document.</dd>
|
||||
|
||||
<dt><a href="http://mozilla.org/support/">Mozilla Product Support</a></dt>
|
||||
<dd>For support on one of the Mozilla applications themeselves, please visit this page.</dd>
|
||||
|
||||
<dt><a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Update">File a Bug in Bugzilla</a></dt>
|
||||
<dd>To file a bug regarding an major error in an extension or theme, or to report a problem with this website, please file a bug in Bugzilla to make sure it gets tracked properly.</dd>
|
||||
</dl>
|
||||
|
||||
</div>
|
Загрузка…
Ссылка в новой задаче