Send notification emails to admins when the cleanup cron job executes so there is some visibility into the maintenance tasks running on the appdb. Fix a minor bug in the user class where passing in (null,null) for iVendorId and iAppId results in a null query string being sent to mysql and triggering an error
This commit is contained in:
@@ -26,6 +26,7 @@ include(BASE."include/mail.php");
|
|||||||
* if(5 AND 3) then 7
|
* if(5 AND 3) then 7
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
notifyAdminsOfCleanupExecution();
|
||||||
|
|
||||||
$hSixMonth = inactiveSince(6);
|
$hSixMonth = inactiveSince(6);
|
||||||
while($oRow = mysql_fetch_object($hSixMonth))
|
while($oRow = mysql_fetch_object($hSixMonth))
|
||||||
@@ -133,4 +134,16 @@ function warnMaintainerDeleted($sEmail)
|
|||||||
|
|
||||||
mail_appdb($sEmail, $sSubject, $sMsg);
|
mail_appdb($sEmail, $sSubject, $sMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* email all admins that the appdb cleanup script is executing */
|
||||||
|
/* so we admins have some visibility into the background cleanup */
|
||||||
|
/* events of the appdb */
|
||||||
|
function notifyAdminsOfCleanupExecution()
|
||||||
|
{
|
||||||
|
$sSubject = "Cleanup script running\r\n";
|
||||||
|
$sMsg = "Appdb cleanup cron script is executing.\r\n";
|
||||||
|
$sEmail = get_notify_email_address_list(null, null); /* get list admins */
|
||||||
|
if($sEmail)
|
||||||
|
mail_appdb($sEmail, $sSubject, $sMsg);
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -698,6 +698,8 @@ function get_notify_email_address_list($iAppId = null, $iVersionId = null)
|
|||||||
FROM appMaintainers
|
FROM appMaintainers
|
||||||
WHERE appId = '".$iAppId."'";
|
WHERE appId = '".$iAppId."'";
|
||||||
}
|
}
|
||||||
|
if($sQuery)
|
||||||
|
{
|
||||||
$hResult = query_appdb($sQuery);
|
$hResult = query_appdb($sQuery);
|
||||||
if(mysql_num_rows($hResult) > 0)
|
if(mysql_num_rows($hResult) > 0)
|
||||||
{
|
{
|
||||||
@@ -707,7 +709,7 @@ function get_notify_email_address_list($iAppId = null, $iVersionId = null)
|
|||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Retrieve administrators.
|
* Retrieve administrators.
|
||||||
|
|||||||
Reference in New Issue
Block a user