1
0

Fix copyright to 2009

Add admin_developer/session support.
This commit is contained in:
Bharat Mediratta 2009-05-13 23:53:35 +00:00
parent 31d64d6683
commit b43fc5e988
12 changed files with 45 additions and 34 deletions

View File

@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access."); <?php defined("SYSPATH") or die("No direct script access.");
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access."); <?php defined("SYSPATH") or die("No direct script access.");
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -36,7 +36,7 @@ class Admin_Developer_Controller extends Admin_Controller {
$v = new Admin_View("admin.html"); $v = new Admin_View("admin.html");
$v->content = new View("admin_developer.html"); $v->content = new View("admin_developer.html");
$v->content->title = t("Generate Test Data"); $v->content->title = t("Generate Test Data");
list ($form, $errors) = $this->_get_module_form(); list ($form, $errors) = $this->_get_module_form();
$v->content->developer_content = $this->_get_test_data_view($form, $errors); $v->content->developer_content = $this->_get_test_data_view($form, $errors);
print $v; print $v;
@ -76,9 +76,15 @@ class Admin_Developer_Controller extends Admin_Controller {
} }
} }
public function session($key) {
access::verify_csrf();
Session::instance()->set($key, Input::instance()->get("value"));
url::redirect("albums/1");
}
public function test_data_create() { public function test_data_create() {
access::verify_csrf(); access::verify_csrf();
list ($form, $errors) = $this->_get_test_data_form(); list ($form, $errors) = $this->_get_test_data_form();
$post = new Validation($_POST); $post = new Validation($_POST);
@ -90,7 +96,7 @@ class Admin_Developer_Controller extends Admin_Controller {
$post->add_callbacks("photos", array($this, "_set_default")); $post->add_callbacks("photos", array($this, "_set_default"));
$post->add_callbacks("comments", array($this, "_set_default")); $post->add_callbacks("comments", array($this, "_set_default"));
$post->add_callbacks("tags", array($this, "_set_default")); $post->add_callbacks("tags", array($this, "_set_default"));
if ($post->validate()) { if ($post->validate()) {
$task_def = Task_Definition::factory() $task_def = Task_Definition::factory()
->callback("developer_task::create_content") ->callback("developer_task::create_content")
@ -100,7 +106,7 @@ class Admin_Developer_Controller extends Admin_Controller {
$success_msg = t("Successfully generated test data"); $success_msg = t("Successfully generated test data");
$error_msg = t("Problems with test data generation was encountered"); $error_msg = t("Problems with test data generation was encountered");
$task = task::create($task_def, array("total" => $total, "batch" => (int)ceil($total / 10), $task = task::create($task_def, array("total" => $total, "batch" => (int)ceil($total / 10),
"success_msg" => $success_msg, "success_msg" => $success_msg,
"current" => 0, "error_msg" => $error_msg, "current" => 0, "error_msg" => $error_msg,
"albums" => $post->albums, "photos" => $post->photos, "albums" => $post->albums, "photos" => $post->photos,
"comments" => $post->comments, "tags" => $post->tags)); "comments" => $post->comments, "tags" => $post->tags));
@ -233,7 +239,7 @@ class Admin_Developer_Controller extends Admin_Controller {
$form = array("albums" => "10", "photos" => "10", "comments" => "10", "tags" => "10", $form = array("albums" => "10", "photos" => "10", "comments" => "10", "tags" => "10",
"generate_albums" => ""); "generate_albums" => "");
$errors = array_fill_keys(array_keys($form), ""); $errors = array_fill_keys(array_keys($form), "");
return array($form, $errors); return array($form, $errors);
} }

View File

@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access."); <?php defined("SYSPATH") or die("No direct script access.");
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access."); <?php defined("SYSPATH") or die("No direct script access.");
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -23,7 +23,7 @@ class developer_menu_Core {
->id("developer_menu") ->id("developer_menu")
->label(t("Developer Tools")); ->label(t("Developer Tools"));
$menu->append($developer_menu); $menu->append($developer_menu);
$developer_menu $developer_menu
->append(Menu::factory("link") ->append(Menu::factory("link")
->id("generate_menu") ->id("generate_menu")
@ -38,28 +38,33 @@ class developer_menu_Core {
->label(t("MPTT Tree")) ->label(t("MPTT Tree"))
->url(url::site("admin/developer/mptt"))); ->url(url::site("admin/developer/mptt")));
$csrf = access::csrf_token();
if (Session::instance()->get("profiler", false)) { if (Session::instance()->get("profiler", false)) {
$developer_menu->append(Menu::factory("link") $developer_menu->append(
->id("scaffold_profiler") Menu::factory("link")
->label("Profiling off") ->id("scaffold_profiler")
->url(url::site("admin/developer/session/profiler?value=0"))); ->label("Profiling off")
->url(url::site("admin/developer/session/profiler?value=0&csrf=$csrf")));
} else { } else {
$developer_menu->append(Menu::factory("link") $developer_menu->append(
->id("scaffold_profiler") Menu::factory("link")
->label("Profiling on") ->id("scaffold_profiler")
->url(url::site("admin/developer/session/profiler?value=1"))); ->label("Profiling on")
->url(url::site("admin/developer/session/profiler?value=1&csrf=$csrf")));
} }
if (Session::instance()->get("debug", false)) { if (Session::instance()->get("debug", false)) {
$developer_menu->append(Menu::factory("link") $developer_menu->append(
->id("scaffold_debugger") Menu::factory("link")
->label("Debugging off") ->id("scaffold_debugger")
->url(url::site("admin/developer/session/debug?value=0"))); ->label("Debugging off")
->url(url::site("admin/developer/session/debug?value=0&csrf=$csrf")));
} else { } else {
$developer_menu->append(Menu::factory("link") $developer_menu->append(
->id("scaffold_debugger") Menu::factory("link")
->label("Debugging on") ->id("scaffold_debugger")
->url(url::site("admin/developer/session/debug?value=1"))); ->label("Debugging on")
->url(url::site("admin/developer/session/debug?value=1&csrf=$csrf")));
} }
} }
} }

View File

@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access."); <?php defined("SYSPATH") or die("No direct script access.");
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?> <?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?> <?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?> <?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?> <?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?> <?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?> <?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?> <?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
/** /**
* Gallery - a web based photo album viewer and editor * Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta * Copyright (C) 2000-2009 Bharat Mediratta
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by