]> Joshua Wise's Git repositories - patchfork.git/blobdiff - player/config.php
Make config page refuse to allow you to select the mini theme (it should only be...
[patchfork.git] / player / config.php
index da8e02134404cd76283dbc3d93fbd44ca018a80c..748156cf8e6166ded6671246fd209e6be22ae08d 100644 (file)
@@ -46,6 +46,7 @@
        @ob_start();
        require_once("../inc/base.php");
        require_once("../lang/master.php");
        @ob_start();
        require_once("../inc/base.php");
        require_once("../lang/master.php");
+       header("Content-Type: text/html; charset=UTF-8");
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html>
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html>
        }
        if(isset($_POST['submit'])) {
                $vars = array( 'mpd_host', 'mpd_port', 'mpd_pass', 'login_pass', 'update_delay', 
        }
        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])!="") 
                foreach ($vars as $var) {
                        $add = "";
                        if(isset($_POST[$var])&&trim($_POST[$var])!="") 
                                        continue;
                                $add = generate_hash($add);
                        }
                                        continue;
                                $add = generate_hash($add);
                        }
+                       else if ($var=='aws_secret') {
+                               if ($add == HASH_PASS)
+                                       continue;
+                       }
 
                        
                        if(isset($config->$var)) {
 
                        
                        if(isset($config->$var)) {
 $themes = get_available_themes();
 $ctheme = get_config("theme", "default");
 foreach($themes as $theme) {
 $themes = get_available_themes();
 $ctheme = get_config("theme", "default");
 foreach($themes as $theme) {
+       if ($theme == "mini")
+               continue;
        echo "\n<option value='$theme' ";
        if($theme==$ctheme)
                echo "selected='selected' ";
        echo "\n<option value='$theme' ";
        if($theme==$ctheme)
                echo "selected='selected' ";
@@ -265,9 +273,18 @@ for($i=0; $i<$length;$i++) {
 <tr><td>&nbsp;</td><td><input type='checkbox' disabled='disabled' checked='checked' id='tnode_2' /> <label for='tnode_2'> Time</label></td></tr>
 </table>
 <h2>Metadata</h2>
 <tr><td>&nbsp;</td><td><input type='checkbox' disabled='disabled' checked='checked' id='tnode_2' /> <label for='tnode_2'> Time</label></td></tr>
 </table>
 <h2>Metadata</h2>
-<p><?php echo m("Configuration for retrieving metadata. This requires that the machine pitchfork is running on can access the internet."); ?></p>
+<p><?php echo m("Configuration for retrieving metadata. This requires that the machine Patchfork is running on can access the internet. ".
+                "In order to use this feature, you must now have an Amazon AWS account; to get one, <a href=\"http://aws.amazon.com\">visit aws.amazon.com</a>. ".
+                "Then, get an <a href=\"https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key\">access key</a>, and fill in the details below."); ?></p>
 <table>
 <tr><td><?php echo m("Disable metadata:"); ?> </td><td><input type='checkbox' <?php echo get_checkbox_from_config('metadata_disable') ?> name='metadata_disable' /></td></tr>
 <table>
 <tr><td><?php echo m("Disable metadata:"); ?> </td><td><input type='checkbox' <?php echo get_checkbox_from_config('metadata_disable') ?> name='metadata_disable' /></td></tr>
+<tr><td><?php echo m("Amazon Access Key ID:"); ?></td><td><input type='text' width='20' value='<?php echo htmlspecialchars(get_config('aws_keyid', '')) ?>' name='aws_keyid' /></td></tr>
+<tr><td><?php echo m("Amazon Secret Access Key:"); ?></td><td><input type='password' width='40' value='<?
+       $pass = get_config('aws_secret', '');
+       if(strlen($pass) != 0) {
+               echo HASH_PASS;
+       }
+       ?>' name='aws_secret' /></td></tr>
 </table>
 <h2><?php echo m("Shoutcast integration"); ?></h2>
 <p>
 </table>
 <h2><?php echo m("Shoutcast integration"); ?></h2>
 <p>
This page took 0.024539 seconds and 4 git commands to generate.