Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
CTF
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Grzegorz
CTF
Commits
7059ec63
Commit
7059ec63
authored
Apr 01, 2016
by
Antek Grzanka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge fixes - aligining to deleted endpoint.
parent
e986186f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
apiProvider.js
...main/resources/assets/statics/js/providers/apiProvider.js
+12
-5
authenticationService.js
...urces/assets/statics/js/services/authenticationService.js
+13
-0
task.html
service/src/main/resources/assets/task.html
+1
-1
No files found.
service/src/main/resources/assets/statics/js/providers/apiProvider.js
View file @
7059ec63
(
function
(){
angular
.
module
(
'ctfApp'
).
factory
(
'APIProvider'
,
[
'$http'
,
'AppSettings'
,
function
(
$http
,
AppSettings
){
angular
.
module
(
'ctfApp'
).
factory
(
'APIProvider'
,
[
'$http'
,
'AppSettings'
,
'AuthenticationService'
,
function
(
$http
,
AppSettings
,
AuthenticationService
){
var
tasks
,
teams
,
scores
;
return
{
...
...
@@ -28,10 +28,17 @@
},
getMySolutions
:
function
(
callback
){
$http
.
get
(
'http://'
+
AppSettings
.
apiAddress
+
'/solutions/my'
).
success
(
function
(
data
)
{
if
(
callback
)
callback
(
data
);
});
var
result
;
if
(
!
scores
){
this
.
getScores
(
function
(
data
){
result
=
this
.
getMySolutions
(
callback
);
}.
bind
(
this
));
}
else
{
result
=
scores
[
AuthenticationService
.
getTeamname
()];
}
console
.
debug
(
"Result"
,
result
);
callback
(
result
);
},
getTaskById
:
function
(
id
,
callback
){
...
...
service/src/main/resources/assets/statics/js/services/authenticationService.js
View file @
7059ec63
...
...
@@ -5,6 +5,8 @@
return
{
team
:
$cookieStore
.
get
(
'teamname'
),
/**
* Login user.
* @param username
...
...
@@ -19,6 +21,7 @@
.
then
(
function
(
response
)
{
console
.
debug
(
"RESPONSE"
,
response
);
response
.
team
=
response
.
data
.
teamName
;
$cookieStore
.
put
(
'teamname'
,
response
.
team
);
callback
(
response
);
},
function
(
response
)
{
callback
(
response
);
...
...
@@ -72,9 +75,19 @@
clearCredentials
:
function
()
{
$rootScope
.
globals
=
{};
this
.
team
=
undefined
;
$cookieStore
.
remove
(
'globals'
);
$cookieStore
.
remove
(
'team'
);
$http
.
defaults
.
headers
.
common
.
Authorization
=
'Basic '
;
},
setTeamname
:
function
(
team
){
this
.
team
=
team
;
},
getTeamname
:
function
(){
return
this
.
team
;
}
};
...
...
service/src/main/resources/assets/task.html
View file @
7059ec63
...
...
@@ -75,7 +75,7 @@
</div>
<div
class=
"col s12 m4"
style=
"text-align:center"
>
<img
class=
"responsive-img"
src=
"http://lorempixel.com/400/300/"
/>
<a
class=
"waves-effect waves-light btn"
target=
"_blank"
href=
"{{apiAddress}}/task/{{task.level}}"
<a
class=
"waves-effect waves-light btn"
target=
"_blank"
href=
"{{apiAddress}}/task/{{task.level}}
/
"
style=
"width:100%;margin-top:15px"
>
Otwórz stronę z zadaniem
</a>
</div>
</div>
...
...
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