From dc21cf36b606048dc24532407d39bc8f5b4211fa Mon Sep 17 00:00:00 2001
From: Bharat Mediratta 
Date: Sun, 20 Mar 2011 10:25:59 -0700
Subject: Change the $thumb_proportions variable to be a theme callback which
 takes an item as an argument.  This will let us figure out proportions in the
 case where a module has defined custom thumbnail sizes.
---
 modules/gallery/libraries/Theme_View.php | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
(limited to 'modules')
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index a507e9c8..d0b35d3e 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -42,9 +42,6 @@ class Theme_View_Core extends Gallery_View {
                             "page_type" => $page_type,
                             "page_subtype" => $page_subtype,
                             "page_title" => null));
-    if ($page_type == "collection") {
-      $this->set_global("thumb_proportion", $this->thumb_proportion());
-    }
 
     if (module::get_var("gallery", "maintenance_mode", 0)) {
       if (identity::active_user()->admin) {
@@ -58,10 +55,17 @@ class Theme_View_Core extends Gallery_View {
    * Proportion of the current thumb_size's to default
    * @return int
    */
-  public function thumb_proportion() {
-    // @TODO change the 200 to a theme supplied value when and if we come up with an
-    // API to allow the theme to set defaults.
-    return module::get_var("gallery", "thumb_size", 200) / 200;
+  public function thumb_proportion($item) {
+    // By default we have a globally fixed thumbnail size In core code, we just return a fixed
+    // proportion based on the global thumbnail size, but since modules can override that, we
+    // return the actual proportions when we have them.
+    if ($item->has_thumb()) {
+      return max($item->thumb_width, $item->thumb_height) / 200;
+    } else {
+      // @TODO change the 200 to a theme supplied value when and if we come up with an
+      // API to allow the theme to set defaults.
+      return module::get_var("gallery", "thumb_size", 200) / 200;
+    }
   }
 
   public function item() {
-- 
cgit v1.2.3
From 66a6986d37f79d82ef56b0d666d504e0895feaaa Mon Sep 17 00:00:00 2001
From: Tim Almdal 
Date: Thu, 4 Aug 2011 20:29:06 -0700
Subject: Patch for ticket #1769. Remove the rows in groups_users when the user
 or the group is deleted.
---
 modules/user/models/group.php | 6 ++++++
 modules/user/models/user.php  | 6 ++++++
 2 files changed, 12 insertions(+)
(limited to 'modules')
diff --git a/modules/user/models/group.php b/modules/user/models/group.php
index 4409dcb8..46642203 100644
--- a/modules/user/models/group.php
+++ b/modules/user/models/group.php
@@ -28,6 +28,12 @@ class Group_Model_Core extends ORM implements Group_Definition {
     $old = clone $this;
     module::event("group_before_delete", $this);
     parent::delete($id);
+
+    db::build()
+      ->delete("groups_users")
+      ->where("group_id", "=", empty($id) ? $old->id : $id)
+      ->execute();
+
     module::event("group_deleted", $old);
     $this->users_cache = null;
   }
diff --git a/modules/user/models/user.php b/modules/user/models/user.php
index a8a3a0e7..8fe0a87b 100644
--- a/modules/user/models/user.php
+++ b/modules/user/models/user.php
@@ -43,6 +43,12 @@ class User_Model_Core extends ORM implements User_Definition {
     $old = clone $this;
     module::event("user_before_delete", $this);
     parent::delete($id);
+
+    db::build()
+      ->delete("groups_users")
+      ->where("user_id", "=", empty($id) ? $old->id : $id)
+      ->execute();
+
     module::event("user_deleted", $old);
     $this->groups_cache = null;
   }
-- 
cgit v1.2.3
From eb5c7e5e18076eeeff0193da4add214433ccb4a1 Mon Sep 17 00:00:00 2001
From: Tim Almdal 
Date: Thu, 4 Aug 2011 21:00:21 -0700
Subject: Patch for ticket #1765. Provide the full site url for the the gallery
 link instead of trying to use url_base for the hidden link and the
 presentation text.
---
 modules/user/views/reset_password.html.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'modules')
diff --git a/modules/user/views/reset_password.html.php b/modules/user/views/reset_password.html.php
index 3afca881..d939ad42 100644
--- a/modules/user/views/reset_password.html.php
+++ b/modules/user/views/reset_password.html.php
@@ -9,8 +9,9 @@
       = t("Hello, %name,", array("name" => $user->full_name ? $user->full_name : $user->name)) ?>
     
     
-  = t("We received a request to reset your password for %site_url.  If you made this request, you can confirm it by clicking this link.  If you didn't request this password reset, it's ok to ignore this mail.",
-        array("site_url" => html::mark_clean(url::base(false, "http")),
+  = t("We received a request to reset your password for %base_url.  If you made this request, you can confirm it by clicking this link.  If you didn't request this password reset, it's ok to ignore this mail.",
+        array("site_url" => html::mark_clean(url::abs_site("/")),
+              "base_url" => html::mark_clean(url::base(false)),
               "confirm_url" => $confirm_url)) ?>