Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
44de29f5
authored
Jun 29, 2016
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
working on login improvement from pcb
parent
abccd55a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
android/Pictogram/app/src/main/java/com/yottacode/net/RestapiWrapper.java
android/Pictogram/app/src/main/java/com/yottacode/pictogram/dao/Device.java
android/Pictogram/app/src/main/java/com/yottacode/net/RestapiWrapper.java
View file @
44de29f5
...
...
@@ -159,6 +159,7 @@ public class RestapiWrapper {
JSONresponse
=
null
;
Log
.
e
(
RestapiWrapper
.
class
.
getCanonicalName
(),
e
.
getMessage
());
}
Log
.
i
(
com
.
yottacode
.
net
.
RestapiWrapper
.
class
.
getName
(),
"server answer: "
+
JSONresponse
.
toString
());
return
JSONresponse
;
}
public
static
JSONObject
GET
(
String
surl
,
Hashtable
<
String
,
String
>
params
)
throws
IOException
{
...
...
@@ -243,6 +244,7 @@ public class RestapiWrapper {
@Override
protected
HttpAsyncTaskParams
doInBackground
(
HttpAsyncTaskParams
...
params
)
{
try
{
Log
.
i
(
com
.
yottacode
.
net
.
RestapiWrapper
.
class
.
getName
(),
" asking to the server for "
+
params
[
0
].
url
+
" params:"
+
params
[
0
].
url_params
+
" "
+
params
[
0
].
json_params
);
JSONObject
jresult
=
params
[
0
].
request_method
.
equalsIgnoreCase
(
"GET"
)
?
GET
(
params
[
0
].
url
,
params
[
0
].
url_params
)
:
POST
(
params
[
0
].
url
,
params
[
0
].
request_method
,
params
[
0
].
url_params
,
params
[
0
].
json_params
);
...
...
android/Pictogram/app/src/main/java/com/yottacode/pictogram/dao/Device.java
View file @
44de29f5
...
...
@@ -244,7 +244,7 @@ public class Device extends SQLiteOpenHelper {
while
(
cursor
.
moveToNext
()
&&
users
==
null
&&
!
user_found
)
{
user_found
=
cursor
.
getString
(
1
).
equalsIgnoreCase
(
auser
);
if
(
user_found
)
if
(
cursor
.
getString
(
2
).
equals
(
apwd
))
{
if
(
cursor
.
getString
(
2
)
!=
null
&&
cursor
.
getString
(
2
)
.
equals
(
apwd
))
{
users
=
recoverStudents
(
cursor
.
getInt
(
0
));
if
(
users
.
size
()
==
0
)
throw
new
LoginException
(
"Supervisor hasn't got students"
,
LoginException
.
NO_STUDENTS
);
...
...
@@ -257,7 +257,7 @@ public class Device extends SQLiteOpenHelper {
while
(
cursor
.
moveToNext
()
&&
users
==
null
&&
!
user_found
)
{
user_found
=
cursor
.
getString
(
1
).
equalsIgnoreCase
(
auser
);
if
(
user_found
)
if
(
cursor
.
getString
(
2
).
equals
(
apwd
))
{
if
(
cursor
.
getString
(
2
)
!=
null
&&
cursor
.
getString
(
2
)
.
equals
(
apwd
))
{
users
=
new
Vector
<>(
1
);
users
.
add
(
new
User
(
cursor
.
getInt
(
0
),
cursor
.
getString
(
1
),
cursor
.
getString
(
2
),
cursor
.
getString
(
3
),
cursor
.
getString
(
4
),
cursor
.
getString
(
5
),
cursor
.
getString
(
6
),
cursor
.
getString
(
7
),
cursor
.
getString
(
8
),
User
.
NO_SUPERVISOR
,
""
,
""
,
""
,
""
,
""
,
""
,
""
,
""
));
...
...
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