Dies ist eine alte Version des Dokuments!
nginx config:
server { listen 80; ## listen for ipv4; this line is default and implied listen [::]:80 default_server ipv6only=on; ## listen for ipv6 root /var/www/public; index index.html index.htm; # Make site accessible from [[http://ccc.chaos-inkl.de/]] server_name ccc.chaos-inkl.de; if ( $args ~ language=de ) { rewrite ^/(.*) /de/$1? permanent; } if ( $args ~ language=en ) { rewrite ^/(.*) /en/$1? permanent; } location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.html; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } }
wp-static-patch:
--- library/StaticHtmlOutput.php 2014-03-01 17:48:34.224738002 -0500 +++ library/StaticHtmlOutput.php.new 2014-03-01 18:01:21.068737346 -0500 @@ -113,6 +113,9 @@ { $this->_options ->setOption('version', self::VERSION) + ->setOption('requiresAuth', 0) + ->setOption('authUser', '') + ->setOption('authPass', '') ->setOption('baseUrl', home_url()) ->setOption('additionalUrls', '') ->setOption('generateZip', '') @@ -175,6 +178,9 @@ $this->_view ->setTemplate('options-page') ->assign('exportLog', $this->_exportLog) + ->assign('requiresAuth', $this->_options->getOption('requiresAuth')) + ->assign('authUser', $this->_options->getOption('authUser')) + ->assign('authPass', $this->_options->getOption('authPass')) ->assign('baseUrl', $this->_options->getOption('baseUrl')) ->assign('additionalUrls', $this->_options->getOption('additionalUrls')) ->assign('generateZip', $this->_options->getOption('generateZip')) @@ -207,6 +213,9 @@ %%//%% Save options $this->_options + ->setOption('requiresAuth', filter_input(INPUT_POST, 'requiresAuth')) + ->setOption('authUser', filter_input(INPUT_POST, 'authUser')) + ->setOption('authPass', filter_input(INPUT_POST, 'authPass')) ->setOption('baseUrl', filter_input(INPUT_POST, 'baseUrl', FILTER_SANITIZE_URL)) ->setOption('additionalUrls', filter_input(INPUT_POST, 'additionalUrls')) ->setOption('generateZip', filter_input(INPUT_POST, 'generateZip')) @@ -275,7 +284,12 @@ %%//%%echo "Processing ". $currentUrl."<br />"; - $urlResponse = new StaticHtmlOutput_UrlRequest($currentUrl); + if ( $this->_options->getOption('requiresAuth') == 1) + { + $urlResponse = new StaticHtmlOutput_UrlRequest($currentUrl, $this->_options->getOption('authUser'), $this->_options->getOption('authPass')); + } else { + $urlResponse = new StaticHtmlOutput_UrlRequest($currentUrl); + } $urlResponse->cleanup(); %%//%% Add current url to the list of processed urls --- library/StaticHtmlOutput/UrlRequest.php 2014-03-01 17:48:34.224738002 -0500 +++ library/StaticHtmlOutput/UrlRequest.php.new 2014-03-01 17:58:33.708737054 -0500 @@ -26,10 +26,12 @@ * Constructor * @param string $url URI resource */ - public function %%__%%construct($url) + public function %%__%%construct($url, $username = "", $password = "") { $this->_url = filter_var($url, FILTER_VALIDATE_URL); - $response = wp_remote_get($this->_url,array('timeout'=>300)); %%//%%set a long time out + if($username !== "" and $password !== "") + $headers = array('Authorization'=>'Basic ' . base64_encode("$username:$password")); + $response = wp_remote_get($this->_url,array('timeout'=>300, 'headers'=>$headers)); %%//%%set a long time out $this->_response = (is_wp_error($response) ? '' : $response); } @@ -128,4 +130,4 @@ $this->setResponseBody($responseBody); } } -} \ No newline at end of file +} --- views/options-page.phtml 2014-03-01 17:48:34.224738002 -0500 +++ views/options-page.phtml.new 2014-03-01 18:03:29.004737897 -0500 @@ -23,6 +23,24 @@ <div class="postbox"> <div class="handlediv" title="Click to toggle"><br /></div> + <h3 class="hndle"><span><?= %%__%%('Get Options', 'static-html-output-plugin');?></span></h3> + <div class="inside"> + <p> + <input name="requiresAuth" id="requiresAuth" value="1" type="checkbox" <?php if ($this->requiresAuth == 1) echo "checked"; ?> /> + <label for="requiresAuth"><?= %%__%%('This page requires authentication', 'static-html-output-plugin');?></label> + </p> + + <p> + <label for="authUser"><?= %%__%%('Username', 'static-html-output-plugin');?>:</label> + <input type="text" id="authUser" name="authUser" value="<?php echo esc_attr($this->authUser) ?>" size="50" /> + </p> + <p> + <label for="authPass"><?= %%__%%('Password', 'static-html-output-plugin');?>:</label> + <input type="text" id="authPass" name="authPass" value="<?php echo esc_attr($this->authPass) ?>" size="50" /> + </p> + </div> + + <div class="handlediv" title="Click to toggle"><br /></div> <h3 class="hndle"><span><?= %%__%%('Export Options', 'static-html-output-plugin');?></span></h3> <div class="inside"> <p>
Die gegenwärtigen Setup-Instruktionen befinden sich momentam im Pad: https://codicill.us/p/UTSsdswX1q