mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Made the option "contact admin" lives
This commit is contained in:
		
							
								
								
									
										47
									
								
								assets/js/pages/passwordForgotten/mailAdmin.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								assets/js/pages/passwordForgotten/mailAdmin.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Send a mail to the administration option
 | 
			
		||||
 * 
 | 
			
		||||
 * @author Pierre HUBERT
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
ComunicWeb.pages.passwordForgotten.mailAdmin = {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Send a mail to admin
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param {String} email The email address of the user
 | 
			
		||||
	 * @param {HTMLElement} target The target for the form
 | 
			
		||||
	 */
 | 
			
		||||
	open: function(email, target){
 | 
			
		||||
 | 
			
		||||
		//Create container
 | 
			
		||||
		var container = createElem2({
 | 
			
		||||
			appendTo: target,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "reset-password-by-mail-step"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Add title
 | 
			
		||||
		createElem2({
 | 
			
		||||
			appendTo: container,
 | 
			
		||||
			type: "h1",
 | 
			
		||||
			class: "title",
 | 
			
		||||
			innerHTML: "Email us"
 | 
			
		||||
		});
 | 
			
		||||
 | 
			
		||||
		//Message
 | 
			
		||||
		add_p(container, "You decided to reset your password by contacting us. " +
 | 
			
		||||
				"Please find a way to prove us your identity in your mail, and if possible, send " +
 | 
			
		||||
				"your email from your account email address.");
 | 
			
		||||
 | 
			
		||||
		//Add admin email address
 | 
			
		||||
		createElem2({
 | 
			
		||||
			appendTo: container,
 | 
			
		||||
			type: "a",
 | 
			
		||||
			class: "btn btn-default btn-mail",
 | 
			
		||||
			innerHTML: "contact@communiquons.org",
 | 
			
		||||
			href: "mailto:contact@communiquons.org"
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -70,8 +70,21 @@ ComunicWeb.pages.passwordForgotten.main = {
 | 
			
		||||
			//Prompt user reset option
 | 
			
		||||
			ComunicWeb.pages.passwordForgotten.promptOption.open(email, boxBody, function(option){
 | 
			
		||||
 | 
			
		||||
				alert(option);
 | 
			
		||||
				//Empty body
 | 
			
		||||
				emptyElem(boxBody);
 | 
			
		||||
 | 
			
		||||
				//Open appropriate page
 | 
			
		||||
				if(option == "mail"){
 | 
			
		||||
					ComunicWeb.pages.passwordForgotten.mailAdmin.open(email, boxBody);
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				//Option not recognized
 | 
			
		||||
				else {
 | 
			
		||||
					boxBody.appendChild(ComunicWeb.common.messages.createCalloutElem(
 | 
			
		||||
						"Error", 
 | 
			
		||||
						"Option not found!", 
 | 
			
		||||
						"danger"));
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
 
 | 
			
		||||
@@ -82,7 +82,10 @@ ComunicWeb.pages.passwordForgotten.promptOption = {
 | 
			
		||||
			appendTo: form,
 | 
			
		||||
			type: "div",
 | 
			
		||||
			class: "btn btn-default",
 | 
			
		||||
			innerHTML: "<i class='fa fa-envelope-o'></i> Contact the administration"
 | 
			
		||||
			innerHTML: "<i class='fa fa-envelope-o'></i> Send a mail to the administration"
 | 
			
		||||
		});
 | 
			
		||||
		contact.addEventListener("click", function(){
 | 
			
		||||
			callback("mail");
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user