mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
add fields for homefolder and quota
This commit is contained in:
parent
84c89c3ed6
commit
52bab22fc2
|
@ -55,12 +55,14 @@ if ($action == "adduser") {
|
|||
$role = preg_replace('/[^0-2]+/', '', $_POST["role"]);
|
||||
$isHidden = (isset($_POST["ishidden"]) && $_POST["ishidden"]==1 ? 1 : 0);
|
||||
$isDisabled = (isset($_POST["isdisabled"]) && $_POST["isdisabled"]==1 ? 1 : 0);
|
||||
$homefolder = (isset($_POST["homefolder"]) ? $_POST["homefolder"] : 0);
|
||||
$quota = (isset($_POST["quota"]) ? (int) $_POST["quota"] : 0);
|
||||
|
||||
if (is_object($dms->getUserByLogin($login))) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("user_exists"));
|
||||
}
|
||||
|
||||
$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, $homefolder);
|
||||
if ($newUser) {
|
||||
|
||||
/* Set user image if uploaded */
|
||||
|
@ -195,6 +197,8 @@ else if ($action == "edituser") {
|
|||
$role = preg_replace('/[^0-2]+/', '', $_POST["role"]);
|
||||
$isHidden = (isset($_POST["ishidden"]) && $_POST["ishidden"]==1 ? 1 : 0);
|
||||
$isDisabled = (isset($_POST["isdisabled"]) && $_POST["isdisabled"]==1 ? 1 : 0);
|
||||
$homefolder = (isset($_POST["homefolder"]) ? $_POST["homefolder"] : 0);
|
||||
$quota = (isset($_POST["quota"]) ? (int) $_POST["quota"] : 0);
|
||||
|
||||
if ($editedUser->getLogin() != $login)
|
||||
$editedUser->setLogin($login);
|
||||
|
@ -233,6 +237,10 @@ else if ($action == "edituser") {
|
|||
if(!$isDisabled)
|
||||
$editedUser->clearLoginFailures();
|
||||
}
|
||||
if ($editedUser->getHomeFolder() != $homefolder)
|
||||
$editedUser->setHomeFolder($homefolder);
|
||||
if ($editedUser->getQuota() != $quota)
|
||||
$editedUser->setQuota($quota);
|
||||
if(isset($_POST["workflow"]) && $_POST["workflow"]) {
|
||||
$currworkflow = $editedUser->getMandatoryWorkflow();
|
||||
if (!$currworkflow || ($currworkflow->getID() != $_POST["workflow"])) {
|
||||
|
|
|
@ -187,6 +187,14 @@ function showUser(selectObj) {
|
|||
?>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("home_folder")?>:</td>
|
||||
<td><?php $this->printFolderChooser("form0", M_READ, -1, false, 'homefolder');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("quota");?>:</td>
|
||||
<td><input type="text" name="quota"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("is_hidden");?>:</td>
|
||||
<td><input type="checkbox" name="ishidden" value="1"></td>
|
||||
|
@ -393,6 +401,14 @@ function showUser(selectObj) {
|
|||
?>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("home_folder")?>:</td>
|
||||
<td><?php $this->printFolderChooser("form".$currUser->getId(), M_READ, -1, $dms->getFolder($currUser->getHomeFolder()), 'homefolder');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("quota");?>:</td>
|
||||
<td><input type="text" name="quota" value="<?php print $currUser->getQuota(); ?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("is_hidden");?>:</td>
|
||||
<td><input type="checkbox" name="ishidden" value="1"<?php print ($currUser->isHidden() ? " checked='checked'" : "");?>></td>
|
||||
|
|
Loading…
Reference in New Issue
Block a user