messages['softblock'][0] = array('ERROR', _('Block soft quota'), _('Block soft quota contains invalid characters. Only natural numbers are allowed'));
$this->messages['hardblock'][0] = array('ERROR', _('Block hard quota'), _('Block hard quota contains invalid characters. Only natural numbers are allowed'));
$this->messages['softinode'][0] = array('ERROR', _('Inode soft quota'), _('Inode soft quota contains invalid characters. Only natural numbers are allowed'));
$this->messages['hardinode'][0] = array('ERROR', _('Inode hard quota'), _('Inode hard quota contains invalid characters. Only natural numbers are allowed'));
$this->messages['block_cmp'][0] = array('ERROR', _('Block quota'), _('Block soft quota must be smaller than block hard quota'));
$this->messages['inode_cmp'][0] = array('ERROR', _('Inode quota'), _('Inode soft quota must be smaller than inode hard quota'));
}
/**
* Returns meta data that is interpreted by parent class
*
* @return array array with meta data
*/
function get_metaData() {
$return = array();
// manages user and group accounts
$return["account_types"] = array("user", "group");
// alias name
$return["alias"] = _('Quota');
if ($this->get_scope() == 'group') {
// module dependencies
$return['dependencies'] = array('depends' => array('posixGroup'), 'conflicts' => array());
}
if ($this->get_scope() == 'user') {
// module dependencies
$return['dependencies'] = array('depends' => array('posixAccount'), 'conflicts' => array());
}
// available PDF fields
$return['PDF_fields'] = array( 'quotas');
// help entries
$return['help'] = array(
"Mountpoint" => array(
"ext" => "FALSE",
"Headline" => _("Mountpoint"),
"Text" => _("Mountpoint of device with enabled quotas.")),
"UsedBlocks" => array(
"ext" => "FALSE",
"Headline" => _("Used blocks"),
"Text" => _("Used blocks. 1000 blocks are usually 1MB")),
"SoftBlockLimit" => array(
"ext" => "FALSE",
"Headline" => _("Soft block limit"),
"Text" => _("Soft block limit."), "SeeAlso" => ''.
'Quota How-To'),
"HardBlockLimit" => array(
"ext" => "FALSE",
"Headline" => _("Hard block limit"),
"Text" => _("Hard block limit").'.', "SeeAlso" => ''.
'Quota How-To'),
"GraceBlockPeriod" => array(
"ext" => "FALSE",
"Headline" => _("Grace block period"),
"Text" => _("Grace block period. Most filesystems use a fixed maximum value of 7 days."), "SeeAlso" => ''.
'Quota How-To'),
"UsedInodes" => array(
"ext" => "FALSE",
"Headline" => _("Used inodes"),
"Text" => _("Used inodes (files)").'.'),
"SoftInodeLimit" => array(
"ext" => "FALSE",
"Headline" => _("Soft inode limit"),
"Text" => _("Soft inode (files) limit."), "SeeAlso" => ''.
'Quota How-To'),
"HardInodeLimit" => array(
"ext" => "FALSE",
"Headline" => _("Hard inode limit"),
"Text" => _("Hard inode (files) limit").'.', "SeeAlso" => ''.
'Quota How-To'),
"GraceInodePeriod" => array(
"ext" => "FALSE",
"Headline" => _("Grace inode period"),
"Text" => _("Grace inode (files) period. Most filesystems use a fixed maximum value of 7 days."), "SeeAlso" => ''.
'Quota How-To'),
);
return $return;
}
// Constructor
function init($base) {
// call parent init
parent::init($base);
// Get basic quotas for new account
$output_array = $_SESSION[$this->base]->lamdaemon(array("+ quota get " . $_SESSION[$this->base]->type));
// process quotas
if (is_array($output_array)) {
$all_quota = explode(':', $output_array[0]);
for ($j=0; $jquota[$j][$k] = $single_quota[$k];
if ($this->quota[$j][4]