changeset 65:3d7067a23eff

fix
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 17 Sep 2024 05:01:59 -0600
parents f8a307aa811f
children 3fbe9cb2e325
files conf/Init.luan src/nabble/view/naml/edit_profile.naml src/nabble/view/naml/utilities.naml src/nabble/view/web/template/ServletNamespace.java
diffstat 4 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/conf/Init.luan	Mon Sep 16 20:53:23 2024 -0600
+++ b/conf/Init.luan	Tue Sep 17 05:01:59 2024 -0600
@@ -25,7 +25,7 @@
 Init.home_dir = uri( uri("classpath:nabble").to_string() ).parent().parent().to_string().."/"
 
 -- for now
-local smtp = MailHome.getSmtpServer("mail.smtp2go.com","dev@singlesushi.com","FB4dating")
+local smtp = MailHome.getSmtpServer("mail.smtp2go.com","nabble","nabble")
 smtp.setPort(2525)
 MailHome.setDefaultSmtpServer(smtp)
 
--- a/src/nabble/view/naml/edit_profile.naml	Mon Sep 16 20:53:23 2024 -0600
+++ b/src/nabble/view/naml/edit_profile.naml	Tue Sep 17 05:01:59 2024 -0600
@@ -1,5 +1,5 @@
 <macro name="edit_profile" requires="servlet">
-	<n.user_page.>
+	<n.my_user_page.>
 		<n.if.not.visitor.is_registered>
 			<then>
 				<n.login.><t>You must login to view this spage.</t></n.login.>
@@ -81,7 +81,7 @@
 				</n.form.>
 			</body>
 		</n.html>
-	</n.user_page.>
+	</n.my_user_page.>
 </macro>
 
 <macro name="show_edit_profile_error">
--- a/src/nabble/view/naml/utilities.naml	Mon Sep 16 20:53:23 2024 -0600
+++ b/src/nabble/view/naml/utilities.naml	Tue Sep 17 05:01:59 2024 -0600
@@ -951,6 +951,10 @@
 </macro>
 
 <macro name="user_page" dot_parameter="do" requires="servlet">
+	<n.get_user_from_parameter.as_user_page.do/>
+</macro>
+
+<macro name="my_user_page" dot_parameter="do" requires="servlet">
 	<n.visitor.as_user_page.do/>
 </macro>
 
--- a/src/nabble/view/web/template/ServletNamespace.java	Mon Sep 16 20:53:23 2024 -0600
+++ b/src/nabble/view/web/template/ServletNamespace.java	Tue Sep 17 05:01:59 2024 -0600
@@ -352,6 +352,20 @@
 		out.print( interp.getArg(new NodeNamespace(node),"do") );
 	}
 
+	public static final CommandSpec get_user_from_parameter = CommandSpec.DO;
+
+	@Command public void get_user_from_parameter(IPrintWriter out,ScopedInterpreter<UserNamespace> interp)
+		throws IOException, ServletException
+	{
+		String userId = Jtp.getString(request,"user");
+		Person person = site().getPerson(userId);
+		if( person == null ) {
+			response.sendError(HttpServletResponse.SC_NOT_FOUND, "User not found.");
+			throw new ExitException();
+		}
+		out.print( interp.getArg(new UserNamespace(person),"do") );
+	}
+
 
 	Set<String> cacheEvents = null;