diff --git a/3.0/modules/remote/README b/3.0/modules/remote/README index 456a2e4c..7e271ba5 100644 --- a/3.0/modules/remote/README +++ b/3.0/modules/remote/README @@ -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. diff --git a/3.0/modules/remote/controllers/admin_remote.php b/3.0/modules/remote/controllers/admin_remote.php new file mode 100644 index 00000000..64fb22c1 --- /dev/null +++ b/3.0/modules/remote/controllers/admin_remote.php @@ -0,0 +1,28 @@ +page_title = t('Gallery Remote Protocol 2'); + $view->content = new View('admin_remote.html'); + print $view; + } +} \ No newline at end of file diff --git a/3.0/modules/remote/helpers/remote_event.php b/3.0/modules/remote/helpers/remote_event.php new file mode 100644 index 00000000..7abb70f0 --- /dev/null +++ b/3.0/modules/remote/helpers/remote_event.php @@ -0,0 +1,29 @@ +get("settings_menu") + ->append(Menu::factory("link") + ->id("remote") + ->label(t("Gallery Remote")) + ->url(url::site("admin/remote"))); + } +} diff --git a/3.0/modules/remote/libraries/GalleryRemoteReply.php b/3.0/modules/remote/libraries/GalleryRemoteReply.php index 7ad5781f..8dc8f4aa 100644 --- a/3.0/modules/remote/libraries/GalleryRemoteReply.php +++ b/3.0/modules/remote/libraries/GalleryRemoteReply.php @@ -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; + } } } diff --git a/3.0/modules/remote/module.info b/3.0/modules/remote/module.info index 89b1d177..b0e74bbd 100644 --- a/3.0/modules/remote/module.info +++ b/3.0/modules/remote/module.info @@ -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" diff --git a/3.0/modules/remote/patches/cookie.patch b/3.0/modules/remote/patches/cookie.patch index 95b16f69..4b9b7658 100644 --- a/3.0/modules/remote/patches/cookie.patch +++ b/3.0/modules/remote/patches/cookie.patch @@ -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; diff --git a/3.0/modules/remote/patches/gallery_remote2.php b/3.0/modules/remote/patches/gallery_remote2.php deleted file mode 100644 index db39124b..00000000 --- a/3.0/modules/remote/patches/gallery_remote2.php +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/3.0/modules/remote/patches/htaccess.patch b/3.0/modules/remote/patches/htaccess.patch index b2b33617..3875724c 100644 --- a/3.0/modules/remote/patches/htaccess.patch +++ b/3.0/modules/remote/patches/htaccess.patch @@ -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] - # -+ +@@ -22,6 +84,16 @@ + SecFilterScanPOST Off + + +# URL rewriting for Gallery Remote -+# -+# RewriteEngine On -+# RewriteBase /~bharat/gallery3/ -+# RewriteRule ^gallery_remote2.php$ index.php?kohana_uri=/remote [QSA,PT,L] -+# ++ ++ 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] ++ ++ + # 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 diff --git a/3.0/modules/remote/views/admin_remote.html.php b/3.0/modules/remote/views/admin_remote.html.php new file mode 100644 index 00000000..495cb641 --- /dev/null +++ b/3.0/modules/remote/views/admin_remote.html.php @@ -0,0 +1,65 @@ + +
+

+

+ +

+ + + +