Cleanup getBanInfo and cmdJudgeLog
- Removes unneeded parentheses from AOClient::cmdJudgeLog() - Removes duplicate code in DBManager::getBanInfo()
This commit is contained in:
parent
bd0efe40f6
commit
a2013aa32e
@ -1289,7 +1289,7 @@ void AOClient::cmdJudgeLog(int argc, QStringList argv)
|
||||
}
|
||||
QString message = area->judgelog.join("\n");
|
||||
//Judgelog contains an IPID, so we shouldn't send that unless the caller has appropriate permissions
|
||||
if (((checkAuth(ACLFlags.value("KICK"))) == 1) || (((checkAuth(ACLFlags.value("BAN"))) == 1))) {
|
||||
if (checkAuth(ACLFlags.value("KICK")) == 1 || checkAuth(ACLFlags.value("BAN")) == 1) {
|
||||
sendServerMessage(message);
|
||||
}
|
||||
else {
|
||||
|
@ -332,26 +332,21 @@ QList<DBManager::BanInfo> DBManager::getBanInfo(QString lookup_type, QString id)
|
||||
QList<BanInfo> invalid;
|
||||
if (lookup_type == "banid") {
|
||||
query.prepare("SELECT * FROM BANS WHERE ID = ?");
|
||||
query.addBindValue(id);
|
||||
query.setForwardOnly(true);
|
||||
query.exec();
|
||||
}
|
||||
else if (lookup_type == "hdid") {
|
||||
query.prepare("SELECT * FROM BANS WHERE HDID = ?");
|
||||
query.addBindValue(id);
|
||||
query.setForwardOnly(true);
|
||||
query.exec();
|
||||
}
|
||||
else if (lookup_type == "ipid") {
|
||||
query.prepare("SELECT * FROM BANS WHERE IPID = ?");
|
||||
query.addBindValue(id);
|
||||
query.setForwardOnly(true);
|
||||
query.exec();
|
||||
}
|
||||
else {
|
||||
qCritical("Invalid ban lookup type!");
|
||||
return invalid;
|
||||
}
|
||||
query.addBindValue(id);
|
||||
query.setForwardOnly(true);
|
||||
query.exec();
|
||||
|
||||
while (query.next()) {
|
||||
BanInfo ban;
|
||||
ban.ipid = query.value(0).toString();
|
||||
|
Loading…
Reference in New Issue
Block a user