diff --git a/lam/lib/modules/quota.inc b/lam/lib/modules/quota.inc index fda16545..5df7fc7e 100644 --- a/lam/lib/modules/quota.inc +++ b/lam/lib/modules/quota.inc @@ -296,7 +296,39 @@ class quota extends baseModule { } function get_profileOptions() { + // Get quotas + $quotas = $_SESSION[$this->base]->lamdaemon(array("+ quota get " . $this->get_scope())); + $dirs = split(":", $quotas[0]); + array_pop($dirs); // remove empty element at the end + for ($i = 0; $i < sizeof($dirs); $i++) { + $dirs[$i] = split(",", $dirs[$i]); + $dirs[$i] = $dirs[$i][0]; + } $return = array(); + if (sizeof($dirs) < 1) return $return; // stop if no quota directories were found + $return[] = array ( + 0 => array('kind' => 'text', 'text' => '' . _('Mountpoint') . '  ', 'align' => 'center'), + 1 => array('kind' => 'text', 'text' => '' . _('Soft block limit') . '  ', 'align' => 'center'), + 2 => array('kind' => 'text', 'text' => '' . _('Hard block limit') . '  ', 'align' => 'center'), + 3 => array('kind' => 'text', 'text' => '' . _('Soft inode limit') . '  ', 'align' => 'center'), + 4 => array('kind' => 'text', 'text' => '' . _('Hard inode limit') . '  ', 'align' => 'center'), + ); + $return[] = array ( + 0 => array('kind' => 'help', 'value' => 'TODO', 'align' => 'center'), + 1 => array('kind' => 'help', 'value' => 'TODO', 'align' => 'center'), + 2 => array('kind' => 'help', 'value' => 'TODO', 'align' => 'center'), + 3 => array('kind' => 'help', 'value' => 'TODO', 'align' => 'center'), + 4 => array('kind' => 'help', 'value' => 'TODO', 'align' => 'center'), + ); + for ($i = 0; $i < sizeof($dirs); $i++) { + $return[] = array( + 0 => array('kind' => 'text', 'text' => $dirs[$i], 'align' => 'left'), + 1 => array('kind' => 'input', 'type' => 'text', 'text' => "", 'align' => 'center', 'size' => '12', 'name' => "quota_softblock_$i"), + 2 => array('kind' => 'input', 'type' => 'text', 'text' => "", 'align' => 'center', 'size' => '12', 'name' => "quota_softblock_$i"), + 3 => array('kind' => 'input', 'type' => 'text', 'text' => "", 'align' => 'center', 'size' => '12', 'name' => "quota_softblock_$i"), + 4 => array('kind' => 'input', 'type' => 'text', 'text' => "", 'align' => 'center', 'size' => '12', 'name' => "quota_softblock_$i"), + ); + } return $return; }