New pages to control generation queue
This commit is contained in:
parent
8b3d771fd1
commit
5836a3c3d8
6 changed files with 139 additions and 6 deletions
51
onyx/include/admin/generation.php
Normal file
51
onyx/include/admin/generation.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
if (count($p) > 2)
|
||||
{
|
||||
switch($p[2])
|
||||
{
|
||||
case "custom":
|
||||
if (!empty($_POST["cmds"]))
|
||||
$ret = pipe_backend_scheduler($_POST["cmds"]);
|
||||
break;
|
||||
|
||||
case "clear":
|
||||
$ret = pipe_backend_scheduler("clear");
|
||||
break;
|
||||
|
||||
case "full":
|
||||
$ret = pipe_backend_scheduler("resetr:ERRORS:HOME:all:DS");
|
||||
break;
|
||||
|
||||
case "freeze":
|
||||
$ret = pipe_backend_scheduler("freeze");
|
||||
break;
|
||||
case "unfreeze":
|
||||
$ret = pipe_backend_scheduler("unfreeze");
|
||||
break;
|
||||
|
||||
case "nginx":
|
||||
$ret = pipe_backend_scheduler("RTEAMS_NOWNOW");
|
||||
break;
|
||||
|
||||
case "team":
|
||||
if (!empty($_POST["team"]))
|
||||
$ret = pipe_backend_scheduler("resetr:TEAM".intval($_POST["team"]).":SYNCS");
|
||||
break;
|
||||
|
||||
case "sync":
|
||||
$ret = pipe_backend_scheduler("SYNCSYNCSYNCSYNCSYNC");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($ret))
|
||||
{
|
||||
$template->assign("return", $ret);
|
||||
return "admin/generation";
|
||||
}
|
||||
|
||||
header("Location: /".SALT_ADMIN."/");
|
||||
exit();
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
@$template->assign("DEF_TIME", $VAR['default_time']);
|
||||
|
||||
if (empty($VAR['misc_dir']))
|
||||
{
|
||||
erreur("Please add <var>misc_dir</var> variable into <code>root.xml</code> configuration.");
|
||||
|
|
@ -10,10 +12,7 @@ if (empty($VAR['misc_dir']))
|
|||
$misc_dir = $VAR['misc_dir'];
|
||||
|
||||
if (!is_dir("$misc_dir/shared") || !is_writable("$misc_dir/shared"))
|
||||
{
|
||||
erreur("<code>$misc_dir/shared/</code> directory not writable.");
|
||||
return "admin/home";
|
||||
}
|
||||
|
||||
$template->assign("cert_writable", is_writable("$misc_dir/shared/") && is_writable("$misc_dir/PKI/"));
|
||||
|
||||
|
|
@ -37,4 +36,10 @@ if (file_exists($srv_file))
|
|||
openssl_x509_parse(file_get_contents($srv_file)));
|
||||
}
|
||||
|
||||
/* GENERATION */
|
||||
|
||||
$queue = explode("\n", pipe_backend_scheduler("show"));
|
||||
unset($queue[0], $queue[1]);
|
||||
$template->assign("queue", array_filter($queue, function($var){ return !empty($var); }));
|
||||
|
||||
return "admin/home";
|
||||
|
|
|
|||
Reference in a new issue