From c3f6867f4b62761f8af5ca4c8d481b87675e48f2 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sun, 3 May 2020 17:48:40 -0400 Subject: [PATCH] set ram notification threshold default on account creation --- src/class/Util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/class/Util.ts b/src/class/Util.ts index f834f51..11e61d3 100644 --- a/src/class/Util.ts +++ b/src/class/Util.ts @@ -150,9 +150,10 @@ export default class Util { public async createAccount(hash: string, etcPasswd: string, username: string, userID: string, emailAddress: string, moderatorID: string, code: string): Promise { await this.exec(`useradd -m -p ${hash} -c ${etcPasswd} -s /bin/bash ${username}`); await this.exec(`chage -d0 ${username}`); + const tier = await this.client.db.Tier.findOne({ id: 1 }); const account = new this.client.db.Account({ - username, userID, emailAddress, createdBy: moderatorID, createdAt: new Date(), locked: false, tier: 1, supportKey: code, ssInit: false, homepath: `/home/${username}`, + username, userID, emailAddress, createdBy: moderatorID, ramLimitNotification: tier.resourceLimits.ram - 20, createdAt: new Date(), locked: false, tier: 1, supportKey: code, ssInit: false, homepath: `/home/${username}`, }); return account.save(); }