mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
- pass the user how removes a group or user to remove()
This commit is contained in:
parent
17dae3a432
commit
985a1f3915
|
@ -161,14 +161,16 @@ class LetoDMS_Group {
|
|||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Entfernt die Gruppe aus dem System.
|
||||
* Dies ist jedoch nicht mit einem Löschen des entsprechenden Eintrags aus tblGroups geschehen - vielmehr
|
||||
* muss dafür gesorgt werden, dass die Gruppe nirgendwo mehr auftaucht. D.h. auch die Tabellen tblACLs,
|
||||
* tblNotify und tblGroupMembers müssen berücksichtigt werden.
|
||||
* Delete user group
|
||||
* This function deletes the user group and all it references, like access
|
||||
* control lists, notifications, as a child of other groups, etc.
|
||||
*
|
||||
* @param object $user the user doing the removal (needed for entry in
|
||||
* review log.
|
||||
* @return boolean true on success or false in case of an error
|
||||
*/
|
||||
function remove() { /* {{{ */
|
||||
function remove($user) { /* {{{ */
|
||||
$db = $this->_dms->getDB();
|
||||
$user = $this->_dms->user;
|
||||
|
||||
$queryStr = "DELETE FROM tblGroups WHERE id = " . $this->_id;
|
||||
if (!$db->getResult($queryStr))
|
||||
|
|
|
@ -284,13 +284,14 @@ class LetoDMS_User {
|
|||
* Do not remove folders and documents of the user, but assign them
|
||||
* to a different user.
|
||||
*
|
||||
* @param object $user the user doing the removal (needed for entry in
|
||||
* review log.
|
||||
* @param object $assignToUser the user who is new owner of folders and
|
||||
* documents which previously were owned by the delete user.
|
||||
* @return boolean true on success or false in case of an error
|
||||
*/
|
||||
function remove( $assignToUser=null ) { /* {{{ */
|
||||
function remove($user, $assignToUser=null) { /* {{{ */
|
||||
$db = $this->_dms->getDB();
|
||||
$user = $this->_dms->user;
|
||||
|
||||
/* Records like folders and documents that formely have belonged to
|
||||
* the user will assign to another user. If no such user is set,
|
||||
|
|
|
@ -67,7 +67,7 @@ else if ($action == "removegroup") {
|
|||
UI::exitError(getMLText("admin_tools"),getMLText("invalid_group_id"));
|
||||
}
|
||||
|
||||
if (!$group->remove()) {
|
||||
if (!$group->remove($user)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ else if ($action == "removeuser") {
|
|||
}
|
||||
|
||||
$userToAssign = $dms->getUser($_POST["assignTo"]);
|
||||
if (!$userToRemove->remove($userToAssign)) {
|
||||
if (!$userToRemove->remove($user, $userToAssign)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user