* Filemanager/Admin: ability to check virtual filesystem (Admin >> Check virtual filesystem) and some code to prefent double creation of directories

This commit is contained in:
Ralf Becker
2012-02-27 13:18:52 +00:00
parent d7a7d105fa
commit fd19c672c8
6 changed files with 408 additions and 82 deletions

View File

@ -1,9 +1,10 @@
<?php
/**
* Admin-, Preferences- and SideboxMenu-Hooks
* EGroupware Admin: Hooks
*
* @link http://www.egroupware.org
* @author Stefan Becker <StefanBecker-AT-outdoor-training.de>
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
* @package admin
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
@ -11,7 +12,6 @@
/**
* Static hooks for admin application
*
*/
class admin_prefs_sidebox_hooks
{
@ -21,7 +21,8 @@ class admin_prefs_sidebox_hooks
* @var unknown_type
*/
var $public_functions = array(
'register_all_hooks' => True
'register_all_hooks' => True,
'fsck' => true,
);
/**
@ -101,6 +102,11 @@ class admin_prefs_sidebox_hooks
$file['Find and Register all Application Hooks'] = egw::link('/index.php','menuaction=admin.admin_prefs_sidebox_hooks.register_all_hooks');
}
//if (! $GLOBALS['egw']->acl->check('applications_access',16,'admin'))
{
$file['Check virtual filesystem'] = egw::link('/index.php','menuaction=admin.admin_prefs_sidebox_hooks.fsck');
}
if (! $GLOBALS['egw']->acl->check('asyncservice_access',1,'admin'))
{
$file['Asynchronous timed services'] = egw::link('/index.php','menuaction=admin.uiasyncservice.index');
@ -151,4 +157,24 @@ class admin_prefs_sidebox_hooks
}
$GLOBALS['egw']->redirect_link('/admin/index.php');
}
/**
* Run fsck on sqlfs
*/
function fsck()
{
$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'), "window.location.href='".egw::link('/admin/index.php')."'; return false;").'</p>',
'',egw::link('/index.php',array('menuaction'=>'admin.admin_prefs_sidebox_hooks.fsck')));
$GLOBALS['egw']->framework->render($content, lang('Admin').' - '.lang('Check virtual filesystem'), true);
}
}