Beispiel #1
0
 /**
  * Method is called after user data is deleted from the database
  *
  * @param   array    $user     holds the user data
  * @param   boolean  $success  true if user was succesfully stored in the database
  * @param   string   $msg      message
  * @return  boolean  True on success
  */
 public function onAfterDeleteUser($user, $succes, $msg)
 {
     $xprofile = \Hubzero\User\Profile::getInstance($user['id']);
     // remove user from groups
     \Hubzero\User\Helper::removeUserFromGroups($user['id']);
     if (is_object($xprofile)) {
         $xprofile->delete();
     }
     \Hubzero\Auth\Link::delete_by_user_id($user['id']);
     // Check if quota exists for the user
     require_once PATH_CORE . DS . 'components' . DS . 'com_members' . DS . 'tables' . DS . 'users_quotas.php';
     $quota = new \Components\Members\Tables\UsersQuotas($this->database);
     $quota->load(array('user_id' => $user['id']));
     if ($quota->id) {
         $quota->delete();
     }
     return true;
 }
Beispiel #2
0
 /**
  * Method is called after user data is deleted from the database
  *
  * @param   array    $user     holds the user data
  * @param   boolean  $success  true if user was succesfully stored in the database
  * @param   string   $msg      message
  * @return  boolean  True on success
  */
 public function onAfterDeleteUser($user, $success, $msg)
 {
     $xprofile = \Hubzero\User\Profile::getInstance($user['id']);
     // remove user from groups
     \Hubzero\User\Helper::removeUserFromGroups($user['id']);
     if (is_object($xprofile)) {
         $xprofile->delete();
     }
     \Hubzero\Auth\Link::delete_by_user_id($user['id']);
     // Check if quota exists for the user
     require_once PATH_CORE . DS . 'components' . DS . 'com_members' . DS . 'models' . DS . 'quota.php';
     $quota = Components\Members\Models\Quota::all()->whereEquals('user_id', $user['id'])->row();
     if ($quota->get('id')) {
         $quota->destroy();
     }
     if ($success) {
         Event::trigger('members.onMemberAfterDelete', array($user, $success, $msg));
     }
     return true;
 }