Version 0.6.1 - Ajout du clear token
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Neutral/pipeline/head This commit looks good
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Neutral/pipeline/head This commit looks good
				
			This commit is contained in:
		@@ -187,6 +187,11 @@ module.exports.serverIO = function(server) {
 | 
				
			|||||||
                PostRequest("US_EDIT", async (settings) => {
 | 
					                PostRequest("US_EDIT", async (settings) => {
 | 
				
			||||||
                    PostAnswer("US_EDIT", await users.editUser(settings))
 | 
					                    PostAnswer("US_EDIT", await users.editUser(settings))
 | 
				
			||||||
                })
 | 
					                })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                PostRequest("US_CLEAR_TOKENS", async (settings) => {
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
 | 
					                    PostAnswer("US_CLEAR_TOKENS", await users.clearTokens(settings))
 | 
				
			||||||
 | 
					                })
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if(user.checkPermission("SETTINGS")) {
 | 
					            if(user.checkPermission("SETTINGS")) {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								bin/users.js
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								bin/users.js
									
									
									
									
									
								
							@@ -340,6 +340,12 @@ module.exports.User =  class {
 | 
				
			|||||||
        this.register()
 | 
					        this.register()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    clearTokens() {
 | 
				
			||||||
 | 
					        this.#sync()
 | 
				
			||||||
 | 
					        this.tokens = []
 | 
				
			||||||
 | 
					        this.register()
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #sync() {
 | 
					    #sync() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for(var userGet of usersList.keys()) {
 | 
					        for(var userGet of usersList.keys()) {
 | 
				
			||||||
@@ -459,6 +465,12 @@ module.exports.editUser = function(settings) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					module.exports.clearTokens = function(username) {
 | 
				
			||||||
 | 
					   
 | 
				
			||||||
 | 
					    const user = this.fetchUsers().get(username)
 | 
				
			||||||
 | 
					    user.clearTokens()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 
 | 
					 * 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "neutral",
 | 
					  "name": "neutral",
 | 
				
			||||||
  "version": "0.6.0",
 | 
					  "version": "0.6.1",
 | 
				
			||||||
  "description": "Panel d'administration de Raphix",
 | 
					  "description": "Panel d'administration de Raphix",
 | 
				
			||||||
  "main": "index.js",
 | 
					  "main": "index.js",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1073,6 +1073,17 @@ class User {
 | 
				
			|||||||
            const returnInfo = new TextResponse(`${this.username}_returninfo`)
 | 
					            const returnInfo = new TextResponse(`${this.username}_returninfo`)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            const editPermissions = new Array()
 | 
					            const editPermissions = new Array()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            editTokensButton.addEventListener("click", () => {
 | 
				
			||||||
 | 
					                const request = post(`US_CLEAR_TOKENS`, this.username)
 | 
				
			||||||
 | 
					                request.then((answer) => {
 | 
				
			||||||
 | 
					                    if(answer == "NO_TOKENS") {
 | 
				
			||||||
 | 
					                        returnInfo.err("Aucun token n'a été généré pour cet utilisateur")
 | 
				
			||||||
 | 
					                    } else {
 | 
				
			||||||
 | 
					                        returnInfo.info("Les tokens ont été éffacés avec succès")
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                })
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
         
 | 
					         
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            editPermissions.push(getID(`${this.username}_perm_FILES_EXPLORER`))
 | 
					            editPermissions.push(getID(`${this.username}_perm_FILES_EXPLORER`))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user