From 0140a4ada4509c34e4309579cb74485263f91490 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 6 Oct 2015 12:11:50 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20added=20new=20beans=20(controll?= =?utf8?q?er)=20for=20registration=20and=20login=20-=20added=20security=20?= =?utf8?q?constrain=20(maybe=20working=3F)=20for=20login=20area.=20Maybe?= =?utf8?q?=20this=20has=20to=20be=20done=20manually=20as=20the=20user=20ta?= =?utf8?q?ble=20is=20very=20specific.=20-=20add=20dummy=20login=20error=20?= =?utf8?q?page=20-=20updated=20jars=20Signed-off-by:Roland=20H=C3=A4der=20?= =?utf8?q??= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jcontacts-business-core.jar | Bin 38557 -> 38557 bytes lib/jcontacts-core.jar | Bin 18555 -> 18555 bytes lib/jcontacts-lib.jar | Bin 363 -> 363 bytes lib/jcore.jar | Bin 13647 -> 13647 bytes lib/jcoreee.jar | Bin 19814 -> 18176 bytes lib/juser-core.jar | Bin 10251 -> 13411 bytes lib/juser-lib.jar | Bin 1666 -> 3386 bytes nbproject/build-impl.xml | 9 ++ nbproject/genfiles.properties | 6 +- nbproject/project.properties | 5 +- nbproject/project.xml | 12 +++ .../beans/login/UserLoginWebBean.java | 87 ++++++++++++++++++ .../beans/login/UserLoginWebController.java | 32 +++++++ .../beans/register/UserRegisterWebBean.java | 85 +++++++++++++++++ .../register/UserRegisterWebController.java | 33 +++++++ .../addressbook/beans/user/UserWebBean.java | 15 +++ .../beans/user/UserWebController.java | 14 +++ .../templates/guest/guest_login_form.tpl | 10 +- web/WEB-INF/web.xml | 28 ++++++ web/user/login.xhtml | 2 +- web/user/login_error.xhtml | 29 ++++++ 21 files changed, 357 insertions(+), 10 deletions(-) create mode 100644 src/java/org/mxchange/addressbook/beans/login/UserLoginWebBean.java create mode 100644 src/java/org/mxchange/addressbook/beans/login/UserLoginWebController.java create mode 100644 src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java create mode 100644 src/java/org/mxchange/addressbook/beans/register/UserRegisterWebController.java create mode 100644 web/user/login_error.xhtml diff --git a/lib/jcontacts-business-core.jar b/lib/jcontacts-business-core.jar index 7e2bfd3a2d9f2817b575ecf5254b2f74ad977b2b..a45d168c0d1a99c420451975ef7957053754be10 100644 GIT binary patch delta 376 zcmbQcmTB%rih6=noNxm6V0bH0ofN6K;$P)AURo<(HcZWF}i}N zg^W%h>M5feh|*lXF454U^MAl*E)w5Y;>-2}C`gQVOEt PrsjdDb5p^BM$@tZnI4I3 delta 376 zcmbQcmTB%EU$??noOBq6V0bH0ofN6K;$P)AURo<(HcZWF}i}N zg^W%h>M5feh|*lXF454U^MAl*E)w5Y;>-2}C`gQVOEt PrsjdDb5p^BM$@tZQ8$7B diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar index 60d3cc88e52b6a8bfa6ca7b45f787c3a8290892e..116c3511fbfe8d060114a5877f2f106b1b8c157b 100644 GIT binary patch delta 199 zcmex8f${eQMxFp~W)?061`Y;>wZRj4G?~@}Pc)wnA}=U_$WNL~YlA1tG8zLplY!;!88;&0Vb;|B5Xnx5ta(W~rtuz-}OxLAVBnD62M zq8_>!fGA;COOTwOt22l<+0`4wd*B)bqDWUq-lnoLPv6V0bH0ofN6K;$P)AURo<(HKMpF7;uZm-?zzQ)C>!@U5H-g=8ALI9Q~>~M Cmp*C$ diff --git a/lib/jcontacts-lib.jar b/lib/jcontacts-lib.jar index 7797a5a531de5079d6a9e194c977078fb4408e03..99666abdeae3b6a9a46f8038da148273677da22c 100644 GIT binary patch delta 43 tcmaFO^qPq`z?+$ci-CcIf#E=u+eBUs=Dk45VhuBh_uK-+o22>=G94G91M delta 43 tcmaFO^qPq`z?+$ci-CcIfuTFobt10@a~F`ZSi=nBJ+}byCMz*|0s#B(3~>Me diff --git a/lib/jcore.jar b/lib/jcore.jar index 2c6f30efe9f8c246eae16a87aef835bb909ba01d..b506a165e930439400060fff313b735ea2ad09f3 100644 GIT binary patch delta 461 zcmX?~bv}zXz?+$ci-CcIfniFd+eBUs=E*?HVj44ucTpZpebxX`ljRuoz_dT36^Ne1 zq%wH}qaax52%{xL$P~=AU@`;Kg-lK$dh<4>lRSbzhP%k5$6FYg7#KiUd$OX6*yQ^L z5}Wt&b2EX}oe{jn2xhDlehgvsi#}%ti&RQpV+0$K_0}iw2qOan2)lrdm?O(QdA*U^ z=H=4oAet&tf zdAamCh^7kJPKbFd3jPpAn9?qYl(32~gpsV8%mz02r1n&>$mB#_3y|L@&(XC9Nld<{ zs}H6H^en)%x1JrC?$PrC)4BT6lfUR`f!T`so=`DYFuhgZ4NU*j4+7J{2H{|Otw9)= zW;2Wi(cmYT>atBB@;6M%0gYUU AA^-pY diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index 19ec1c4c0c5355690db3b56b7a5d61624e477181..d87f56db099dbce4c0917c934638141e43c7b492 100644 GIT binary patch delta 4367 zcma)AeN2_t9e&>X!MXRnFCdo>xkB-Z2t__FAc9;(LF?sHL~T{HQcy06y#+;Vt!=$H zE7q+ac5j*Z^Spd^-WYq{u)5lvE)(zo$`Il#kmFr@lgqh*d;G=!9!T!*Zq3F?rG!X4C zx0_a%In%M-PA&hp-4k47ug}IFJS> z>)Z(6nQRHMG+4TqUxx7mJtT{7nGED(A>USF0J0GPTw*YXExGJ*v6Oh;gFKq1IpY)* z#{=;*M%Z0C2}d}|S)&53uqWX8u*U1GF*D6f?**(5crwkZurH7l@J+&b4$E9M$|!pW zORvJ!?RUGbA*tIL@NNAe)Ma?W?u+m~Z5kJEf0C)rBToD(u1*w(Yy12*SsBwqOZERkt9aOZON^)s*)^t2!Qq_U8QCC?h7r^tSzD8qhcRcic2lSkSq zuT3Vpu-Rl-wkq83!2=50Ol-#vg>EnX+-dT)%S)dhH2K=C&|@;n56QG%4?;flVUNOI zA5*Sh8l&tmH?lQ)=ty*E zZ`5KQow4vud`ocP+}Y59TI2pTqMS*adiD;=SA&;|{XVh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$gYM79x z8MO=ICZt*kbNyCQ&{UHq^Wwy;^M}e8t4SY`C25iz!jr)q+fS<0=+)r-gmk*|c^!CB HvPAqF+Da`g diff --git a/lib/juser-core.jar b/lib/juser-core.jar index 1651c24ee4b8986a7d54e6c7087867c359745bfe..30c2eb8281ea781cce326a635f5476b122507439 100644 GIT binary patch delta 1713 zcmd5-O-vI}5T3W&ALx&55n7-HS7;ZC%8wF(D5Pp=V~Ws#jnNRWlmbO)p=_1J5F!UJ z5)3{QF&a-M#^6PXK@Nt<0Zt|+UO1SD;bMXpjTaM*&RbH$QWGU!IJ}vidGDKij#I)Ds-mEg3&%`FF~YwmFP{6=8%iyI{^AV-*bP2AKY>J=Dzi_~rIH85r5 z8d1%i-{|;O%>%GiPea6|4~|3<&2h;aPsZqdF3(Y#0l8Yp(?dSkb>M&k z9cZCY3;VPn&~~lcJQI1axO{VffaZ8K7L^+4n!bv9_-ax|U-7wEkV%`0_k?c>)f2lMo7rvGbB}B`Wm^Nd+y@5n%uejO>J#WAQ|9#o%bTkJcGYjGnD! zZK#HK14Fsn7+Sr1{c8`h(?dJCL#E9(24mrPtS6cn{4aXi)1uAtt>fD=q%%|T56mP} z1@4F*57I-cjoFNuwAywFJw^pRb5oiLGn-{uHm8c|TKgly^asat4Qe`5T!+(=zAg4J zE5}*Ml+P(o!wKgpX014znX0rQ5xNJW4oALVAFD?zA(*UsLQGni;An2qu;8)`o P;M}vof*Rm delta 343 zcmaEy(H+1O;LXg!#lXP9z)br=v}Nh6#1WJ5zqpa%ZQ zRmMUfQ~Qi%m~^BOqH5fe?;G=gWZnX0uF61VxF_qIsPXYJ@G)ewFfeo}gA4@#lFMHG diff --git a/lib/juser-lib.jar b/lib/juser-lib.jar index e6541325d05fda6d2b60c9d38d19cc988b12e4d6..60198aa1bf4e0a81b720f797d1f8d38792967c61 100644 GIT binary patch literal 3386 zcmc&$Ur*Ce6h9Zn%Ekr=ON<&L!Gu5v8$=^2A#orj1O{XS5;4(q-DPxkEw-Hj-}nx` z`o^noKKbB-8WZ^nz8hcs2%_h-tlf%h2by@3+ith#|NY(HJ?qPzkvKp%06Z2K@#&5j zL?E}Yk)2pt6*DKt0PC*k&uww>W2*eRjKVZiI9<_Pc6CWyC~Ty2VouVO9d23^Tih@e zUAsRtm7Yw-vs%MSc2AOb`4Fz*$9w79$@sj%C5x9P<_<`HIz9RH&h$iaa%yOF&5&f3 z56$bwo^D7MS{zHplW{LFe-050OgGAz))L86iR!+*D`{mOAbQy^TB(`bkaZ(S>3VCW zs$Sx1fWMnzs;XXAv;YGmVFnCdR!oZ<0XBxiY)}n+`ipO3)59GAH0Q(gog_BV$_k}Z z;3gquj!RmeS9Oc0WmPiGA)HVsIs2(=4URw-i$;sywS{ zx@CjXWH7KoGW!``DQ28JW*E!{Mi^EI2K{6+qasW*YsCteEe0ujNzpR}ZYYwfyp%8! z2GcD(aX0M@rMIeEqF&QVZZ#Opw5M6XOl#(fE7DLk{Y~e^LC`jcWovWB45z3!goZz;_hC<0)=F;^kkj(r+06%^V7~h|9r-dkm;1 zdHYN_>=FjXegP5!BoUGf5_KzNdyGf^gVTRFyXF zp=2RfQ!U4qESMqMwVj&-CuTlZHeiK8EWWa;g;P)@hyss5?o zA_W>phvWEkRU5jmAm`K=IfI;k!k&L9tPz&so#fZ)+iz-Mesp3td>-#W5|J^%m! delta 201 zcmdlb)x^si;LXg!#lXP9z_7i_bt10@^EM!5F^w6-yC@H)K5Kxe$#RTFU^c`L8(j!L$q)L_;{26PQ1T%L7dJa7#~S;#Qozft_{o yS#BOBpkeM7xA`NbnHU&A*p>kSmNXt@WMG&q$Ra-ZACDd%2hhQ$KqclZASD0;a5z-} diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index f151f5a3..695ae363 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -881,11 +881,17 @@ exists or setup the property manually. For example like this: + + + + + + @@ -1041,6 +1047,7 @@ exists or setup the property manually. For example like this: + @@ -1056,6 +1063,7 @@ exists or setup the property manually. For example like this: + @@ -1470,6 +1478,7 @@ exists or setup the property manually. For example like this: --> + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 8245c238..87bf0946 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=d8bc4ea8 +build.xml.data.CRC32=f85eb01a build.xml.script.CRC32=be5f34f7 build.xml.stylesheet.CRC32=651128d4@1.68.1.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=d8bc4ea8 -nbproject/build-impl.xml.script.CRC32=855e3438 +nbproject/build-impl.xml.data.CRC32=f85eb01a +nbproject/build-impl.xml.script.CRC32=045dff2a nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.68.1.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index ced13a96..2f55c202 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -69,7 +69,8 @@ javac.classpath=\ ${file.reference.juser-lib.jar}:\ ${reference.addressbook-lib.jar}:\ ${file.reference.cdi-api.jar}:\ - ${file.reference.gf-client.jar} + ${file.reference.gf-client.jar}:\ + ${reference.juser-lib.jar} # Space-separated list of extra javac options javac.compilerargs=-Xlint:unchecked -Xlint:deprecation javac.debug=true @@ -99,8 +100,10 @@ lib.dir=${web.docbase.dir}/WEB-INF/lib persistence.xml.dir=${conf.dir} platform.active=default_platform project.addressbook-lib=../addressbook-lib +project.juser-lib=../juser-lib project.license=gpl30 reference.addressbook-lib.jar=${project.addressbook-lib}/dist/addressbook-lib.jar +reference.juser-lib.jar=${project.juser-lib}/dist/juser-lib.jar resource.dir=setup run.test.classpath=\ ${javac.test.classpath}:\ diff --git a/nbproject/project.xml b/nbproject/project.xml index 8a21668f..b80d7234 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -50,6 +50,10 @@ ${file.reference.gf-client.jar} WEB-INF/lib + + ${reference.juser-lib.jar} + WEB-INF/lib + @@ -71,6 +75,14 @@ clean jar + + juser-lib + jar + + jar + clean + jar + diff --git a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebBean.java b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebBean.java new file mode 100644 index 00000000..96270270 --- /dev/null +++ b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebBean.java @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.addressbook.beans.login; + +import javax.enterprise.context.SessionScoped; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Inject; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.addressbook.beans.user.UserWebController; +import org.mxchange.jusercore.exceptions.UserNotFoundException; +import org.mxchange.jusercore.exceptions.UserStatusLockedException; +import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException; +import org.mxchange.jusercore.model.login.UserLoginSessionBeanRemote; +import org.mxchange.jusercore.model.user.User; + +/** + * A web bean for user registration + *

+ * @author Roland Haeder + */ +@Named ("loginController") +@SessionScoped +public class UserLoginWebBean implements UserLoginWebController { + + /** + * Reemote register session bean + */ + private UserLoginSessionBeanRemote login; + + /** + * User controller + */ + @Inject + private UserWebController userController; + + /** + * Serial number + */ + private static final long serialVersionUID = 47_828_986_719_691_592L; + + /** + * Default constructor + */ + public UserLoginWebBean () { + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup + this.login = (UserLoginSessionBeanRemote) context.lookup("ejb/stateless-login"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw + throw new FaceletException(ex); + } + } + + @Override + public void doLogin () { + // Get user instance + User user = this.userController.createUserInstance(); + + try { + // Call bean + this.login.loginUser(user); + } catch (final UserNotFoundException | UserStatusLockedException | UserStatusUnconfirmedException ex) { + // Throw again + throw new FaceletException(ex); + } + } +} diff --git a/src/java/org/mxchange/addressbook/beans/login/UserLoginWebController.java b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebController.java new file mode 100644 index 00000000..81d90ba8 --- /dev/null +++ b/src/java/org/mxchange/addressbook/beans/login/UserLoginWebController.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.addressbook.beans.login; + +import java.io.Serializable; + +/** + * An interface for registration web controllers + *

+ * @author Roland Haeder + */ +public interface UserLoginWebController extends Serializable { + + /** + * Logins the user, if the account is found, confirmed and unlocked. + */ + public void doLogin (); +} diff --git a/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java b/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java new file mode 100644 index 00000000..5c7b2667 --- /dev/null +++ b/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebBean.java @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.addressbook.beans.register; + +import javax.enterprise.context.SessionScoped; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Inject; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.addressbook.beans.user.UserWebController; +import org.mxchange.jusercore.exceptions.UserAlreadyRegisteredException; +import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote; +import org.mxchange.jusercore.model.user.User; + +/** + * A web bean for user registration + *

+ * @author Roland Haeder + */ +@Named ("registerController") +@SessionScoped +public class UserRegisterWebBean implements UserRegisterWebController { + + /** + * Reemote register session bean + */ + private UserRegistrationSessionBeanRemote register; + + /** + * User controller + */ + @Inject + private UserWebController userController; + + /** + * Serial number + */ + private static final long serialVersionUID = 47_828_986_719_691_592L; + + /** + * Default constructor + */ + public UserRegisterWebBean () { + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup + this.register = (UserRegistrationSessionBeanRemote) context.lookup("ejb/stateless-register"); //NOI18N + } catch (final NamingException ex) { + // Continue to throw + throw new FaceletException(ex); + } + } + + @Override + public void doRegister () { + // Get user instance + User user = this.userController.createUserInstance(); + + try { + // Call bean + this.register.registerUser(user); + } catch (final UserAlreadyRegisteredException ex) { + // Continue to throw + throw new FaceletException(ex); + } + } +} diff --git a/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebController.java b/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebController.java new file mode 100644 index 00000000..bd27c9b3 --- /dev/null +++ b/src/java/org/mxchange/addressbook/beans/register/UserRegisterWebController.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.addressbook.beans.register; + +import java.io.Serializable; + +/** + * An interface for registration web controllers + *

+ * @author Roland Haeder + */ +public interface UserRegisterWebController extends Serializable { + + /** + * Registers the user, if not found. Otherwise this method should throw an + * exception. + */ + public void doRegister (); +} diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java index 9ecf3bb7..6f72ab67 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java @@ -119,6 +119,11 @@ public class UserWebBean implements UserWebController { */ private String userName; + /** + * User password (unencrypted from web form) + */ + private String userPassword; + /** * ZIP code */ @@ -316,6 +321,16 @@ public class UserWebBean implements UserWebController { this.userName = userName; } + @Override + public String getUserPassword () { + return this.userPassword; + } + + @Override + public void setUserPassword (final String userPassword) { + this.userPassword = userPassword; + } + @Override public Integer getZipCode () { return this.zipCode; diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebController.java b/src/java/org/mxchange/addressbook/beans/user/UserWebController.java index 085c0e64..c161b61a 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebController.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebController.java @@ -90,6 +90,20 @@ public interface UserWebController extends Serializable { */ public void setUserName (final String userName); + /** + * Getter for unencrypted user password + *

+ * @return Unencrypted user password + */ + public String getUserPassword (); + + /** + * Setter for unencrypted user password + *

+ * @param userPassword Unencrypted user password + */ + public void setUserPassword (final String userPassword); + /** * Company name *

diff --git a/web/WEB-INF/templates/guest/guest_login_form.tpl b/web/WEB-INF/templates/guest/guest_login_form.tpl index 0e810499..187e5e85 100644 --- a/web/WEB-INF/templates/guest/guest_login_form.tpl +++ b/web/WEB-INF/templates/guest/guest_login_form.tpl @@ -16,11 +16,11 @@

- +
- +
@@ -28,11 +28,11 @@
- +
- +
@@ -41,7 +41,7 @@ diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml index d256d2a3..c270f524 100644 --- a/web/WEB-INF/web.xml +++ b/web/WEB-INF/web.xml @@ -21,4 +21,32 @@ faces/index.xhtml + + Constraint1 + + loginArea + Login area + /llogin/* + + + User Authentication + user + + + + FORM + Loginbereich / Login area + + /user/login.xhtml + /user/login_error.xhtml + + + + A logged-in user that has previously registered himself/herself. + user + + + tpl + text/plain + diff --git a/web/user/login.xhtml b/web/user/login.xhtml index fada53c0..77bf49b1 100644 --- a/web/user/login.xhtml +++ b/web/user/login.xhtml @@ -21,7 +21,7 @@
- Noch kein Kunde? Einfach beim Bestellen anmelden oder hier anmelden. + Noch kein Benutzerkonto? Einfach hier anmelden.
diff --git a/web/user/login_error.xhtml b/web/user/login_error.xhtml new file mode 100644 index 00000000..36b34d67 --- /dev/null +++ b/web/user/login_error.xhtml @@ -0,0 +1,29 @@ + + + + + + #{msg.PAGE_TITLE_USER_LOGIN_ERROR} + + + + + + + #{msg.SUB_TITLE_USER_LOGIN_ERROR} + + + + Hier kommt die Fehlermeldung hin. + + + + + + + -- 2.39.5