diff options
-rw-r--r-- | modules/gallery/controllers/admin_identity.php | 76 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_event.php | 6 | ||||
-rw-r--r-- | modules/gallery/views/admin_identity.html.php | 59 | ||||
-rw-r--r-- | modules/gallery/views/admin_identity_confirm.html.php | 10 |
4 files changed, 1 insertions, 150 deletions
diff --git a/modules/gallery/controllers/admin_identity.php b/modules/gallery/controllers/admin_identity.php deleted file mode 100644 index 354e6c0c..00000000 --- a/modules/gallery/controllers/admin_identity.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2009 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_Identity_Controller extends Admin_Controller { - public function index() { - $view = new Admin_View("admin.html"); - $view->content = new View("admin_identity.html"); - $view->content->available = identity::providers(); - $view->content->active = module::get_var("gallery", "identity_provider", "user"); - print $view; - } - - public function confirm() { - access::verify_csrf(); - - $v = new View("admin_identity_confirm.html"); - $v->new_provider = Input::instance()->post("provider"); - - print $v; - } - - public function change() { - access::verify_csrf(); - - $active_provider = module::get_var("gallery", "identity_provider", "user"); - $providers = identity::providers(); - $new_provider = Input::instance()->post("provider"); - - if ($new_provider != $active_provider) { - - module::deactivate($active_provider); - - // Switch authentication - identity::reset(); - module::set_var("gallery", "identity_provider", $new_provider); - - module::install($new_provider); - module::activate($new_provider); - - module::event("identity_provider_changed", $active_provider, $new_provider); - - module::uninstall($active_provider); - - message::success(t("Changed to %description", - array("description" => $providers->$new_provider))); - - try { - Session::instance()->destroy(); - } catch (Exception $e) { - // We don't care if there was a problem destroying the session. - } - url::redirect(item::root()->abs_url()); - } - - message::info(t("The selected provider \"%description\" is already active.", - array("description" => $providers->$new_provider))); - url::redirect("admin/identity"); - } -} - diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 1d8e3581..6c7c2ea4 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -230,11 +230,7 @@ class gallery_event_Core { ->append(Menu::factory("link") ->id("advanced") ->label(t("Advanced")) - ->url(url::site("admin/advanced_settings"))) - ->append(Menu::factory("link") - ->id("authentication") - ->label(t("Authentication")) - ->url(url::site("admin/identity")))) + ->url(url::site("admin/advanced_settings")))) ->append(Menu::factory("link") ->id("modules") ->label(t("Modules")) diff --git a/modules/gallery/views/admin_identity.html.php b/modules/gallery/views/admin_identity.html.php deleted file mode 100644 index 51eaa58a..00000000 --- a/modules/gallery/views/admin_identity.html.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access.") ?> -<script type="text/javascript"> - $(document).ready(function() { - $("#g-modules form").submit(function() { - var eDialog = '<div id="g-dialog"></div>'; - var params = $(this).serialize(); - var url = $(this).attr("action"); - $("body").append(eDialog); - $.post($(this).attr("action"), $(this).serialize(), function(data, textStatus) { - $("#g-dialog").html(data); - $("#g-dialog").dialog({ - bgiframe: true, - title: <?= t("Confirm identity provider change")->for_js() ?>, - resizable: false, - height:180, - modal: true, - overlay: { - backgroundColor: '#000', - opacity: 0.5 - }, - buttons: { - "Continue": function() { - $("#g-dialog form").submit(); - }, - Cancel: function() { - $(this).dialog('destroy').remove(); - } - } - }); - }); - return false; - }); - }); - -</script> -<div id="g-modules"> - <h1> <?= t("Manage identity providers") ?> </h1> - <p> - <?= t("Choose a different user/group management provider.") ?> - </p> - - <form method="post" action="<?= url::site("admin/identity/confirm") ?>"> - <?= access::csrf_form_field() ?> - <table> - <tr> - <th> <?= t("Active") ?> </th> - <th> <?= t("Description") ?> </th> - </tr> - <? foreach ($available as $module_name => $description): ?> - <tr class="<?= text::alternate("g-odd", "g-even") ?>"> - <? $data = array("name" => "provider"); ?> - <td> <?= form::radio($data, $module_name, $module_name == $active) ?> </td> - <td> <?= t($description) ?> </td> - </tr> - <? endforeach ?> - </table> - <input type="submit" value="<?= t("Change")->for_html_attr() ?>" /> - </form> -</div> diff --git a/modules/gallery/views/admin_identity_confirm.html.php b/modules/gallery/views/admin_identity_confirm.html.php deleted file mode 100644 index 54aae9c8..00000000 --- a/modules/gallery/views/admin_identity_confirm.html.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access.") ?> -<form method="post" action="<?= url::site("admin/identity/change") ?>"> - <?= access::csrf_form_field() ?> - <?= form::hidden("provider", $new_provider) ?> - - <p><span class="ui-icon ui-icon-alert" style="float: left; margin:0 7px 20px 0;"></span> - <?= t("Are you sure you want to change your Identity Provider? Continuing will delete all existing users.") ?> - </p> -</form> - |