summaryrefslogtreecommitdiff
path: root/modules/user/models
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user/models')
-rw-r--r--modules/user/models/group.php8
-rw-r--r--modules/user/models/user.php8
2 files changed, 14 insertions, 2 deletions
diff --git a/modules/user/models/group.php b/modules/user/models/group.php
index 4409dcb8..0088ec31 100644
--- a/modules/user/models/group.php
+++ b/modules/user/models/group.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2011 Bharat Mediratta
+ * Copyright (C) 2000-2012 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
@@ -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..6b2cd03b 100644
--- a/modules/user/models/user.php
+++ b/modules/user/models/user.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2011 Bharat Mediratta
+ * Copyright (C) 2000-2012 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
@@ -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;
}