From f1366d275e007141a28a933a6221c6337d7aa1d7 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 22 Sep 2009 08:46:07 -0700 Subject: Issue an information message if the user clicks "Save Settings" indicating that the key was not changed as it as identical. This addresses the obscure issue raised in ticket #756 --- modules/gallery/controllers/admin_languages.php | 32 +++++++++++++------------ 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'modules/gallery/controllers') diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php index d91e5205..42968b43 100644 --- a/modules/gallery/controllers/admin_languages.php +++ b/modules/gallery/controllers/admin_languages.php @@ -24,7 +24,7 @@ class Admin_Languages_Controller extends Admin_Controller { $v->content->available_locales = locales::available(); $v->content->installed_locales = locales::installed(); $v->content->default_locale = module::get_var("gallery", "default_locale"); - + if (empty($share_translations_form)) { $share_translations_form = $this->_share_translations_form(); } @@ -35,21 +35,21 @@ class Admin_Languages_Controller extends Admin_Controller { public function save() { access::verify_csrf(); - - locales::update_installed($this->input->post("installed_locales")); - - $installed_locales = array_keys(locales::installed()); + + locales::update_installed($this->input->post("installed_locales")); + + $installed_locales = array_keys(locales::installed()); $new_default_locale = $this->input->post("default_locale"); - if (!in_array($new_default_locale, $installed_locales)) { - if (!empty($installed_locales)) { - $new_default_locale = $installed_locales[0]; - } else { - $new_default_locale = "en_US"; - } - } - module::set_var("gallery", "default_locale", $new_default_locale); - - print json_encode(array("result" => "success")); + if (!in_array($new_default_locale, $installed_locales)) { + if (!empty($installed_locales)) { + $new_default_locale = $installed_locales[0]; + } else { + $new_default_locale = "en_US"; + } + } + module::set_var("gallery", "default_locale", $new_default_locale); + + print json_encode(array("result" => "success")); } public function share() { @@ -88,6 +88,8 @@ class Admin_Languages_Controller extends Admin_Controller { message::success(t("Your API key has been changed.")); } else if (!$old_key && $new_key) { message::success(t("Your API key has been saved.")); + } else if ($old_key && $new_key && $old_key == $new_key) { + message::info(t("Your API key was not changed as it was identical to the current key.")); } log::success(t("gallery"), t("l10n_client API key changed.")); -- cgit v1.2.3 From bec620487af86f566dc7a82549cd4dcb1cf99c9a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 22 Sep 2009 09:48:24 -0700 Subject: Wrap the login form with a view in order to include a forgot password link. Fixes ticket #620 --- modules/gallery/controllers/albums.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/gallery/controllers') diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 3ea08538..694cc4ff 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -28,7 +28,9 @@ class Albums_Controller extends Items_Controller { if ($album->id == 1) { $view = new Theme_View("page.html", "login"); $view->page_title = t("Log in to Gallery"); - $view->content = user::get_login_form("login/auth_html"); + //$view->content = user::get_login_form("login/auth_html"); + $view->content = new View("login_ajax.html"); + $view->content->form = user::get_login_form("login/auth_html"); print $view; return; } else { -- cgit v1.2.3 From 91c99c9627c8a6352054200d242fd81e963a1c73 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 22 Sep 2009 20:36:12 -0700 Subject: Simplify the "unchanged" status message. --- modules/gallery/controllers/admin_languages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/controllers') diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php index 42968b43..a9693d21 100644 --- a/modules/gallery/controllers/admin_languages.php +++ b/modules/gallery/controllers/admin_languages.php @@ -89,7 +89,7 @@ class Admin_Languages_Controller extends Admin_Controller { } else if (!$old_key && $new_key) { message::success(t("Your API key has been saved.")); } else if ($old_key && $new_key && $old_key == $new_key) { - message::info(t("Your API key was not changed as it was identical to the current key.")); + message::info(t("Your API key was not changed.")); } log::success(t("gallery"), t("l10n_client API key changed.")); -- cgit v1.2.3