cleanup.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:2k
- <?php
- // +-------------------------------------------------------------+
- // | DeskPRO v [2.0.1 Production]
- // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
- // | Supplied by WTN-WDYL
- // | Nullified by WTN-WDYL
- // | Distribution via WebForum, ForumRU and associated file dumps
- // +-------------------------------------------------------------+
- // | DESKPRO IS NOT FREE SOFTWARE
- // +-------------------------------------------------------------+
- // | License ID : Full Enterprise License =) ...
- // | License Owner : WTN-WDYL Team
- // +-------------------------------------------------------------+
- // | $RCSfile: cleanup.php,v $
- // | $Date: 2004/02/10 01:34:25 $
- // | $Revision: 1.11 $
- // +-------------------------------------------------------------+
- // | File Details:
- // | - Internal maintenance.
- // +-------------------------------------------------------------+
- error_reporting(E_ALL ^ E_NOTICE);
- cron_check();
- // Delete old search data more than a week old
- $time = mktime() - (60 * 60 * 24 * 7); // one week
- $db->query("DELETE FROM search WHERE 'time' < $time");
- // Delete attachments uploaded but no ticket created
- $time = mktime() - (60 * 60 * 24 * 7); // one week
- $db->query("
- DELETE FROM ticket_attachments WHERE
- NOT ticketid
- AND timestamp < $time
- ");
- // Delete source emails
- if ($options['delete_emails']) {
- $db->query("DELETE FROM gateway_source");
- $db->query("UPDATE ticket SET sourceid = 0");
- }
- if ($warn = max_limits('tickets', 0, 1)) {
- $warning[] = "$warn tickets left.n";
- }
- if ($warn = max_limits('faq', 0, 1)) {
- $warning[] = "$warn faq left.n";
- }
- if (is_array($warning)) {
- $expiry_data = join("n", $warning);
- eval(makeemaileval('message', 'TECHBODY_license_expiring_soon', $subject));
- dp_mail($settings['email_offemail'], $subject, $message);
- }