updated GitHub links in the Admin Maintain panel

This commit is contained in:
azett 2018-12-31 13:06:25 +01:00
parent e72a859d85
commit 7e9c1666c3

View File

@ -19,13 +19,11 @@
function __construct() {
// $this->smarty = $GLOBALS['_FP_SMARTY'];
$this->_directory = CACHE_DIR;
parent::__construct();
}
function _checkFile($directory, $file) {
if ($file != CACHE_FILE) {
array_push($this->_list, $file);
fs_delete("$directory/$file");
@ -64,37 +62,45 @@
}
/*********************/
/**
* ******************
*/
class admin_maintain extends AdminPanel {
var $panelname = 'maintain';
var $actions = array('default'=>false, 'updates'=>false);
}
var $panelname = 'maintain';
var $actions = array(
'default' => false,
'updates' => false
);
}
class admin_maintain_updates extends AdminPanelAction {
// URL to fetch the latest version infos
var $web = 'http://flatpress.org/fp/VERSION';
var $fpweb = 'https://github.com/evacchi/flatpress';
var $sfweb = 'https://github.com/evacchi/flatpress/releases';
// URL to the latest final release
var $fpweb = 'https://github.com/flatpressblog/flatpress';
// URL to the latest dev release
var $sfweb = 'https://github.com/flatpressblog/flatpress/releases';
function main() {
$success = -1;
$ver = array(
'stable' => 'unknown',
'unstable'=>'unknown',
'unstable' => 'unknown'
);
$file = utils_geturl($this->web);
if ($file) {
$ver = utils_kexplode($file ['content']);
if (!isset($ver['stable'])) { $success = -1; }
elseif (system_ver_compare($ver['stable'], SYSTEM_VER)) {
if (!isset($ver ['stable'])) {
$success = -1;
} elseif (system_ver_compare($ver ['stable'], SYSTEM_VER)) {
$success = 1;
} else {
$success = 2;
@ -103,24 +109,24 @@
$success = -1;
}
$this->smarty->assign('updates', $ver);
$this->smarty->assign('fpweb', $this->fpweb);
$this->smarty->assign('sfweb', $this->sfweb);
$this->smarty->assign('success', $success);
}
}
class admin_maintain_default extends AdminPanelAction {
var $commands = array('do');
var $commands = array(
'do'
);
function dodo($do) {
switch ($do) {
case 'rebuild': {
case 'rebuild':
{
if (substr(INDEX_DIR, -1) == '/')
$oldidx = substr(INDEX_DIR, 0, -1);
@ -134,26 +140,25 @@
echo "BACKUP INDEX to $movedir\n";
$ret = @rename($oldidx, $movedir);
if (!$ret) trigger_error('Cannot backup old index. STOP.', E_USER_ERROR);
if (!$ret)
trigger_error('Cannot backup old index. STOP.', E_USER_ERROR);
}
fs_mkdir(INDEX_DIR);
new s_entry_crawler;
new s_entry_crawler();
exit("\nDONE \nPlease, select the back arrow in your browser");
return PANEL_NOREDIRECT;
}
case 'restorechmods': {
case 'restorechmods':
{
$this->smarty->assign('files', fs_chmod_recursive());
$this->smarty->assign('success', 1);
return PANEL_NOREDIRECT;
}
case 'purgetplcache': {
$tpldel = new tpl_deleter;
case 'purgetplcache':
{
$tpldel = new tpl_deleter();
unset($tpldel);
$this->smarty->cache_dir = CACHE_DIR . 'cache/';
$this->smarty->caching = 0;
@ -168,7 +173,8 @@
return PANEL_NOREDIRECT;
}
case 'phpinfo': {
case 'phpinfo':
{
ob_start();
phpinfo();
$info = ob_get_contents();
@ -179,14 +185,9 @@
return PANEL_NOREDIRECT;
}
}
function main() {
}
}