Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VMSone
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Designerscripte
VMSone
Commits
16215f4f
Commit
16215f4f
authored
4 years ago
by
Henoch Einbier
Committed by
Joel Kuder
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
new feature: delete cron from database
parent
559bd45e
1 merge request
!46
Release 3.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cron.php
+17
-1
17 additions, 1 deletion
cron.php
with
17 additions
and
1 deletion
cron.php
+
17
−
1
View file @
16215f4f
...
...
@@ -2,6 +2,7 @@
@
set_time_limit
(
600
);
@
ignore_user_abort
(
true
);
require_once
(
'lib/extras.init.php'
);
if
(
$_GET
[
'pw'
]
!=
$system
[
'cron_pw'
])
die
(
'Zugriff verweigert!'
);
...
...
@@ -9,10 +10,14 @@ if ($_GET['pw'] != $system['cron_pw']) die('Zugriff verweigert!');
# Bei jedem Aufruf auszuführende Befehle Start
## Alte Reloads löschen
sql
::
$db
->
query
(
'DELETE FROM `'
.
_VMS_
.
'_reloads` WHERE `bis` <= '
.
time
()
.
' '
);
## Abgelaufene Paidmails löschen
sql
::
$db
->
query
(
'DELETE FROM `'
.
_VMS_
.
'_paidmails_empfaenger` WHERE `status` = 1 || `status` = 2 || `gueltig` < '
.
time
()
.
' '
);
# Bei jedem Aufruf auszuführende Befehle Ende
//normaler cron aufruf
if
(
!
isset
(
$_GET
[
'delete'
]))
{
$sql
=
sql
::
$db
->
prepare
(
'SELECT `id`, `datei` FROM `'
.
_VMS_
.
'_crons` WHERE `id` = ? LIMIT 1'
);
$sql
->
execute
(
array
(
$_GET
[
'id'
]));
$result
=
$sql
->
fetch
();
...
...
@@ -21,5 +26,16 @@ if ( include ($result['datei']) ){
$sql
=
sql
::
$db
->
prepare
(
'UPDATE `'
.
_VMS_
.
'_crons` SET `laufzeit` = ? WHERE `id` = ? LIMIT 1'
);
$sql
->
execute
(
array
(
time
(),
$result
[
'id'
]));
echo
'Cron gelaufen'
;
}
else
echo
'Cron nicht gelaufen'
;
}
else
{
echo
'Cron nicht gelaufen'
;
}
}
//ende normaler cron aufruf
//cron löschen
if
(
isset
(
$_GET
[
'delete'
]))
{
$sql
=
sql
::
$db
->
prepare
(
'DELETE FROM `'
.
_VMS_
.
'_crons` WHERE `id` = ? LIMIT 1'
);
$sql
->
execute
(
array
(
$_GET
[
'id'
]));
echo
'Cron gelöscht'
;
}
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment