Skip to content

Commit

Permalink
user: comment out unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Feb 22, 2024
1 parent cbd6bfe commit f972d58
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions lib/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ class User {
}
}

async get_perms(user_id) {
return await Mysql.execute(
`
SELECT ${getPermFields()} FROM nt_perm
WHERE deleted=0
AND nt_user_id = ?`,
[user_id],
)
}
// async get_perms(user_id) {
// return await Mysql.execute(
// `
// SELECT ${getPermFields()} FROM nt_perm
// WHERE deleted=0
// AND nt_user_id = ?`,
// [user_id],
// )
// }

generateSalt(length = 16) {
const chars = Array.from({ length: 87 }, (_, i) =>
Expand Down Expand Up @@ -152,23 +152,12 @@ class User {

return false
}

async getSession(sessionId) {
let query = `SELECT s.*
FROM nt_user_session s
LEFT JOIN nt_user u ON s.nt_user_id = u.nt_user_id
WHERE u.deleted=0
AND s.nt_user_session = ?`

const session = await Mysql.execute(query, [sessionId])
if (this.debug) console.log(session)
return session[0]
}
}

module.exports = new User()
module.exports._mysql = Mysql

/*
function getPermFields() {
return (
`nt_perm.` +
Expand Down Expand Up @@ -200,3 +189,4 @@ function getPermFields() {
].join(`, nt_perm.`)
)
}
*/

0 comments on commit f972d58

Please sign in to comment.