Changeset 1010

Show
Ignore:
Timestamp:
03/07/07 16:38:42 (2 years ago)
Author:
ben
Message:

Communities are either set to the news user to the -1 (unclaimed) user when their owner is removed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/community/lib.php

    r1009 r1010  
    7373 
    7474function community_user_delete($object_type, $event, $object) { 
    75     global $CFG, $data
     75    global $CFG, $data, $messages
    7676    if (!empty($object->ident) && $object_type == "user" && $event == "delete") { 
    7777        if ($newsuser = user_info_username("info","news")) { 
     
    8484                $community->owner = $newsuser; 
    8585                update_record('users',$community); 
     86                if ($newsuser != -1) { 
     87                    $messages[] = sprintf(__gettext("Community %s was returned to the news user."),$community->username); 
     88                } else { 
     89                    $messages[] = sprintf(__gettext("Community %s is now owned by -1 (nobody)."),$community->username); 
     90                } 
    8691            } 
    8792        }