Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Poduptime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
Poduptime
Commits
f0d68b1d
Commit
f0d68b1d
authored
Dec 21, 2015
by
dmorley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deal with blank api key
parent
6688da24
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
cleanup.php
cleanup.php
+3
-1
db/kill.php
db/kill.php
+17
-1
db/pull.php
db/pull.php
+1
-0
No files found.
cleanup.php
View file @
f0d68b1d
...
...
@@ -110,7 +110,9 @@ echo "✪";
<input
name=
"comments"
size=
10
>
<input
name=
"domain"
value=
"
<?php
echo
$row
[
"domain"
]
?>
"
type=
"hidden"
>
<input
name=
"adminkey"
value=
"
<?php
echo
$_COOKIE
[
"adminkey"
]
?>
"
type=
"hidden"
>
<input
type=
"submit"
value=
"Delete"
>
<input
name=
"action"
type=
"radio"
value=
"warn"
>
warn
<input
name=
"action"
type=
"radio"
value=
"delete"
>
delete
<input
type=
"submit"
value=
"Process"
>
</form>
</td>
<?php
...
...
db/kill.php
View file @
f0d68b1d
...
...
@@ -8,6 +8,11 @@ if (!$_POST['adminkey']){
echo
"no token given"
;
die
;
}
if
(
!
$_POST
[
'action'
]){
echo
"no action selected"
;
die
;
}
$domain
=
$_POST
[
'domain'
];
$dbh
=
pg_connect
(
"dbname=
$pgdb
user=
$pguser
password=
$pgpass
"
);
if
(
!
$dbh
)
{
...
...
@@ -23,7 +28,7 @@ if ($adminkey <> $_POST['adminkey']) {
echo
"admin key fail"
;
die
;
}
//save and exit
if
(
$_POST
[
'action'
]
==
"delete"
)
{
$sql
=
"DELETE from pods WHERE domain = $1"
;
$result
=
pg_query_params
(
$dbh
,
$sql
,
array
(
$domain
));
if
(
!
$result
)
{
...
...
@@ -38,6 +43,17 @@ echo "admin key fail";die;
}
pg_free_result
(
$result
);
pg_close
(
$dbh
);
}
elseif
(
$_POST
[
'action'
]
==
"warn"
)
{
if
(
$row
[
"email"
])
{
$to
=
$row
[
"email"
];
$subject
=
"Pod removal warning from poduptime "
;
$message
=
"Pod "
.
$_POST
[
"domain"
]
.
" is on the list to be deleted now because: "
.
$_POST
[
"comments"
]
.
".
\n\n
Please let me know if you need help fixing before it is removed.
\n\n
"
;
$headers
=
"From: support@diasp.org
\r\n
Cc:support@diasp.org,"
.
$row
[
"email"
]
.
"
\r\n
"
;
@
mail
(
$to
,
$subject
,
$message
,
$headers
);
}
}
header
(
'Location: https://podupti.me/?cleanup=true'
)
;
}
...
...
db/pull.php
View file @
f0d68b1d
...
...
@@ -307,6 +307,7 @@ $score=$score-2;
$up2
=
substr
(
$uptimerobot
,
strlen
(
$json_encap
)
-
1
,
strlen
(
$uptimerobot
)
-
strlen
(
$json_encap
));
$uptr
=
json_decode
(
$up2
);
if
(
$debug
)
{
print_r
(
$uptr
);}
if
(
!
$uptr
)
{
$score
=
$score
-
2
;}
$responsetime
=
'n/a'
;
$uptimerobotstat
=
$uptr
->
stat
;
$uptime
=
$uptr
->
monitors
->
monitor
{
'0'
}
->
alltimeuptimeratio
;
...
...
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