/**
  * Updates this application by leader.
  * 
  * @param	integer		$newStatus
  * @param	string		$reply
  */
 public function updateByLeader($newStatus = 0, $reply = '', $groupLeaderID = 0)
 {
     // update
     $sql = "UPDATE\twcf" . WCF_N . "_group_application\n\t\t\tSET\tapplicationStatus = " . $newStatus . ",\n\t\t\t\treply = '" . escapeString($reply) . "',\n\t\t\t\tgroupLeaderID = " . $groupLeaderID . "\n\t\t\tWHERE\tapplicationID = " . $this->applicationID;
     WCF::getDB()->sendQuery($sql);
     // set data
     $this->data['reply'] = $reply;
     // set status
     // declined
     if ($newStatus == 2 && $this->applicationStatus != 2) {
         // remove user from group
         require_once WCF_DIR . 'lib/data/user/UserEditor.class.php';
         $user = new UserEditor($this->userID);
         $user->removeFromGroup($this->groupID);
         $user->resetSession();
         // send e-mail notification
         if ($this->enableNotification) {
             $this->sendNotification($user, 'declined');
         }
     }
     // accepted
     if ($newStatus == 3 && $this->applicationStatus != 3) {
         // add user to group
         require_once WCF_DIR . 'lib/data/user/UserEditor.class.php';
         $user = new UserEditor($this->userID);
         $user->addToGroup($this->groupID);
         $user->resetSession();
         if ($this->enableNotification) {
             $this->sendNotification($user, 'accepted');
         }
     }
 }