From dcfb5472cc5bfc9072ef89466baa34ea3d183df2 Mon Sep 17 00:00:00 2001 From: Bsian Date: Mon, 23 Dec 2019 23:28:48 +0000 Subject: [PATCH] Perms stuff --- src/commands/resetpassword.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/resetpassword.ts b/src/commands/resetpassword.ts index ef0a8c6..2ec50a1 100644 --- a/src/commands/resetpassword.ts +++ b/src/commands/resetpassword.ts @@ -19,10 +19,11 @@ export default class ResetPassword extends Command { if (!args[0]) return this.client.commands.get('help').run(message, [this.name]); const account = await this.client.db.Account.findOne({ $or: [{ username: args[0] }, { userID: args[0] }, { emailAddress: args[0] }] }); if (!account) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Account not found***`); + if (account.root) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Permission denied***`); const msg = await message.channel.createMessage(`${this.client.stores.emojis.loading} ***Resetting password for ${account.username}...***`); const tempPass = this.client.util.randomPassword(); - await this.client.util.exec(`echo '${account.username}:${tempPass}' | sudo chpasswd`); + await this.client.util.exec(`echo '${account.username}:${tempPass}' | chpasswd`); let completeMessage = `${this.client.stores.emojis.success} ***Password for ${account.userID} reset to \`${tempPass}\`***`; const dmChannel = await this.client.getDMChannel(account.userID);