Skip to content

Commit

Permalink
Userid changed to email from just username
Browse files Browse the repository at this point in the history
  • Loading branch information
amoghbl1 committed Dec 10, 2015
1 parent 45fe84f commit 5f4298f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
14 changes: 10 additions & 4 deletions endpoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ response: {
}
response: {
status: 0,
trip: { // No idea why this was called data -_-
data: { // No idea why this was called data -_-
tripId: 01,
... (All details about !!latest!! trip of currently logged in user)
}
Expand All @@ -44,7 +44,7 @@ response: {
request: {}
response: {
status:0,
trip: {
data: {
tripId: 01,
... (All details about !!latest!! trip of currently logged in user)
}
Expand All @@ -58,7 +58,7 @@ response: {
request: {}
response: {
status:0,
trips: {
data: {
[
{ trip 1 },
{ trip 2 },
Expand All @@ -73,7 +73,9 @@ response: {


4. /matchTrip
request: {}
request: {
tripId: 13
}
response: {
status: 0,
data: {
Expand All @@ -84,6 +86,10 @@ response: {
]
}
}
response: {
status: 1,
error: "Unable to run select in DB" | "Invalid session"
}

5. /addTrip
request: {
Expand Down
9 changes: 5 additions & 4 deletions utils/userhelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ function isAdmin() {
return in_array(getUid(), $admin);
}
function getUid() {
return $_SESSION['ldapstuff'][0]['uid'][0];
// Let's take uid to be email for our portal.
return $_SESSION['ldapstuff'][0]['mail'][0];
}
function getMailId() {
return $_SESSION['ldapstuff'][0]['mail'][0];
return $_SESSION['ldapstuff'][0]['mail'][0];
}
function getName() {
return $_SESSION['ldapstuff'][0]['givenname'][0];
return $_SESSION['ldapstuff'][0]['givenname'][0];
}
function isLoggedIn() {
return isset($_SESSION['ldapstuff']);
return isset($_SESSION['ldapstuff']);
}
?>

0 comments on commit 5f4298f

Please sign in to comment.