summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/controllers/packager.php (renamed from modules/gallery/controllers/package.php)10
-rw-r--r--modules/gallery/controllers/upgrader.php12
-rw-r--r--modules/gallery/tests/xss_data.txt13
-rw-r--r--modules/gallery/views/kohana_error_page.php2
4 files changed, 28 insertions, 9 deletions
diff --git a/modules/gallery/controllers/package.php b/modules/gallery/controllers/packager.php
index f5146fc8..da0a7983 100644
--- a/modules/gallery/controllers/package.php
+++ b/modules/gallery/controllers/packager.php
@@ -17,12 +17,14 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class Package_Controller extends Controller {
- function index() {
- if (PHP_SAPI != 'cli') {
- Kohana::show_404();
+class Packager_Controller extends Controller {
+ function package() {
+ if (PHP_SAPI != "cli") {
+ access::forbidden();
}
+ $_SERVER["HTTP_HOST"] = "example.com";
+
try {
$this->_reset(); // empty and reinstall the standard modules
$this->_dump_database(); // Dump the database
diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php
index 0d5bb4f6..0833e253 100644
--- a/modules/gallery/controllers/upgrader.php
+++ b/modules/gallery/controllers/upgrader.php
@@ -32,7 +32,11 @@ class Upgrader_Controller extends Controller {
public function upgrade() {
// Todo: give the admin a chance to log in here
- if (!user::active()->admin) {
+ if (php_sapi_name() == "cli") {
+ // @todo this may screw up some module installers, but we don't have a better answer at
+ // this time.
+ $_SERVER["HTTP_HOST"] = "example.com";
+ } else if (!user::active()->admin) {
access::forbidden();
}
@@ -51,6 +55,10 @@ class Upgrader_Controller extends Controller {
}
}
- url::redirect("upgrader?done=1");
+ if (php_sapi_name() == "cli") {
+ print "Upgrade complete\n";
+ } else {
+ url::redirect("upgrader?done=1");
+ }
}
}
diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt
index b71262df..f47ae0dc 100644
--- a/modules/gallery/tests/xss_data.txt
+++ b/modules/gallery/tests/xss_data.txt
@@ -73,7 +73,7 @@ modules/gallery/views/admin_advanced_settings.html.php 25 DIRTY $var->mod
modules/gallery/views/admin_advanced_settings.html.php 25 $var->name
modules/gallery/views/admin_advanced_settings.html.php 27 $var->name
modules/gallery/views/admin_advanced_settings.html.php 27 DIRTY $var->module_name
-modules/gallery/views/admin_advanced_settings.html.php 28 $var->value
+modules/gallery/views/admin_advanced_settings.html.php 29 $var->value
modules/gallery/views/admin_block_log_entries.html.php 4 DIRTY $entry->severity
modules/gallery/views/admin_block_log_entries.html.php 5 DIRTY $entry->user_id
modules/gallery/views/admin_block_log_entries.html.php 5 $entry->user->name
@@ -278,6 +278,14 @@ modules/gallery/views/simple_uploader.html.php 28 $parent->
modules/gallery/views/simple_uploader.html.php 30 $item->title
modules/gallery/views/simple_uploader.html.php 77 DIRTY $item->id
modules/gallery/views/simple_uploader.html.php 81 DIRTY $csrf
+modules/gallery/views/upgrader.html.php 94 DIRTY $done
+modules/gallery/views/upgrader.html.php 124 DIRTY $module->version
+modules/gallery/views/upgrader.html.php 124 DIRTY $module->code_version
+modules/gallery/views/upgrader.html.php 125 DIRTY $id
+modules/gallery/views/upgrader.html.php 126 DIRTY $module->name
+modules/gallery/views/upgrader.html.php 129 DIRTY $module->version
+modules/gallery/views/upgrader.html.php 132 DIRTY $module->code_version
+modules/gallery/views/upgrader.html.php 155 DIRTY $module->name
modules/image_block/views/image_block_block.html.php 3 DIRTY $item->url()
modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class" => "gThumbnail"))
modules/info/views/info_block.html.php 6 $item->title
@@ -492,6 +500,7 @@ themes/admin_default/views/admin.html.php 20 DIRTY $theme->u
themes/admin_default/views/admin.html.php 29 DIRTY $theme->url("js/jquery.dropshadow.js")
themes/admin_default/views/admin.html.php 30 DIRTY $theme->url("js/ui.init.js")
themes/admin_default/views/admin.html.php 31 DIRTY $theme->admin_head()
+themes/admin_default/views/admin.html.php 34 DIRTY $theme->body_attributes()
themes/admin_default/views/admin.html.php 35 DIRTY $theme->admin_page_top()
themes/admin_default/views/admin.html.php 41 DIRTY $theme->site_status()
themes/admin_default/views/admin.html.php 43 DIRTY $theme->admin_header_top()
@@ -563,7 +572,6 @@ themes/default/views/header.html.php 21 DIRTY $parent->
themes/default/views/header.html.php 21 DIRTY $item->id
themes/default/views/header.html.php 22 $parent->title
themes/default/views/header.html.php 26 $item->title
-themes/default/views/login_page.html.php 10 DIRTY $theme->url("css/screen.css")
themes/default/views/movie.html.php 4 DIRTY $theme->photo_top()
themes/default/views/movie.html.php 7 DIRTY $position
themes/default/views/movie.html.php 7 DIRTY $sibling_count
@@ -590,6 +598,7 @@ themes/default/views/page.html.php 51 DIRTY $theme->u
themes/default/views/page.html.php 52 DIRTY $theme->url("js/jquery.localscroll.js")
themes/default/views/page.html.php 53 DIRTY $theme->url("js/ui.init.js")
themes/default/views/page.html.php 54 DIRTY $theme->head()
+themes/default/views/page.html.php 57 DIRTY $theme->body_attributes()
themes/default/views/page.html.php 58 DIRTY $theme->page_top()
themes/default/views/page.html.php 60 DIRTY $theme->site_status()
themes/default/views/page.html.php 62 DIRTY $theme->display("header.html")
diff --git a/modules/gallery/views/kohana_error_page.php b/modules/gallery/views/kohana_error_page.php
index d9bf9698..6bf48549 100644
--- a/modules/gallery/views/kohana_error_page.php
+++ b/modules/gallery/views/kohana_error_page.php
@@ -59,7 +59,7 @@
</head>
<body>
<? try { $user = user::active(); } catch (Exception $e) { } ?>
- <? $admin = isset($user) && $user->admin ?>
+ <? $admin = php_sapi_name() == "cli" || isset($user) && $user->admin ?>
<div class="big_box" id="framework_error">
<h1>
<?= t("Dang... Something went wrong!") ?>