mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Load mail address to change password in settings
This commit is contained in:
		@@ -31,6 +31,14 @@ const SettingsInterface = {
 | 
				
			|||||||
		ComunicWeb.common.api.makeAPIrequest(apiURI, settings, true, callback);
 | 
							ComunicWeb.common.api.makeAPIrequest(apiURI, settings, true, callback);
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * Get current user email address
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						getMail: async function() {
 | 
				
			||||||
 | 
							const res = await api("account/mail", null, true);
 | 
				
			||||||
 | 
							return res.mail;
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Check the availability of the virtual directory for user
 | 
						 * Check the availability of the virtual directory for user
 | 
				
			||||||
	 * 
 | 
						 * 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -62,8 +62,16 @@ ComunicWeb.pages.settings.sections.password = {
 | 
				
			|||||||
			tr("Your new password")
 | 
								tr("Your new password")
 | 
				
			||||||
		);
 | 
							);
 | 
				
			||||||
		(async () => {
 | 
							(async () => {
 | 
				
			||||||
 | 
								try {
 | 
				
			||||||
				let user = await userInfo(userID());
 | 
									let user = await userInfo(userID());
 | 
				
			||||||
				newPasswordInput.setUser(user)
 | 
									newPasswordInput.setUser(user)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									let mail = await SettingsInterface.getMail()
 | 
				
			||||||
 | 
									newPasswordInput.setEmail(mail)
 | 
				
			||||||
 | 
								} catch(e) {
 | 
				
			||||||
 | 
									console.error(e);
 | 
				
			||||||
 | 
									notify(tr("Failed to load your information to prepare password update!"), "danger");
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		})();
 | 
							})();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Ask the user to confirm its new password
 | 
							//Ask the user to confirm its new password
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user