Permalink
Browse files

Merge branch 'master' into 184-discord-module

  • Loading branch information...
M4LuZ committed Sep 12, 2018
2 parents 62fb2ea + 0cc34c2 commit 8242a1211dc3b9d894a281e59c5a4f5d3f7cfd4d
View
@@ -335,9 +335,12 @@ public function qry_first()
if ($this->query_id === true) {
return true;
}
$row = $this->fetch_array();
$this->free_result();
if ($this->query_id->num_rows >0) { // only try to fetch something if we got a valid result
$row = $this->fetch_array();
$this->free_result();
} else {
$row = false; // just return false otherwise
}
return $row;
}
@@ -17,17 +17,17 @@ public function Run($jobid)
}
$row = $db->qry_first("SELECT name, type, function FROM %prefix%cron WHERE jobid = %int%", $jobid);
if ($row['type'] == 'sql') {
$db->qry('%plain%', $func->AllowHTML($row['function']));
} elseif ($row['type'] == "php") {
require_once 'ext_scripts/'.$row['function'];
if ($row != false) {
if ($row['type'] == 'sql') {
$db->qry('%plain%', $func->AllowHTML($row['function']));
} elseif ($row['type'] == "php") {
require_once 'ext_scripts/'.$row['function'];
}
$db->qry("UPDATE %prefix%cron SET lastrun = NOW() WHERE jobid = %int%", $jobid);
$func->log_event(t('Cronjob "%1" wurde ausgeführt', array($row['name'])), 1);
return $row['function'];
}
$db->qry("UPDATE %prefix%cron SET lastrun = NOW() WHERE jobid = %int%", $jobid);
$func->log_event(t('Cronjob "%1" wurde ausgeführt', array($row['name'])), 1);
return $row['function'];
return false;
}
/**
View
@@ -5,8 +5,14 @@
$mf->AddField(t('Name'), 'name');
$mf->AddField(t('Statement'), 'function');
$mf->AddField(t('Aktiv'), 'active');
$mf->AddField(t('Type'), 'type');
$mf->AddField(t('Aktiv'), 'active', '', '', \LanSuite\MasterForm::FIELD_OPTIONAL);
$mf->AddField(
t('Typ'),
'type',
\LanSuite\MasterForm::IS_SELECTION,
array('php'=>'php','sql'=>'sql'),
\LanSuite\MasterForm::FIELD_OPTIONAL
);
$mf->AddField(t('Ausführen täglich, um'), 'runat');
$mf->SendForm('index.php?mod=cron2&action=add', 'cron', 'jobid', $_GET['jobid']);
@@ -43,7 +43,7 @@
<key></key>
<default>sql</default>
<extra></extra>
</field>
</field>
<field>
<name>active</name>
<type>tinyint(1)</type>
View
@@ -22,6 +22,7 @@
$ms2->AddResultField(t('Name'), 'c.name');
$ms2->AddResultField(t('Geplant um'), 'runat');
$ms2->AddResultField(t('Typ'), 'type');
$ms2->AddResultField(t('Aktiv'), 'active', 'TrueFalse');
$ms2->AddResultField(t('Letzte Ausführung'), 'UNIX_TIMESTAMP(c.lastrun) AS lastrun', 'MS2GetDate');
View
@@ -1,5 +1,9 @@
<?php
// This could run a long time, so avoid running into a timeout
ini_set('max_execution_time', 0);
set_time_limit(0);
// And now continue with the fun stuff...
$importXml = new \LanSuite\XML();
$installImport = new \LanSuite\Module\Install\Import($importXml);
$install = new \LanSuite\Module\Install\Install($installImport);

0 comments on commit 8242a12

Please sign in to comment.