fixed group quotas

This commit is contained in:
Roland Gruber 2007-10-11 17:51:35 +00:00
parent 8cfb499518
commit 1df1725fed
1 changed files with 12 additions and 4 deletions

View File

@ -77,7 +77,7 @@ class quota extends baseModule {
$return['dependencies'] = array('depends' => array('posixAccount'), 'conflicts' => array());
}
// managed attributes
$return['attributes'] = array('uid');
$return['attributes'] = array('uid', 'cn');
// available PDF fields
$return['PDF_fields'] = array(
'quotas'
@ -94,7 +94,9 @@ class quota extends baseModule {
),
"SoftBlockLimit" => array(
"Headline" => _("Soft block limit"),
"Text" => _("Soft block limit."), "SeeAlso" => '<a href="http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.4">'.'Quota How-To</a>'
"Text" => _("Soft block limit."), "SeeAlso" => array(
'link' => 'http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Quota.html#ss4.4"',
'text' => 'Quota How-To')
),
"HardBlockLimit" => array(
"Headline" => _("Hard block limit"),
@ -139,9 +141,15 @@ class quota extends baseModule {
if (isset($this->quota)) return;
$userName = '+';
if (($this->getAccountContainer() != null) && !$this->getAccountContainer()->isNewAccount) {
if ($this->get_scope() == 'user') {
if (!isset($this->attributes['uid'][0])) return;
$userName = $this->attributes['uid'][0];
}
else if ($this->get_scope() == 'group') {
if (!isset($this->attributes['cn'][0])) return;
$userName = $this->attributes['cn'][0];
}
}
// get list of lamdaemon servers
$lamdaemonServers = explode(";", $_SESSION['config']->get_scriptServers());
for ($s = 0; $s < sizeof($lamdaemonServers); $s++) {