Skip to content

Commit 858d029

Browse files
committed
.
1 parent 0e76bd3 commit 858d029

7 files changed

Lines changed: 38 additions & 11 deletions

File tree

OpenFlow/src/Messages/Message.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,10 @@ export class Message {
416416
if ((msg.onesignalid != null && msg.onesignalid != undefined && msg.onesignalid != "") ||
417417
(msg.onesignalid != null && msg.onesignalid != undefined && msg.onesignalid != "")) {
418418
}
419+
if (msg.gpslocation != null && msg.gpslocation != undefined && msg.gpslocation != "") {
420+
user.gpslocation = msg.gpslocation;
421+
}
422+
419423
Audit.LoginSuccess(tuser, type, "websocket", cli.remoteip);
420424
msg.jwt = Crypt.createToken(user);
421425
msg.user = tuser;

OpenFlow/src/Messages/SigninMessage.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ import { TokenUser } from "../TokenUser";
44
export class SigninMessage implements IReplyMessage {
55
public error: string;
66

7-
public realm:string;
8-
public firebasetoken:string;
9-
public onesignalid:string;
7+
public realm: string;
8+
public firebasetoken: string;
9+
public onesignalid: string;
10+
public gpslocation: any;
1011

11-
public validate_only:boolean = false;
12-
public username:string;
13-
public password:string;
14-
public user:TokenUser;
15-
public jwt:string;
16-
public rawAssertion:string;
17-
static assign(o:any):SigninMessage {
12+
public validate_only: boolean = false;
13+
public username: string;
14+
public password: string;
15+
public user: TokenUser;
16+
public jwt: string;
17+
public rawAssertion: string;
18+
static assign(o: any): SigninMessage {
1819
if (typeof o === "string" || o instanceof String) {
1920
return Object.assign(new SigninMessage(), JSON.parse(o.toString()));
2021
}

OpenFlow/src/User.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export class User extends Base {
2727
sid: string;
2828
firebasetoken: string;
2929
onesignalid: string;
30+
gpslocation: any;
3031
federationids: FederationId[] = [];
3132
roles: Rolemember[] = [];
3233
HasRoleName(name: string): Boolean {

OpenFlow/src/public/CommonControllers.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ module openflow {
2323
return value;
2424
};
2525
};
26+
var gpsparameters: any = null;
27+
export function getgpsparameters() {
28+
return gpsparameters;
29+
}
30+
function iosListenGPSocation() {
31+
try {
32+
(window as any).bridge.on('gps_location', (parameters) => {
33+
gpsparameters = parameters;
34+
});
35+
} catch (error) {
36+
console.error(error);
37+
}
38+
}
39+
2640
export class api {
2741
static $inject = ["$rootScope", "$location", "WebSocketClient"];
2842
public messageQueue: IHashTable<messagequeue> = {};
@@ -49,6 +63,11 @@ module openflow {
4963
var log = { message: message, url: url, linenumber: linenumber, _type: "error" };
5064
this.Insert("jslog", log);
5165
}
66+
try {
67+
iosListenGPSocation();
68+
} catch (error) {
69+
console.log(error);
70+
}
5271

5372

5473
var cleanup = $rootScope.$on('queuemessage', (event, data: QueueMessage) => {

OpenFlow/src/public/Message.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ module openflow {
4545
public realm: string;
4646
public firebasetoken: string;
4747
public onesignalid: string;
48+
public gpslocation: any;
4849
public username: string;
4950
public password: string;
5051
public user: TokenUser;

OpenFlow/src/public/WebSocketClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ module openflow {
143143
} catch (error) {
144144
console.log(error);
145145
}
146+
q.gpslocation = openflow.getgpsparameters();
146147
console.debug("signing in with token");
147148
var msg: Message = new Message(); msg.command = "signin"; msg.data = JSON.stringify(q);
148149
var a: any = await this.Send(msg);

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.136
1+
0.0.137

0 commit comments

Comments
 (0)