summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-23 09:39:10 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-23 09:39:10 -0400
commit841681579bda0934296ab828abef792f1ce509f7 (patch)
tree2a481d0a10955448ab69eb214237e42eef9f5ab3
parentd564f9002e831d3e8a0dd3539e1a14689d34b624 (diff)
downloadthemesite-841681579bda0934296ab828abef792f1ce509f7.tar.gz
themesite-841681579bda0934296ab828abef792f1ce509f7.zip
don't run checkallwps() within www context.
instead schedule it to be run as part of the site update cron
-rw-r--r--private/templates/checkthemes.tpl35
-rw-r--r--private/templates/frontpage.tpl2
-rw-r--r--www/admin.php5
3 files changed, 3 insertions, 39 deletions
diff --git a/private/templates/checkthemes.tpl b/private/templates/checkthemes.tpl
deleted file mode 100644
index 4ab7d43..0000000
--- a/private/templates/checkthemes.tpl
+++ /dev/null
@@ -1,35 +0,0 @@
-{assign var="parent" value="admin.php|Admin frontpage"}
-{assign var="self" value="Check themes"}
-{include file="header.tpl" title="Admin - $self"}
-
-<h1>Checking all themes</h1>
-
-{include file="breadcrumbs.tpl"}
-
-<table class="rockbox">
-{section name=i loop=$checkwpsresults}
- <tr> <td>
- {if $checkwpsresults[i].summary.pass}
- <tt style="color: green">pass</tt>
- {else}
- <tt style="color: red">fail</tt>
- {/if}
- </td> <td>
- {$checkwpsresults[i].theme.mainlcd}/{$checkwpsresults[i].theme.shortname}/{$checkwpsresults[i].theme.zipfile} ({$checkwpsresults[i].summary.duration|string_format:'%0.3f'} seconds)
- </td>
- {foreach from=$checkwpsresults[i].result key=version item=result}
- {foreach from=$result key=target item=res}
- <td>
- {if $res.pass}
- <tt style="color: green">{$target} {$version} </tt>
- {else}
- <tt style="color: red">{$target} {$version} </tt>
- {/if}
- </td>
- {/foreach}
- {/foreach}
- </tr>
-{/section}
-</table>
-
-{include file="footer.tpl"}
diff --git a/private/templates/frontpage.tpl b/private/templates/frontpage.tpl
index f0b12eb..1af0add 100644
--- a/private/templates/frontpage.tpl
+++ b/private/templates/frontpage.tpl
@@ -57,7 +57,7 @@ You can also directly search for specific themes here: <br/>
</form>
{if $admin}
-<p><a href="{$smarty.server.SCRIPT_NAME}?runcheckwps">Run checkwps on all themes</a></p>
+<p><a href="{$smarty.server.SCRIPT_NAME}?runcheckwps">Schedule checkwps run</a></p>
<hr />
{if $adminmsg}<p>{$adminmsg}</p> <hr />{/if}
<p><a href="{$smarty.server.SCRIPT_NAME}?showlog">View database log</a></p>
diff --git a/www/admin.php b/www/admin.php
index ec35a44..cdeafdb 100644
--- a/www/admin.php
+++ b/www/admin.php
@@ -157,9 +157,8 @@ else {
}
/* Run checkwps on all themes */
elseif (isset($_REQUEST['runcheckwps'])) {
- $results = $site->checkallthemes();
- $template = 'checkthemes.tpl';
- $t->assign('checkwpsresults', $results);
+ system("/bin/touch " . preconfig::privpath . "../need_update");
+ $t->assign('adminmsg', 'WPS run scheduled');
}
/* Show log */
elseif (isset($_REQUEST['showlog'])) {