mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
Added url for applying for api-tokens
This commit is contained in:
@@ -12,6 +12,7 @@ var ObjectId = mongojs.ObjectId;
|
||||
|
||||
db.collection("chat_logs").createIndex({ "createdAt": 1 }, { expireAfterSeconds: 600 });
|
||||
db.collection("timeout_api").createIndex({ "createdAt": 1 }, { expireAfterSeconds: 5 });
|
||||
db.collection("api_links").createIndex({ "createdAt": 1 }, { expireAfterSeconds: 86400 });
|
||||
db.on('connected', function(err) {
|
||||
console.log("connected");
|
||||
})
|
||||
|
||||
@@ -9,7 +9,7 @@ function thumbnail(msg, coll, guid, offline, socket) {
|
||||
if(msg.thumbnail.substring(0,2) != "//") msg.thumbnail = "//" + msg.thumbnail;
|
||||
var channel = msg.channel.toLowerCase();
|
||||
var hash = Functions.hash_pass(Functions.decrypt_string(socket.zoff_id, msg.adminpass));
|
||||
db.collection(channel + "_settings").update({id: "configs"}, function(err, docs){
|
||||
db.collection(channel + "_settings").find({id: "config"}, function(err, docs){
|
||||
if(docs.length > 0 && (docs[0].userpass == undefined || docs[0].userpass == "" || (msg.hasOwnProperty('pass') && docs[0].userpass == Functions.decrypt_string(socketid, msg.pass)))) {
|
||||
if(docs !== null && docs.length !== 0 && docs[0].adminpass !== "" && docs[0].adminpass == hash){
|
||||
db.collection("suggested_thumbnails").update({channel: channel}, {$set:{thumbnail: msg.thumbnail}}, {upsert:true}, function(err, docs){
|
||||
@@ -35,7 +35,7 @@ function description(msg, coll, guid, offline, socket) {
|
||||
}
|
||||
var channel = msg.channel.toLowerCase();
|
||||
var hash = Functions.hash_pass(Functions.decrypt_string(socket.zoff_id, msg.adminpass));
|
||||
db.collection(channel + "_settings").update({id: "configs"}, function(err, docs){
|
||||
db.collection(channel + "_settings").find({id: "config"}, function(err, docs){
|
||||
if(docs.length > 0 && (docs[0].userpass == undefined || docs[0].userpass == "" || (msg.hasOwnProperty('pass') && docs[0].userpass == Functions.decrypt_string(socketid, msg.pass)))) {
|
||||
if(docs !== null && docs.length !== 0 && docs[0].adminpass !== "" && docs[0].adminpass == hash){
|
||||
db.collection("suggested_descriptions").update({channel: channel}, {$set:{description: msg.description}}, {upsert:true}, function(err, docs){
|
||||
|
||||
Reference in New Issue
Block a user