From 603c3049a1ce7249c55ff8338fc3ea69323f0cb3 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 09:39:29 -0800 Subject: Treat identity providers just like other modules and use the admin_module to install and switch to a different identity provider. --- modules/comment/helpers/comment_event.php | 18 +++++++++-------- modules/gallery/helpers/gallery_event.php | 32 ++++++++++++++++--------------- modules/user/helpers/user_installer.php | 24 +++++++++++------------ modules/user/module.info | 2 -- 4 files changed, 38 insertions(+), 38 deletions(-) (limited to 'modules') diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php index 43a30d70..bd336cda 100644 --- a/modules/comment/helpers/comment_event.php +++ b/modules/comment/helpers/comment_event.php @@ -27,14 +27,16 @@ class comment_event_Core { static function user_deleted($user) { $guest = identity::guest(); - db::build() - ->update("comments") - ->set("author_id", $guest->id) - ->set("guest_email", null) - ->set("guest_name", "guest") - ->set("guest_url", null) - ->where("author_id", "=", $user->id) - ->execute(); + if (!empty($guest)) { // could be empty if there is not identity provider + db::build() + ->update("comments") + ->set("author_id", $guest->id) + ->set("guest_email", null) + ->set("guest_name", "guest") + ->set("guest_url", null) + ->where("author_id", "=", $user->id) + ->execute(); + } } static function identity_provider_changed($old_provider, $new_provider) { diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 679d65c2..1d8e3581 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -30,21 +30,23 @@ class gallery_event_Core { static function user_deleted($user) { $admin = identity::admin_user(); - db::build() - ->update("tasks") - ->set("owner_id", $admin->id) - ->where("owner_id", "=", $user->id) - ->execute(); - db::build() - ->update("items") - ->set("owner_id", $admin->id) - ->where("owner_id", "=", $user->id) - ->execute(); - db::build() - ->update("logs") - ->set("user_id", $admin->id) - ->where("user_id", "=", $user->id) - ->execute(); + if (!empty($admin)) { // could be empty if there is not identity provider + db::build() + ->update("tasks") + ->set("owner_id", $admin->id) + ->where("owner_id", "=", $user->id) + ->execute(); + db::build() + ->update("items") + ->set("owner_id", $admin->id) + ->where("owner_id", "=", $user->id) + ->execute(); + db::build() + ->update("logs") + ->set("user_id", $admin->id) + ->where("user_id", "=", $user->id) + ->execute(); + } } static function identity_provider_changed($old_provider, $new_provider) { diff --git a/modules/user/helpers/user_installer.php b/modules/user/helpers/user_installer.php index 0cba502f..dd21c93c 100644 --- a/modules/user/helpers/user_installer.php +++ b/modules/user/helpers/user_installer.php @@ -20,6 +20,13 @@ class user_installer { static function install() { $db = Database::instance(); + $current_provider = module::get_var("gallery", "identity_provider"); + if (!empty($current_provider)) { + module::uninstall($current_provider); + } + IdentityProvider::reset(); + module::set_var("gallery", "identity_provider", "user"); + $db->query("CREATE TABLE IF NOT EXISTS {users} ( `id` int(9) NOT NULL auto_increment, `name` varchar(32) NOT NULL, @@ -70,19 +77,6 @@ class user_installer { $admin->admin = true; $admin->save(); - $current_provider = module::get_var("gallery", "identity_provider"); - if (empty($current_provider)) { - // If there is no provider defined then we are doing an initial install - // so we need to set the provider and make the administrator own everything - // If the installer is called and there is an identity provider, then we - // are switching identity providers and and the event handlers will do the - // right things - module::set_var("gallery", "identity_provider", "user"); - - // Let the admin own everything - $db->query("update {items} set owner_id = {$admin->id}"); - } - $root = ORM::factory("item", 1); access::allow($everybody, "view", $root); access::allow($everybody, "view_full", $root); @@ -93,6 +87,10 @@ class user_installer { module::set_var("user", "mininum_password_length", 5); module::set_version("user", 2); + module::event("identity_provider_changed", $current_provider, "user"); + + auth::login(IdentityProvider::instance()->admin_user()); + Session::instance()->regenerate(); } static function upgrade($version) { diff --git a/modules/user/module.info b/modules/user/module.info index 7178f108..d1e02382 100644 --- a/modules/user/module.info +++ b/modules/user/module.info @@ -2,5 +2,3 @@ name = "Users and Groups" description = "Gallery 3 user and group management" version = 2 -; Don't show this module on the module administration screen -no_module_admin = 1 -- cgit v1.2.3 From ae568b6182544b84067aa099eec494da477d083f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 12:09:11 -0800 Subject: Refactor the identity provider installation in to a common helper method (change_provider) with an initialization callback. --- modules/gallery/libraries/IdentityProvider.php | 29 +++++++++++ modules/user/helpers/user_installer.php | 68 ++++++++++++-------------- 2 files changed, 61 insertions(+), 36 deletions(-) (limited to 'modules') diff --git a/modules/gallery/libraries/IdentityProvider.php b/modules/gallery/libraries/IdentityProvider.php index bcb3056a..f7be33e3 100644 --- a/modules/gallery/libraries/IdentityProvider.php +++ b/modules/gallery/libraries/IdentityProvider.php @@ -57,6 +57,35 @@ class IdentityProvider_Core { Kohana_Config::instance()->clear("identity"); } + /** + * Return a commen confirmation message + */ + static function confirmation_message() { + return t("Are you sure you want to change your Identity Provider? " . + "Continuing will delete all existing users."); + } + + static function change_provider($new_provider) { + $current_provider = module::get_var("gallery", "identity_provider"); + if (!empty($current_provider)) { + module::uninstall($current_provider); + } + + IdentityProvider::reset(); + $provider = new IdentityProvider($new_provider); + + module::set_var("gallery", "identity_provider", $new_provider); + + if (method_exists("{$new_provider}_installer", "initialize")) { + call_user_func("{$new_provider}_installer::initialize"); + } + + module::event("identity_provider_changed", $current_provider, $new_provider); + + auth::login($provider->admin_user()); + Session::instance()->regenerate(); + } + /** * Loads the configured driver and validates it. * diff --git a/modules/user/helpers/user_installer.php b/modules/user/helpers/user_installer.php index dd21c93c..3882f5f2 100644 --- a/modules/user/helpers/user_installer.php +++ b/modules/user/helpers/user_installer.php @@ -18,15 +18,40 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class user_installer { + static function check_environment() { + return array("warn" => array(IdentityProvider::confirmation_message())); + } + static function install() { - $db = Database::instance(); - $current_provider = module::get_var("gallery", "identity_provider"); - if (!empty($current_provider)) { - module::uninstall($current_provider); + IdentityProvider::change_provider("user"); + } + + static function upgrade($version) { + if ($version == 1) { + module::set_var("user", "mininum_password_length", 5); + + module::set_version("user", $version = 2); + } + } + + static function uninstall() { + // Delete all users and groups so that we give other modules an opportunity to clean up + foreach (ORM::factory("user")->find_all() as $user) { + $user->delete(); + } + + foreach (ORM::factory("group")->find_all() as $group) { + $group->delete(); } - IdentityProvider::reset(); - module::set_var("gallery", "identity_provider", "user"); + $db = Database::instance(); + $db->query("DROP TABLE IF EXISTS {users};"); + $db->query("DROP TABLE IF EXISTS {groups};"); + $db->query("DROP TABLE IF EXISTS {groups_users};"); + } + + static function initialize() { + $db = Database::instance(); $db->query("CREATE TABLE IF NOT EXISTS {users} ( `id` int(9) NOT NULL auto_increment, `name` varchar(32) NOT NULL, @@ -84,36 +109,7 @@ class user_installer { access::allow($registered, "view", $root); access::allow($registered, "view_full", $root); - module::set_var("user", "mininum_password_length", 5); - module::set_version("user", 2); - module::event("identity_provider_changed", $current_provider, "user"); - - auth::login(IdentityProvider::instance()->admin_user()); - Session::instance()->regenerate(); - } - - static function upgrade($version) { - if ($version == 1) { - module::set_var("user", "mininum_password_length", 5); - - module::set_version("user", $version = 2); - } - } - - static function uninstall() { - // Delete all users and groups so that we give other modules an opportunity to clean up - foreach (ORM::factory("user")->find_all() as $user) { - $user->delete(); - } - - foreach (ORM::factory("group")->find_all() as $group) { - $group->delete(); - } - - $db = Database::instance(); - $db->query("DROP TABLE IF EXISTS {users};"); - $db->query("DROP TABLE IF EXISTS {groups};"); - $db->query("DROP TABLE IF EXISTS {groups_users};"); + module::set_var("user", "mininum_password_length", 5); } } \ No newline at end of file -- cgit v1.2.3 From 11757831233da528662864e23d89f39bfb908801 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 12:16:36 -0800 Subject: Disable the continue button after clicking so it can only clicked once. --- modules/gallery/views/admin_modules.html.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules') diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index 704e7beb..a021d969 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -22,6 +22,9 @@ buttons: { for_js() ?>: function() { $("form", this).submit(); + $(".ui-dialog-buttonpane button:contains(Continue)") + .attr("disabled", "disabled") + .addClass("ui-state-disabled"); }, for_js() ?>: function() { $(this).dialog("destroy").remove(); -- cgit v1.2.3 From dabd5b84b21c711592a1f3bcd2ca298dd6d7fde2 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 12:22:31 -0800 Subject: Remove the identity manager screens and controller as alterntive identity providers are installed in the admin module screen. --- modules/gallery/controllers/admin_identity.php | 76 ---------------------- modules/gallery/helpers/gallery_event.php | 6 +- modules/gallery/views/admin_identity.html.php | 59 ----------------- .../gallery/views/admin_identity_confirm.html.php | 10 --- 4 files changed, 1 insertion(+), 150 deletions(-) delete mode 100644 modules/gallery/controllers/admin_identity.php delete mode 100644 modules/gallery/views/admin_identity.html.php delete mode 100644 modules/gallery/views/admin_identity_confirm.html.php (limited to 'modules') 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 @@ -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 @@ - - -
-

-

- -

- -
"> - - - - - - - $description): ?> - "> - "provider"); ?> - - - - -
- for_html_attr() ?>" /> -
-
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 @@ - -
"> - - - -

- -

-
- -- cgit v1.2.3 From df313cac567bee77f5a73308381fe67dcac9b92c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 12:30:17 -0800 Subject: Change the check_environment method in the module helper and the module installers to can_activate to reflect that it is doing more than just checking the environment. --- modules/gallery/controllers/admin_modules.php | 2 +- modules/gallery/helpers/module.php | 8 ++++---- modules/slideshow/helpers/slideshow_installer.php | 2 +- modules/user/helpers/user_installer.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/gallery/controllers/admin_modules.php b/modules/gallery/controllers/admin_modules.php index 46defbef..a2168280 100644 --- a/modules/gallery/controllers/admin_modules.php +++ b/modules/gallery/controllers/admin_modules.php @@ -42,7 +42,7 @@ class Admin_Modules_Controller extends Admin_Controller { if ($info->active && !$desired && module::is_active($module_name)) { $messages = array_merge($messages, module::can_deactivate($module_name)); } else if (!$info->active && $desired && !module::is_active($module_name)) { - $messages = array_merge($messages, module::check_environment($module_name)); + $messages = array_merge($messages, module::can_activate($module_name)); } } diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index 595f600b..f680ff6a 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -120,17 +120,17 @@ class module_Core { } /** - * Check that the module can be installed. (i.e. all the prerequistes exist) + * Check that the module can be activated. (i.e. all the prerequistes exist) * @param string $module_name * @return array an array of warning or error messages to be displayed */ - static function check_environment($module_name) { + static function can_activate($module_name) { module::_add_to_path($module_name); $messages = array(); $installer_class = "{$module_name}_installer"; - if (method_exists($installer_class, "check_environment")) { - $messages = call_user_func(array($installer_class, "check_environment")); + if (method_exists($installer_class, "can_activate")) { + $messages = call_user_func(array($installer_class, "can_activate")); } // Remove it from the active path diff --git a/modules/slideshow/helpers/slideshow_installer.php b/modules/slideshow/helpers/slideshow_installer.php index 319e2e79..8d612f3e 100644 --- a/modules/slideshow/helpers/slideshow_installer.php +++ b/modules/slideshow/helpers/slideshow_installer.php @@ -34,7 +34,7 @@ class slideshow_installer { site_status::clear("slideshow_needs_rss"); } - static function check_environment() { + static function can_activate() { $messages = array(); if (!module::is_active("rss")) { $messages["warn"][] = t("The Slideshow module requires the RSS module."); diff --git a/modules/user/helpers/user_installer.php b/modules/user/helpers/user_installer.php index 3882f5f2..38f8020b 100644 --- a/modules/user/helpers/user_installer.php +++ b/modules/user/helpers/user_installer.php @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class user_installer { - static function check_environment() { + static function can_activate() { return array("warn" => array(IdentityProvider::confirmation_message())); } -- cgit v1.2.3 From eabeeeb1267e0c925b5f31b2455a080bc2e9f237 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 13:38:05 -0800 Subject: Trap any errors that may occur when trying to install a new identity provider and then reinstall the current one. --- modules/gallery/controllers/admin_modules.php | 31 +++++++++++--------- modules/gallery/libraries/IdentityProvider.php | 40 ++++++++++++++++++-------- 2 files changed, 45 insertions(+), 26 deletions(-) (limited to 'modules') diff --git a/modules/gallery/controllers/admin_modules.php b/modules/gallery/controllers/admin_modules.php index a2168280..84fee25d 100644 --- a/modules/gallery/controllers/admin_modules.php +++ b/modules/gallery/controllers/admin_modules.php @@ -76,21 +76,24 @@ class Admin_Modules_Controller extends Admin_Controller { continue; } - $desired = Input::instance()->post($module_name) == 1; - if ($info->active && !$desired && module::is_active($module_name)) { - $changes->deactivate[] = $module_name; - $deactivated_names[] = t($info->name); - module::deactivate($module_name); - } else if (!$info->active && $desired && !module::is_active($module_name)) { - $changes->activate[] = $module_name; - $activated_names[] = t($info->name); - - if (module::is_installed($module_name)) { - module::upgrade($module_name); - } else { - module::install($module_name); + try { + $desired = Input::instance()->post($module_name) == 1; + if ($info->active && !$desired && module::is_active($module_name)) { + module::deactivate($module_name); + $changes->deactivate[] = $module_name; + $deactivated_names[] = t($info->name); + } else if (!$info->active && $desired && !module::is_active($module_name)) { + if (module::is_installed($module_name)) { + module::upgrade($module_name); + } else { + module::install($module_name); + } + module::activate($module_name); + $changes->activate[] = $module_name; + $activated_names[] = t($info->name); } - module::activate($module_name); + } catch (Exception $e) { + Kohana_Log::add("error", (string)$e); } } diff --git a/modules/gallery/libraries/IdentityProvider.php b/modules/gallery/libraries/IdentityProvider.php index f7be33e3..e07838d1 100644 --- a/modules/gallery/libraries/IdentityProvider.php +++ b/modules/gallery/libraries/IdentityProvider.php @@ -71,19 +71,35 @@ class IdentityProvider_Core { module::uninstall($current_provider); } - IdentityProvider::reset(); - $provider = new IdentityProvider($new_provider); - - module::set_var("gallery", "identity_provider", $new_provider); - - if (method_exists("{$new_provider}_installer", "initialize")) { - call_user_func("{$new_provider}_installer::initialize"); + try { + IdentityProvider::reset(); + $provider = new IdentityProvider($new_provider); + + module::set_var("gallery", "identity_provider", $new_provider); + + if (method_exists("{$new_provider}_installer", "initialize")) { + call_user_func("{$new_provider}_installer::initialize"); + } + + module::event("identity_provider_changed", $current_provider, $new_provider); + + auth::login($provider->admin_user()); + Session::instance()->regenerate(); + } catch (Exception $e) { + // Make sure new provider is not in the database + module::uninstall($new_provider); + + // Lets reset to the current provider so that the gallery installation is still + // working. + module::set_var("gallery", "identity_provider", null); + IdentityProvider::change_provider($current_provider); + module::activate($current_provider); + message::error( + t("Error attempting to enable \"%new_provider\" identity provider, " . + "reverted to \"%old_provider\" identity provider", + array("new_provider" => $new_provider, "old_provider" => $current_provider))); + throw $e; } - - module::event("identity_provider_changed", $current_provider, $new_provider); - - auth::login($provider->admin_user()); - Session::instance()->regenerate(); } /** -- cgit v1.2.3 From b01fce613b8df5f23a3a257f5680433a8224247d Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 14:16:41 -0800 Subject: Remove the g-right class on groups element on the manage user/groups page. fixes ticket #911 --- modules/user/views/admin_users.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index 45d04916..270a7207 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -107,7 +107,7 @@ -
+
" class="g-dialog-link g-button g-right ui-icon-left ui-state-default ui-corner-all" title="for_html_attr() ?>"> -- cgit v1.2.3 From ff5ccf0fb34a19306e4177a9a2f2c4c6f503cb1a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 14:38:58 -0800 Subject: Specify the height and overflow-y on l10n-client translation element. fixes ticket #899. --- modules/gallery/css/l10n_client.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/css/l10n_client.css b/modules/gallery/css/l10n_client.css index 3771c049..053b4432 100644 --- a/modules/gallery/css/l10n_client.css +++ b/modules/gallery/css/l10n_client.css @@ -184,7 +184,9 @@ } #l10n-client-string-editor .translation { - overflow:hidden; + overflow-y:auto; + overflow-x: hidden; + height: 20em; width:49%; float: right; } -- cgit v1.2.3 From ece403877fa0a8bf385a1c52d7be99b1e2b002f4 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 22 Jan 2010 18:12:30 -0800 Subject: If the userid/password combination, render the full page instead of just printing the form. Fixes ticket #980. --- modules/gallery/controllers/login.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/controllers/login.php b/modules/gallery/controllers/login.php index 75ee6b9c..cfccaf17 100644 --- a/modules/gallery/controllers/login.php +++ b/modules/gallery/controllers/login.php @@ -50,7 +50,11 @@ class Login_Controller extends Controller { if ($valid) { url::redirect(item::root()->abs_url()); } else { - print $form; + $view = new Theme_View("page.html", "other", "login"); + $view->page_title = t("Log in to Gallery"); + $view->content = new View("login_ajax.html"); + $view->content->form = $form; + print $view; } } -- cgit v1.2.3 From 06ef3885b30be843a7c86a93f5642680ab881b1c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 23 Jan 2010 09:23:08 -0800 Subject: Increase the size of the 'select photos' button so that it doesn't wrap and set the size of the underlying flash object. --- modules/gallery/views/form_uploadify.html.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php index f3b9c883..b3b81ecb 100644 --- a/modules/gallery/views/form_uploadify.html.php +++ b/modules/gallery/views/form_uploadify.html.php @@ -2,17 +2,21 @@ @@ -21,6 +25,8 @@ + \ No newline at end of file diff --git a/modules/recaptcha/helpers/recaptcha_event.php b/modules/recaptcha/helpers/recaptcha_event.php index e7ded3ab..a7f64bdd 100644 --- a/modules/recaptcha/helpers/recaptcha_event.php +++ b/modules/recaptcha/helpers/recaptcha_event.php @@ -18,6 +18,12 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class recaptcha_event_Core { + static function user_profile_contact_form($form) { + if (module::get_var("recaptcha", "public_key")) { + $form->message->recaptcha("recaptcha")->label("")->id("g-recaptcha"); + } + } + static function comment_add_form($form) { if (module::get_var("recaptcha", "public_key")) { $form->add_comment->recaptcha("recaptcha")->label("")->id("g-recaptcha"); -- cgit v1.2.3 From c39437a1929a3383e66f6bc8d6fc1a367de23f27 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 23 Jan 2010 23:52:29 -0800 Subject: Change the hover text to just display 'Your profile'. --- modules/gallery/views/login_current_user.html.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/gallery/views/login_current_user.html.php b/modules/gallery/views/login_current_user.html.php index 39f52b51..94525576 100644 --- a/modules/gallery/views/login_current_user.html.php +++ b/modules/gallery/views/login_current_user.html.php @@ -1,8 +1,7 @@
  • label->for_html() ?> - for_html_attr() : - t("Display your profile")->for_html_attr() ?> + for_html_attr() ?> html::mark_clean( "{$name}"))) ?>
  • -- cgit v1.2.3 From 3b8636e5298f61eee3d9953468ef648c36e64e5c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sat, 23 Jan 2010 23:53:16 -0800 Subject: Update the Xss_Security_Test and the Controller_Auth_Test. --- modules/gallery/tests/controller_auth_data.txt | 3 ++ modules/gallery/tests/xss_data.txt | 51 +++++++++++++++----------- 2 files changed, 32 insertions(+), 22 deletions(-) (limited to 'modules') diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt index beabee49..da7108d8 100644 --- a/modules/gallery/tests/controller_auth_data.txt +++ b/modules/gallery/tests/controller_auth_data.txt @@ -19,6 +19,9 @@ modules/gallery/controllers/quick.php form_edit modules/gallery/controllers/simple_uploader.php start DIRTY_AUTH modules/gallery/controllers/simple_uploader.php finish DIRTY_AUTH modules/gallery/controllers/upgrader.php index DIRTY_AUTH +modules/gallery/controllers/user_profile.php show DIRTY_CSRF|DIRTY_AUTH +modules/gallery/controllers/user_profile.php contact DIRTY_AUTH +modules/gallery/controllers/user_profile.php send DIRTY_AUTH modules/gallery/controllers/welcome_message.php index DIRTY_AUTH modules/rest/controllers/rest.php access_key DIRTY_CSRF|DIRTY_AUTH modules/rest/controllers/rest.php __call DIRTY_AUTH diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 1530c73e..a89725c0 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -43,6 +43,7 @@ modules/g2_import/views/admin_g2_import.html.php 30 DIRTY $form modules/gallery/views/admin_advanced_settings.html.php 21 DIRTY_ATTR text::alternate("g-odd","g-even") modules/gallery/views/admin_advanced_settings.html.php 22 DIRTY $var->module_name modules/gallery/views/admin_block_log_entries.html.php 4 DIRTY_ATTR log::severity_class($entry->severity) +modules/gallery/views/admin_block_log_entries.html.php 5 DIRTY_JS user_profile::url($entryr->id) modules/gallery/views/admin_block_log_entries.html.php 6 DIRTY gallery::date_time($entry->timestamp) modules/gallery/views/admin_block_log_entries.html.php 7 DIRTY $entry->message modules/gallery/views/admin_block_log_entries.html.php 8 DIRTY $entry->html @@ -66,11 +67,6 @@ modules/gallery/views/admin_graphics_graphicsmagick.html.php 18 DIRTY $tk->e modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $is_active?" g-selected":"" modules/gallery/views/admin_graphics_imagemagick.html.php 2 DIRTY_ATTR $tk->installed?" g-installed-toolkit":" g-unavailable" modules/gallery/views/admin_graphics_imagemagick.html.php 18 DIRTY $tk->error -modules/gallery/views/admin_identity.html.php 43 DIRTY access::csrf_form_field() -modules/gallery/views/admin_identity.html.php 50 DIRTY_ATTR text::alternate("g-odd","g-even") -modules/gallery/views/admin_identity.html.php 52 DIRTY form::radio($data,$module_name,$module_name==$active) -modules/gallery/views/admin_identity_confirm.html.php 3 DIRTY access::csrf_form_field() -modules/gallery/views/admin_identity_confirm.html.php 4 DIRTY form::hidden("provider",$new_provider) modules/gallery/views/admin_languages.html.php 43 DIRTY access::csrf_form_field() modules/gallery/views/admin_languages.html.php 60 DIRTY_ATTR (isset($installed_locales[$code]))?"g-available":"" modules/gallery/views/admin_languages.html.php 60 DIRTY_ATTR ($default_locale==$code)?" g-selected":"" @@ -98,10 +94,16 @@ modules/gallery/views/admin_maintenance.html.php 158 DIRTY $task- modules/gallery/views/admin_maintenance_show_log.html.php 8 DIRTY_JS url::site("admin/maintenance/save_log/$task->id?csrf=$csrf") modules/gallery/views/admin_maintenance_show_log.html.php 13 DIRTY $task->name modules/gallery/views/admin_maintenance_task.html.php 55 DIRTY $task->name -modules/gallery/views/admin_modules.html.php 10 DIRTY access::csrf_form_field() -modules/gallery/views/admin_modules.html.php 19 DIRTY_ATTR text::alternate("g-odd","g-even") -modules/gallery/views/admin_modules.html.php 22 DIRTY form::checkbox($data,'1',module::is_active($module_name)) -modules/gallery/views/admin_modules.html.php 24 DIRTY $module_info->version +modules/gallery/views/admin_modules.html.php 25 DIRTY_JS t("Continue") +modules/gallery/views/admin_modules.html.php 35 DIRTY_JS t("Continue") +modules/gallery/views/admin_modules.html.php 51 DIRTY access::csrf_form_field() +modules/gallery/views/admin_modules.html.php 60 DIRTY_ATTR text::alternate("g-odd","g-even") +modules/gallery/views/admin_modules.html.php 63 DIRTY form::checkbox($data,'1',module::is_active($module_name)) +modules/gallery/views/admin_modules.html.php 65 DIRTY $module_info->version +modules/gallery/views/admin_modules_confirm.html.php 11 DIRTY_ATTR $class +modules/gallery/views/admin_modules_confirm.html.php 11 DIRTY $message +modules/gallery/views/admin_modules_confirm.html.php 16 DIRTY access::csrf_form_field() +modules/gallery/views/admin_modules_confirm.html.php 18 DIRTY form::hidden($module,1) modules/gallery/views/admin_sidebar.html.php 50 DIRTY $available modules/gallery/views/admin_sidebar.html.php 58 DIRTY $active modules/gallery/views/admin_sidebar_blocks.html.php 4 DIRTY_ATTR $ref @@ -118,11 +120,11 @@ modules/gallery/views/admin_themes.html.php 62 DIRTY $theme modules/gallery/views/admin_themes.html.php 76 DIRTY $info->name modules/gallery/views/admin_themes.html.php 78 DIRTY $info->description modules/gallery/views/admin_themes_preview.html.php 7 DIRTY_ATTR $url -modules/gallery/views/form_uploadify.html.php 24 DIRTY_JS url::file("lib/uploadify/uploadify.swf") -modules/gallery/views/form_uploadify.html.php 25 DIRTY_JS url::site("simple_uploader/add_photo/{$album->id}") -modules/gallery/views/form_uploadify.html.php 29 DIRTY_JS url::file("lib/uploadify/cancel.png") -modules/gallery/views/form_uploadify.html.php 30 DIRTY_JS $simultaneous_upload_limit -modules/gallery/views/form_uploadify.html.php 55 DIRTY_JS t("Completed") +modules/gallery/views/form_uploadify.html.php 30 DIRTY_JS url::file("lib/uploadify/uploadify.swf") +modules/gallery/views/form_uploadify.html.php 31 DIRTY_JS url::site("simple_uploader/add_photo/{$album->id}") +modules/gallery/views/form_uploadify.html.php 35 DIRTY_JS url::file("lib/uploadify/cancel.png") +modules/gallery/views/form_uploadify.html.php 36 DIRTY_JS $simultaneous_upload_limit +modules/gallery/views/form_uploadify.html.php 61 DIRTY_JS t("Completed") modules/gallery/views/in_place_edit.html.php 2 DIRTY form::open($action,array("method"=>"post","id"=>"g-in-place-edit-form","class"=>"g-short-form"),$hidden) modules/gallery/views/in_place_edit.html.php 5 DIRTY form::input("input",$form["input"]," class=\"textbox\"") modules/gallery/views/in_place_edit.html.php 12 DIRTY form::close() @@ -217,6 +219,10 @@ modules/gallery/views/upgrader.html.php 77 DIRTY $modul modules/gallery/views/upgrader.html.php 99 DIRTY_ATTR $done?"muted":"" modules/gallery/views/upgrader.html.php 102 DIRTY_ATTR $done?"muted":"" modules/gallery/views/user_languages_block.html.php 2 DIRTY form::dropdown("g-select-session-locale",$installed_locales,$selected) +modules/gallery/views/user_profile.html.php 35 DIRTY_ATTR $height +modules/gallery/views/user_profile.html.php 44 DIRTY $field +modules/gallery/views/user_profile.html.php 45 DIRTY $value +modules/gallery/views/user_profile.html.php 65 DIRTY_JS $return->for_html_attr() modules/image_block/views/image_block_block.html.php 3 DIRTY_JS $item->url() modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"g-thumbnail")) modules/info/views/info_block.html.php 22 DIRTY date("M j, Y H:i:s",$item->captured) @@ -326,14 +332,15 @@ themes/admin_wind/views/admin.html.php 16 DIRTY_JS $theme themes/admin_wind/views/admin.html.php 33 DIRTY $theme->admin_head() themes/admin_wind/views/admin.html.php 37 DIRTY $theme->admin_page_top() themes/admin_wind/views/admin.html.php 45 DIRTY $theme->admin_header_top() -themes/admin_wind/views/admin.html.php 60 DIRTY_JS item::root()->url() -themes/admin_wind/views/admin.html.php 64 DIRTY $theme->admin_menu() -themes/admin_wind/views/admin.html.php 66 DIRTY $theme->admin_header_bottom() -themes/admin_wind/views/admin.html.php 73 DIRTY $content -themes/admin_wind/views/admin.html.php 79 DIRTY $sidebar -themes/admin_wind/views/admin.html.php 84 DIRTY $theme->admin_footer() -themes/admin_wind/views/admin.html.php 86 DIRTY $theme->admin_credits() -themes/admin_wind/views/admin.html.php 90 DIRTY $theme->admin_page_bottom() +themes/admin_wind/views/admin.html.php 46 DIRTY_JS item::root()->url() +themes/admin_wind/views/admin.html.php 49 DIRTY $theme->user_menu() +themes/admin_wind/views/admin.html.php 51 DIRTY $theme->admin_menu() +themes/admin_wind/views/admin.html.php 53 DIRTY $theme->admin_header_bottom() +themes/admin_wind/views/admin.html.php 60 DIRTY $content +themes/admin_wind/views/admin.html.php 66 DIRTY $sidebar +themes/admin_wind/views/admin.html.php 71 DIRTY $theme->admin_footer() +themes/admin_wind/views/admin.html.php 73 DIRTY $theme->admin_credits() +themes/admin_wind/views/admin.html.php 77 DIRTY $theme->admin_page_bottom() themes/admin_wind/views/block.html.php 3 DIRTY_ATTR $anchor themes/admin_wind/views/block.html.php 5 DIRTY $id themes/admin_wind/views/block.html.php 5 DIRTY_ATTR $css_id -- cgit v1.2.3