|  | @@ -49,7 +49,8 @@ panel.verifyToken = function(token, reloadOnError){
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  panel.prepareDashboard = function(){
 | 
	
		
			
				|  |  |  	panel.page = document.getElementById('page');
 | 
	
		
			
				|  |  | -	document.getElementById('auth').style.display = 'none';
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	if(panel.username != 'root') document.getElementById('itemUserAdd').style.display = 'none';
 | 
	
		
			
				|  |  |  	document.getElementById('dashboard').style.display = 'block';
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	document.getElementById('itemUploads').addEventListener('click', function(){
 | 
	
	
		
			
				|  | @@ -544,6 +545,60 @@ panel.getNewToken = function(){
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +panel.addUser = function(){
 | 
	
		
			
				|  |  | +	panel.page.innerHTML = '';
 | 
	
		
			
				|  |  | +	var container = document.createElement('div');
 | 
	
		
			
				|  |  | +	container.className = "container";
 | 
	
		
			
				|  |  | +	container.innerHTML = `
 | 
	
		
			
				|  |  | +		<h2 class="subtitle">Add a new user</h2>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		<label class="label">Username</label>
 | 
	
		
			
				|  |  | +		<p class="control has-addons">
 | 
	
		
			
				|  |  | +			<input id="user" class="input is-expanded" type="text" placeholder="Username">
 | 
	
		
			
				|  |  | +		</p>
 | 
	
		
			
				|  |  | +		<label class="label">Password</label>
 | 
	
		
			
				|  |  | +		<p class="control has-addons">
 | 
	
		
			
				|  |  | +			<input id="pass" class="input is-expanded" type="password" placeholder="Password">
 | 
	
		
			
				|  |  | +			<a id="sendAddUser" class="button is-primary">Add user</a>
 | 
	
		
			
				|  |  | +		</p>
 | 
	
		
			
				|  |  | +	`;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	panel.page.appendChild(container);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	document.getElementById('sendAddUser').addEventListener('click', function(){
 | 
	
		
			
				|  |  | +		var user = document.getElementById('user').value;
 | 
	
		
			
				|  |  | +		var pass = document.getElementById('pass').value;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		if(user === undefined || user === null || user === '')
 | 
	
		
			
				|  |  | +			return swal('Error', 'You need to specify a username', 'error');
 | 
	
		
			
				|  |  | +		if(pass === undefined || pass === null || pass === '')
 | 
	
		
			
				|  |  | +			return swal('Error', 'You need to specify a username', 'error');
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		axios.post('/api/register', {
 | 
	
		
			
				|  |  | +			username: user,
 | 
	
		
			
				|  |  | +			password: pass
 | 
	
		
			
				|  |  | +		})
 | 
	
		
			
				|  |  | +		.then(function (response) {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			if(response.data.success === false)
 | 
	
		
			
				|  |  | +				return swal('Error', response.data.description, 'error');
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			swal({
 | 
	
		
			
				|  |  | +			title: "Woohoo!",
 | 
	
		
			
				|  |  | +			text: 'User created successfully!', 
 | 
	
		
			
				|  |  | +			type: "success"
 | 
	
		
			
				|  |  | +			}, function(){
 | 
	
		
			
				|  |  | +				location.reload();
 | 
	
		
			
				|  |  | +			});
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		})
 | 
	
		
			
				|  |  | +		.catch(function (error) {
 | 
	
		
			
				|  |  | +			return swal('An error ocurred', 'There was an error with the request, please check the console for more information.', 'error');
 | 
	
		
			
				|  |  | +			console.log(error);
 | 
	
		
			
				|  |  | +		});
 | 
	
		
			
				|  |  | +	});
 | 
	
		
			
				|  |  | +};
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  panel.changePassword = function(){
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	panel.page.innerHTML = '';
 |