// Read key from secret file
if ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && ((getFileHash() == '') || (getMasterSalt() == '') || (getPassScramble() == ''))) {
- // Cache instance
// Maybe need setup of secret key!
loadIncludeOnce('inc/gen_sql_patches.php');
-
- // @TODO Rewrite this to a filter
- if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isCacheInstanceValid())) {
- // Destroy some cache files
- if ($GLOBALS['cache_instance']->loadCacheFile('config')) $GLOBALS['cache_instance']->removeCacheFile();
- if ($GLOBALS['cache_instance']->loadCacheFile('extension')) $GLOBALS['cache_instance']->removeCacheFile();
- if ($GLOBALS['cache_instance']->loadCacheFile('modules')) $GLOBALS['cache_instance']->removeCacheFile();
- } // END - if
} // END - if
// Test again
if (isFileReadable($FQFN)) {
// Also update configuration
setConfigEntry('secret_key', $secretKey);
+ updateConfiguration('file_hash', $fileHash);
// Remove variables
unset($secretKey);
} // END - if
} // END - if
+// @TODO Rewrite this to a filter
+if ((isExtensionInstalledAndNewer('cache', '0.1.2')) && (isCacheInstanceValid())) {
+ // Destroy some cache files
+ if ($GLOBALS['cache_instance']->loadCacheFile('config')) $GLOBALS['cache_instance']->removeCacheFile();
+ if ($GLOBALS['cache_instance']->loadCacheFile('extension')) $GLOBALS['cache_instance']->removeCacheFile();
+ if ($GLOBALS['cache_instance']->loadCacheFile('modules')) $GLOBALS['cache_instance']->removeCacheFile();
+} // END - if
+
// [EOF]
?>
if ((isset($postData['assign'])) && (count($postData['sel']) > 0)) {
// Assign / do tasks
$OUT = '';
- foreach ($postData['sel'] as $id => $sel) {
+ foreach ($postData['sel'] as $taskId => $sel) {
$result_task = SQL_QUERY_ESC("SELECT
`id`, `userid`, `task_type`, `subject`, `text`, `task_created`, `status`, `assigned_admin`
FROM
`id`=%s AND (`assigned_admin`=%s OR (`assigned_admin`=0 AND `status`='NEW'))
LIMIT 1",
array(
- bigintval($id),
+ bigintval($taskId),
getCurrentAdminId()
), __FILE__, __LINE__);
$title = '{--TASK_NO_TITLE--}';
// Shall I list SQL commands assigned to an extension installation or update task?
- if (isVerboseSqlEnabled()) {
+ if ((isVerboseSqlEnabled()) || (!isExtensionInstalled('sql_patches'))) {
// Extract extension name from subject
$ext_name = substr($taskData['subject'], 1, strpos($taskData['subject'], ':') - 1);
// Update task or extension task?
if (($taskData['task_type'] == 'EXTENSION') && (!isExtensionInstalled($ext_name))) {
// Load SQL commands for registering in dry-run
- registerExtension($ext_name, $id, true);
+ registerExtension($ext_name, $taskId, true);
// Is this non-productive?
if (isExtensionProductive() === false) {
if ($lines == '0') {
// New extension found
$OUT .= loadTemplate('admin_extension_reg_form', true, array(
- 'id' => bigintval($id),
+ 'id' => bigintval($taskId),
'ext_name' => $ext_name
));
} else {
break;
case 'MEMBER_ORDER': // Member mail orders
- $OUT .= loadTemplate('admin_task_order', true, $id);
+ $OUT .= loadTemplate('admin_task_order', true, $taskId);
break;
default: // Unknown task type
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $taskData['task_type']));
- $OUT .= '<div class="admin_failed medium">' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $taskData['task_type'], $id) . '</div>';
+ $OUT .= '<div class="admin_failed medium">' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $taskData['task_type'], $taskId) . '</div>';
break;
}
$OUT .= '
// Only unassign / delete tasks when there are selected tasks posted
if (!empty($postData['unassign'])) {
// Unassign from tasks
- foreach ($postData['sel'] as $id => $sel) {
+ foreach ($postData['sel'] as $taskId => $sel) {
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=0 WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
- array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
+ array(bigintval($taskId), getCurrentAdminId()), __FILE__, __LINE__);
}
} elseif (isset($postData['del'])) {
// Delete tasks
- foreach ($postData['sel'] as $id => $sel) {
+ foreach ($postData['sel'] as $taskId => $sel) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s AND `assigned_admin` IN (%s,0) LIMIT 1",
- array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
+ array(bigintval($taskId), getCurrentAdminId()), __FILE__, __LINE__);
}
} else {
// Unknown action