Ajout tâche cron lifeExpire
This commit is contained in:
parent
d815dbeed9
commit
adf98cd198
3 changed files with 27 additions and 1 deletions
|
@ -107,6 +107,14 @@ switch ($action) {
|
|||
$get_value = urlUnGen($_GET['value']);
|
||||
DeleteAlias($get_value['id'], $get_value['alias_full']);
|
||||
break;
|
||||
case "cron" :
|
||||
if (CRON) {
|
||||
echo '<div class="highlight-2">La tâche planifié est lancé</div>';
|
||||
LifeExpire();
|
||||
} else {
|
||||
echo '<div class="highlight-1">Vous n\'avez pas autorisé le lancement par tâche planifié</div>';
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Form
|
||||
if (isset($_POST['username']) && $_POST['username'] != '') { // minimal anti-spam
|
||||
|
@ -346,4 +354,7 @@ $dbco = null;
|
|||
<p>Version <?= VERSION ?> - Créé par David Mercereau sous licence GNU GPL v3</p>
|
||||
<p>Télécharger et utiliser ce script sur le site du projet <a target="_blank" href="http://forge.zici.fr/p/emailpoubelle-php/">emailPoubelle.php</a></p>
|
||||
|
||||
<?php echo CheckUpdate(); ?>
|
||||
<?php
|
||||
LifeExpire();
|
||||
echo CheckUpdate();
|
||||
?>
|
||||
|
|
|
@ -299,4 +299,16 @@ function CheckUpdate() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function LifeExpire() {
|
||||
global $dbco;
|
||||
try {
|
||||
$deletecmd = $dbco->prepare("DELETE FROM ".DBTABLEPREFIX."alias WHERE dateExpir IS NOT NULL AND dateExpir < '".date('Y-m-d H:i:s')."'");
|
||||
$deletecmd->execute();
|
||||
} catch ( PDOException $e ) {
|
||||
echo "DB error : ", $e->getMessage();
|
||||
die();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -248,6 +248,9 @@ article form {
|
|||
text-shadow : 0 -1px 1px rgba(0,0,0,0.25);
|
||||
width : 25%;
|
||||
}
|
||||
article input.button:disabled, .btn{
|
||||
color: #888;
|
||||
}
|
||||
article textarea {
|
||||
height : 100px;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue