moved fsck to filemanager_admin and get cancel button working with CSP

This commit is contained in:
Ralf Becker
2014-06-13 09:22:45 +00:00
parent e25799927d
commit 2a959eb0d2
2 changed files with 26 additions and 34 deletions

View File

@ -22,6 +22,7 @@ class filemanager_admin extends filemanager_ui
*/
public $public_functions = array(
'index' => true,
'fsck' => true,
);
/**
@ -194,4 +195,28 @@ class filemanager_admin extends filemanager_ui
$GLOBALS['egw_info']['flags']['app_header'] = lang('VFS mounts and versioning');
$tpl->exec('filemanager.filemanager_admin.index',$content,$sel_options,$readonlys);
}
/**
* Run fsck on sqlfs
*/
function fsck()
{
if ($_POST['cancel'])
{
egw_framework::redirect_link('/admin/index.php', null, 'admin');
}
$check_only = !isset($_POST['fix']);
if (!($msgs = sqlfs_utils::fsck($check_only)))
{
$msgs = lang('Filesystem check reported no problems.');
}
$content = '<p>'.implode("</p>\n<p>", (array)$msgs)."</p>\n";
$content .= html::form('<p>'.($check_only&&is_array($msgs)?html::submit_button('fix', lang('Fix reported problems')):'').
html::submit_button('cancel', lang('Cancel')).'</p>',
'','/index.php',array('menuaction'=>'filemanager.filemanager_admin.fsck'));
$GLOBALS['egw']->framework->render($content, lang('Admin').' - '.lang('Check virtual filesystem'), true);
}
}