1
0

added a settings page with install notes

This commit is contained in:
Thomas E. Horner 2011-06-20 15:59:58 +02:00
parent 3e59a5f933
commit 0b0144d544
9 changed files with 163 additions and 43 deletions

View File

@ -1,3 +1 @@
This is a preliminary work. To use it, you need to apply the changes
in the patches directory. It's got limited functionality and is only
the beginning of the effort.
To use this module you need to apply the changes in the patches directory.

View File

@ -0,0 +1,28 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Admin_remote_Controller extends Admin_Controller {
public function index() {
$view = new Admin_View('admin.html');
$view->page_title = t('Gallery Remote Protocol 2');
$view->content = new View('admin_remote.html');
print $view;
}
}

View File

@ -0,0 +1,29 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class remote_event_Core {
static function admin_menu($menu, $theme) {
$menu
->get("settings_menu")
->append(Menu::factory("link")
->id("remote")
->label(t("Gallery Remote"))
->url(url::site("admin/remote")));
}
}

View File

@ -19,8 +19,8 @@
*/
class GalleryRemoteReply_Core {
private $values = array();
private $nl = "\n";
private $values = array();
private $nl = "\n";
/**
* Constructor.
* @param int $status a Gallery Remote status code
@ -46,12 +46,12 @@ class GalleryRemoteReply_Core {
}
public function send($status='') {
if($status!='') $reply->set('status', $status);
//ksort($this->values);
if($status!='') $reply->set('status', $status);
//ksort($this->values);
echo '#__GR2PROTO__'.$this->nl;
foreach($this->values as $key => $value) {
echo $key.'='.$value.$this->nl;
}
echo '#__GR2PROTO__'.$this->nl;
foreach($this->values as $key => $value) {
echo $key.'='.$value.$this->nl;
}
}
}

View File

@ -1,7 +1,7 @@
name = "Gallery Remote"
description = "Use Gallery Remote and other similar applications to control your Gallery"
description = "Use Gallery Remote and other similar applications to control Gallery 3"
version = 1
author_name = ""
author_url = ""
info_url = "http://codex.gallery2.org/Gallery3:Modules:remote"
author_name = "Thomas E. Horner"
author_url = "http://www.t-horner.com"
info_url = "http://www.t-horner.com/g3_remote"
discuss_url = "http://gallery.menalto.com/forum_module_remote"

View File

@ -1,13 +1,11 @@
diff --git a/system/helpers/cookie.php b/system/helpers/cookie.php
index 901b6d8..df276ee 100644
--- a/system/helpers/cookie.php
+++ b/system/helpers/cookie.php
@@ -45,7 +45,7 @@ class cookie_Core {
// Expiration timestamp
$expire = ($expire == 0) ? 0 : time() + (int) $expire;
- return setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
+ return setcookie($name, $value, $expire, $path, $domain, $secure, 0);
}
/**
diff --git a/modules/gallery/config/cookie.php b/modules/gallery/config/cookie.php
index a865231..a2a0af7 100644
--- a/modules/gallery/config/cookie.php
+++ b/modules/gallery/config/cookie.php
@@ -45,4 +45,4 @@ $config['secure'] = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on';
* Enable this option to disable the cookie from being accessed when using a
* secure protocol. This option is only available in PHP 5.2 and above.
*/
-$config['httponly'] = true;
\ No newline at end of file
+$config['httponly'] = false;

View File

@ -1,4 +0,0 @@
<?
$_GET["kohana_uri"] = "/gallery_remote";
include("index.php");
?>

View File

@ -1,15 +1,21 @@
diff --git a/.htaccess b/.htaccess
index 1d8bcb3..8229928 100644
index d255efa..68b66bb 100644
--- a/.htaccess
+++ b/.htaccess
@@ -56,3 +56,10 @@
# RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
# RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
# </IfModule>
+
@@ -22,6 +84,16 @@
SecFilterScanPOST Off
</IfModule>
+# URL rewriting for Gallery Remote
+#<IfModule mod_rewrite.c>
+# RewriteEngine On
+# RewriteBase /~bharat/gallery3/
+# RewriteRule ^gallery_remote2.php$ index.php?kohana_uri=/remote [QSA,PT,L]
+#</IfModule>
+<IfModule mod_rewrite.c>
+ Options +FollowSymLinks
+ RewriteEngine On
+ RewriteBase /gallery/
+ ErrorDocument 404 default
+ RewriteRule ^main.php(.*)$ / [QSA,L,R=404]
+ RewriteRule ^gallery_remote2.php(.*)$ index.php?kohana_uri=/gallery_remote$1 [QSA,PT,L]
+</IfModule>
+
# Increase security by uncommenting this block. It keeps browsers
# from seeing support files that they shouldn't have access to. We
# comment this out because Apache2 requires some minor configuration

View File

@ -0,0 +1,65 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="g-admin-remote" class="g-block">
<h1> <?= t("Gallery Remote Protocol 2") ?> </h1>
<p>
<?= t("Use your Gallery 1 & 2 tools like GalleryRemote, etc. with your new Gallery 3 installation.") ?>
</p>
<script type="text/javascript">
$(document).ready(function() {
$("#g-admin-remote-tabs").tabs();
// Show the tabs after the page has loaded to prevent Firefox from rendering the
// unstyled page and then flashing.
$("#g-admin-remote-tabs").show();
});
</script>
<div id="g-admin-remote-tabs" class="g-block-content" style="display: none">
<ul>
<li>
<a href="#g-admin-remote-notes"><?= t("Notes") ?></a>
</li>
<li>
<form action="https://www.paypal.com/cgi-bin/webscr" target="_blank" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHNwYJKoZIhvcNAQcEoIIHKDCCByQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCL10Oka8+wcBeWJRZ7V/CtX59Nqts2BZJT7EAdRnDvsMcO8k/RMeEaGnkU5YC2H2h9ANhbVryW7OIHhf1xhT8xAB/jSdFLE9rieEe9oT04Q4bYB6TVKRnP2G5ePy85dw2BWmvG1FzQ7VcV0I45RGdQQY4RJ/4YRd1IN/nrl2GHQjELMAkGBSsOAwIaBQAwgbQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIYPlLiCOLDAGAgZAwTMBsLDiZwmYKo+hYc+/Pl8gOuSDOlBS18qbDeak+onKhK9GDJREWtgRc0eh3g5Yi9g4wsu1K6y1X1+JeqgHk3Oba7hTXrIeFjLF0xmwsJhU9h6Nltt+rKiC3k/jQjybmQCoAJZNLpnnRFUNedp8h53CiJfDMr/EZuGVk1Q2MgEOwzMdbY3angNHZcgPIg1ugggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1WhcNMzUwMjEzMTAxMzE1Wj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AMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMTA2MjAxMDQxMDZaMCMGCSqGSIb3DQEJBDEWBBSuGj5QrqLx1Oino/zoU3oJ/X/zUjANBgkqhkiG9w0BAQEFAASBgGzIs8ATmWaLCHrnvW1W+xnSJDFutjw7EU0l6wRD2Kx2cheqbfIDe06aMJUiv4FV7ZYuRYxn/j2VYmHDi15XTEfen2S5ag6HIqAjEkQxTRnyoWVtD7iY37qV8CwAgYgkIhMRw3+rwHnuPcCprUtO7CmxvNqZrNS3X0oogdOfxAQN-----END PKCS7-----">
<input type="image" src="https://www.paypalobjects.com/WEBSCR-640-20110429-1/en_GB/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online." style="background-color: transparent">
<img alt="" border="0" src="https://www.paypalobjects.com/WEBSCR-640-20110429-1/de_DE/i/scr/pixel.gif" width="1" height="1">
</form>
</li>
</ul>
<div id="g-admin-remote-notes" class="g-text">
<ul>
<li>
<p>
<?= t("To use GalleryRemote 1.5.1 you need to edit %file and change line <br />%from <br />to line <br />%to",
array( "file" => 'modules/gallery/config/cookie.php'
,"from" => '$config[\'httponly\'] = true;'
,"to" => '$config[\'httponly\'] = false;') ) ?>
</p>
</li>
<li>
<p>
<?= t("In any case you need to enable the G3 Gallery Remote interface: <br />Put the following block at the top of %path and the Gallery Remote module will be available",
array("path" => '.htaccess') ) ?>
</p>
<textarea id="g-remote-redirect-rules" rows="4" cols="60">&lt;IfModule mod_rewrite.c&gt;
Options +FollowSymLinks
RewriteEngine On
RewriteBase /gallery/
ErrorDocument 404 default
RewriteRule ^main.php(.*)$ / [QSA,L,R=404]
RewriteRule ^gallery_remote2.php(.*)$ index.php?kohana_uri=/gallery_remote$1 [QSA,PT,L]
&lt;/IfModule&gt;</textarea>
<script type="text/javascript">
$(document).ready(function() {
$("#g-remote-redirect-rules").click(function(event) {
this.select();
});
});
</script>
</li>
</ul>
</div>
</div>
</div>