|
@@ -193,12 +193,6 @@ func nsDropHandler(server *Server, client *Client, command, params string, rb *R
|
193
|
193
|
func nsGhostHandler(server *Server, client *Client, command, params string, rb *ResponseBuffer) {
|
194
|
194
|
nick, _ := utils.ExtractParam(params)
|
195
|
195
|
|
196
|
|
- account := client.Account()
|
197
|
|
- if account == "" || server.accounts.NickToAccount(nick) != account {
|
198
|
|
- nsNotice(rb, client.t("You don't own that nick"))
|
199
|
|
- return
|
200
|
|
- }
|
201
|
|
-
|
202
|
196
|
ghost := server.clients.Get(nick)
|
203
|
197
|
if ghost == nil {
|
204
|
198
|
nsNotice(rb, client.t("No such nick"))
|
|
@@ -208,6 +202,17 @@ func nsGhostHandler(server *Server, client *Client, command, params string, rb *
|
208
|
202
|
return
|
209
|
203
|
}
|
210
|
204
|
|
|
205
|
+ authorized := false
|
|
206
|
+ account := client.Account()
|
|
207
|
+ if account != "" {
|
|
208
|
+ // the user must either own the nick, or the target client
|
|
209
|
+ authorized = (server.accounts.NickToAccount(nick) == account) || (ghost.Account() == account)
|
|
210
|
+ }
|
|
211
|
+ if !authorized {
|
|
212
|
+ nsNotice(rb, client.t("You don't own that nick"))
|
|
213
|
+ return
|
|
214
|
+ }
|
|
215
|
+
|
211
|
216
|
ghost.Quit(fmt.Sprintf(ghost.t("GHOSTed by %s"), client.Nick()))
|
212
|
217
|
ghost.destroy(false)
|
213
|
218
|
}
|