summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-01-22 09:39:29 -0800
committerTim Almdal <tnalmdal@shaw.ca>2010-01-22 09:39:29 -0800
commit603c3049a1ce7249c55ff8338fc3ea69323f0cb3 (patch)
tree66fe177dbd83a1bce625bd1c8b12bc4feded3d1f /modules/comment
parent0da5d9e606fba5b6dc6137812df32cd1d0f5750f (diff)
Treat identity providers just like other modules and use the admin_module to
install and switch to a different identity provider.
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/helpers/comment_event.php18
1 files changed, 10 insertions, 8 deletions
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) {