thomascube
2009-07-02 07722a2d1d9e4ff6e04a9b34a8ba42e4c4a66606
Create rcube_user instance early to enable the following plugin hooks to use it

1 files modified
6 ■■■■ changed files
program/include/rcube_user.php 6 ●●●● patch | view | raw | blame | history
program/include/rcube_user.php
@@ -386,6 +386,10 @@
    if ($user_id = $dbh->insert_id(get_sequence_name('users')))
    {
      // create rcube_user instance to make plugin hooks work
      $user_instance = new rcube_user($user_id);
      $rcmail->user = $user_instance;
      $mail_domain = $rcmail->config->mail_domain($host);
      if ($user_email=='')
@@ -449,7 +453,7 @@
        'message' => "Failed to create new user"), true, false);
    }
    
    return $user_id ? new rcube_user($user_id) : false;
    return $user_id ? $user_instance : false;
  }