From f5c414995cad79370c30711c74ef1a2bcc5b0d0a Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Sun, 28 Feb 2010 02:35:05 -0500 Subject: [PATCH] Add runtime configuration for the AWS keyid and secret. --- player/config.php | 18 ++++++++++++++++-- player/metadata.php | 4 +++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/player/config.php b/player/config.php index da8e021..2a08889 100644 --- a/player/config.php +++ b/player/config.php @@ -104,7 +104,8 @@ } if(isset($_POST['submit'])) { $vars = array( 'mpd_host', 'mpd_port', 'mpd_pass', 'login_pass', 'update_delay', - 'metadata_disable', 'theme', 'stop_button', 'shout_url', 'pagination', 'lang'); + 'metadata_disable', 'theme', 'stop_button', 'shout_url', 'pagination', 'lang', + 'aws_keyid', 'aws_secret'); foreach ($vars as $var) { $add = ""; if(isset($_POST[$var])&&trim($_POST[$var])!="") @@ -120,6 +121,10 @@ continue; $add = generate_hash($add); } + else if ($var=='aws_secret') { + if ($add == HASH_PASS) + continue; + } if(isset($config->$var)) { @@ -265,9 +270,18 @@ for($i=0; $i<$length;$i++) {  

Metadata

-

+

visit aws.amazon.com. ". + "Then, get an access key, and fill in the details below."); ?>

+ +
name='metadata_disable' />
' name='aws_keyid' />
' name='aws_secret' />

diff --git a/player/metadata.php b/player/metadata.php index 41e3e9c..93d8871 100644 --- a/player/metadata.php +++ b/player/metadata.php @@ -28,7 +28,9 @@ function amazonlink($params) { $params["SubscriptionId"] = "15BH771NY941TX2NKC02"; - $res = aws_signed_request("com", $params, "Access Key ID", "Secret Access Key"); + if (strlen(get_config("aws_secret")) == 0) + return False; + $res = aws_signed_request("com", $params, get_config("aws_keyid"), get_config("aws_secret")); return $res; } -- 2.39.2