From ce39dc768c63fa5631450918180c1602363b7810 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 22 Feb 2010 21:21:04 -0800 Subject: Normalize invalid/missing G2 email addresses --- modules/g2_import/helpers/g2_import.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index faf08291..9a91770a 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -304,20 +304,27 @@ class g2_import_Core { if ($user) { $message = t("Loaded existing user: '%name'.", array("name" => $user->name)); } else { + $email = $g2_user->getEmail(); + if (empty($email) || !valid::email($email)) { + $email = "unknown@unknown.com"; + } $user = identity::create_user($g2_user->getUsername(), $g2_user->getfullname(), // Note: The API expects a password in cleartext. // Just use the hashed password as an unpredictable // value here. The user will have to reset the password. - $g2_user->getHashedPassword(), $g2_user->getEmail()); + $g2_user->getHashedPassword(), $email); if (class_exists("User_Model") && $user instanceof User_Model) { // This will work if G2's password is a PasswordHash password as well. $user->hashed_password = $g2_user->getHashedPassword(); } $message = t("Created user: '%name'.", array("name" => $user->name)); + if ($email == "unknown@unknown.com") { + $message .= t("\n\tFixed invalid email (was '%invalid_email')", + array("invalid_email" => $g2_user->getEmail())); + } } $user->hashed_password = $g2_user->getHashedPassword(); - $user->email = $g2_user->getEmail() ? $g2_user->getEmail() : "unknown@unknown.com"; $user->locale = $g2_user->getLanguage(); foreach ($g2_groups as $g2_group_id => $g2_group_name) { if ($g2_group_id == $g2_admin_group_id) { -- cgit v1.2.3 From adb1db6b7d1d10772b893047d8297a89ca9c615e Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Mon, 22 Feb 2010 22:00:23 -0800 Subject: Fix typo in selector expression. The handling of view-only albums is still not great, but at least the code is closer to doing what it's supposed to. --- modules/organize/js/organize.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/organize/js/organize.js b/modules/organize/js/organize.js index 5b90f402..5a483caf 100644 --- a/modules/organize/js/organize.js +++ b/modules/organize/js/organize.js @@ -270,7 +270,7 @@ if ($(event.currentTarget).hasClass("ui-state-focus")) { return; } - var parent = $(event.currentTarget).parents(".g-organize-branch"); + var parent = $(event.currentTarget).parents(".g-organize-album"); if ($(parent).hasClass("g-view-only")) { return; } -- cgit v1.2.3 From 6afc5ccf5c5d70b3aef4024f892141a07779c25f Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Tue, 23 Feb 2010 10:02:27 -0800 Subject: Fix translation cache for installations with 0 translations in the DB. --- modules/gallery/libraries/Gallery_I18n.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/libraries/Gallery_I18n.php b/modules/gallery/libraries/Gallery_I18n.php index 0e9c0bdc..f1e77744 100644 --- a/modules/gallery/libraries/Gallery_I18n.php +++ b/modules/gallery/libraries/Gallery_I18n.php @@ -166,7 +166,8 @@ class Gallery_I18n_Core { $cache_key = "translation|" . $locale; $cache = Cache::instance(); $translations = $cache->get($cache_key); - if (empty($translations)) { + if (!isset($translations) || !is_array($translations)) { + $translations = array(); foreach (db::build() ->select("key", "translation") ->from("incoming_translations") -- cgit v1.2.3