Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Summative_Sam_Markey
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sam.markey
Summative_Sam_Markey
Commits
f80338d9
Commit
f80338d9
authored
Apr 30, 2021
by
Sam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FINAL VERSION
parent
8e799fbd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
register.java
...src/main/java/com/example/museumworld/login/register.java
+5
-2
strings.xml
app/src/main/res/values-fr/strings.xml
+1
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/com/example/museumworld/login/register.java
View file @
f80338d9
...
...
@@ -137,6 +137,10 @@ public class register extends AppCompatActivity implements View.OnClickListener
message
=
getString
(
R
.
string
.
regex_other
);
setParams
(
ErrorMessageuserName
);
ErrorMessageuserName
.
setText
(
message
);
}
else
if
(
username
.
contains
(
lastname
)
||
username
.
contains
(
firstname
)){
message
=
getString
(
R
.
string
.
register_username_contain
);
setParams
(
ErrorMessageuserName
);
ErrorMessageuserName
.
setText
(
message
);
}
else
{
...
...
@@ -165,7 +169,7 @@ public class register extends AppCompatActivity implements View.OnClickListener
else
{
ResetParams
(
ErrorMessagepassword2
);
}
if
(
password
.
matches
(
"[a-zA-Z0-9]*"
)
&&
username
.
matches
(
"[a-zA-Z0-9]*"
)&&
lastname
.
matches
(
"[a-zA-Z]*"
)
&&
firstname
.
matches
(
"[a-zA-Z]*"
)
&&
password
.
equals
(
password2
)
&&
password2
.
length
()
>=
7
&&
password
.
length
()
>=
7
&&
username
.
length
()
>=
5
&&
lastname
.
length
()
>=
3
&&
firstname
.
length
()
>=
2
)
{
if
(
!
username
.
contains
(
lastname
)
&&
!
username
.
contains
(
firstname
)
&&
password
.
matches
(
"[a-zA-Z0-9]*"
)
&&
username
.
matches
(
"[a-zA-Z0-9]*"
)&&
lastname
.
matches
(
"[a-zA-Z]*"
)
&&
firstname
.
matches
(
"[a-zA-Z]*"
)
&&
password
.
equals
(
password2
)
&&
password2
.
length
()
>=
7
&&
password
.
length
()
>=
7
&&
username
.
length
()
>=
5
&&
lastname
.
length
()
>=
3
&&
firstname
.
length
()
>=
2
)
{
firstname
=
firstname
.
substring
(
0
,
1
).
toUpperCase
()
+
firstname
.
substring
(
1
);
lastname
=
lastname
.
substring
(
0
,
1
).
toUpperCase
()
+
lastname
.
substring
(
1
);
...
...
@@ -181,7 +185,6 @@ public class register extends AppCompatActivity implements View.OnClickListener
StringRequest
stringRequest
=
new
StringRequest
(
Request
.
Method
.
POST
,
URL
,
(
Response
.
Listener
<
String
>)
response
->
{
if
(
response
.
equals
(
"success"
))
{
snackbarAlert
(
"You have successfully registered the account!"
,
false
);
...
...
app/src/main/res/values-fr/strings.xml
View file @
f80338d9
...
...
@@ -88,4 +88,5 @@
<string
name=
"bookingTitle"
>
Confirmer la réservation
</string>
<string
name=
"regex_name"
>
* Ne peut contenir que des lettres
</string>
<string
name=
"regex_other"
>
* Ne peut contenir que des chiffres et des lettres
</string>
<string
name=
"register_username_contain"
>
* Le nom d\'utilisateur ne peut pas contenir votre prénom ou votre nom
</string>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
f80338d9
...
...
@@ -86,6 +86,7 @@
<string
name=
"regex_other"
>
*Can only contain numbers and letters
</string>
<string
name=
"reister_lastname"
>
*Lastname has to be at least 3 characters long
</string>
<string
name=
"reister_username"
>
*Username has to be at least 5 characters long
</string>
<string
name=
"register_username_contain"
>
*Username cannot contain your first or last name
</string>
<string
name=
"reister_password"
>
*Password has to be at least 7 characters long
</string>
<string
name=
"reister_password2"
>
*Passwords do not match
</string>
<string
name=
"date_goes_here"
>
Date goes here
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment