quota can be set

This commit is contained in:
Uwe Steinmann 2014-05-20 06:23:32 +02:00
parent 7cbd9ec287
commit 8cd9210107

View File

@ -49,6 +49,10 @@ if ($action == "adduser") {
$pwdexpiration = ''; $pwdexpiration = '';
else else
$pwdexpiration = $_POST["pwdexpiration"]; $pwdexpiration = $_POST["pwdexpiration"];
if(!isset($_POST["quota"]))
$quota = 0;
else
$quota = (int) $_POST["quota"];
$name = $_POST["name"]; $name = $_POST["name"];
$email = $_POST["email"]; $email = $_POST["email"];
$comment = $_POST["comment"]; $comment = $_POST["comment"];
@ -63,6 +67,9 @@ if ($action == "adduser") {
$newUser = $dms->addUser($login, md5($pwd), $name, $email, $settings->_language, $settings->_theme, $comment, $role, $isHidden, $isDisabled, $pwdexpiration); $newUser = $dms->addUser($login, md5($pwd), $name, $email, $settings->_language, $settings->_theme, $comment, $role, $isHidden, $isDisabled, $pwdexpiration);
if ($newUser) { if ($newUser) {
/* Set Quota */
$newUser->setQuota($quota);
/* Set user image if uploaded */ /* Set user image if uploaded */
if (isset($_FILES["userfile"]) && is_uploaded_file($_FILES["userfile"]["tmp_name"]) && $_FILES["userfile"]["size"] > 0 && $_FILES['userfile']['error']==0) if (isset($_FILES["userfile"]) && is_uploaded_file($_FILES["userfile"]["tmp_name"]) && $_FILES["userfile"]["size"] > 0 && $_FILES['userfile']['error']==0)
{ {
@ -189,6 +196,10 @@ else if ($action == "edituser") {
$pwdexpiration = $_POST["pwdexpiration"]; $pwdexpiration = $_POST["pwdexpiration"];
else else
$pwdexpiration = ''; $pwdexpiration = '';
if(!isset($_POST["quota"]))
$quota = 0;
else
$quota = (int) $_POST["quota"];
$name = $_POST["name"]; $name = $_POST["name"];
$email = $_POST["email"]; $email = $_POST["email"];
$comment = $_POST["comment"]; $comment = $_POST["comment"];
@ -226,6 +237,8 @@ else if ($action == "edituser") {
$editedUser->setComment($comment); $editedUser->setComment($comment);
if ($editedUser->getRole() != $role) if ($editedUser->getRole() != $role)
$editedUser->setRole($role); $editedUser->setRole($role);
if ($editedUser->getQuota() != $quota)
$editedUser->setQuota($quota);
if ($editedUser->isHidden() != $isHidden) if ($editedUser->isHidden() != $isHidden)
$editedUser->setHidden($isHidden); $editedUser->setHidden($isHidden);
if ($editedUser->isDisabled() != $isDisabled) { if ($editedUser->isDisabled() != $isDisabled) {