mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-09-09 19:38:57 +00:00
- added documentation
- removed getDocuments() which is now in LetoDMS_DMS::getDocumentsByUser()
This commit is contained in:
parent
3187c8967c
commit
8ec46b5f68
|
@ -188,24 +188,29 @@ class LetoDMS_User {
|
||||||
$this->_isHidden = $isAdmin;
|
$this->_isHidden = $isAdmin;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Entfernt den Benutzer aus dem System.
|
|
||||||
* Dies ist jedoch nicht mit einem Löschen des entsprechenden Eintrags aus tblUsers geschehen - vielmehr
|
|
||||||
* muss dafür gesorgt werden, dass der Benutzer nirgendwo mehr auftaucht. D.h. auch die Tabellen tblACLs,
|
|
||||||
* tblNotify, tblGroupMembers, tblFolders, tblDocuments und tblDocumentContent müssen berücksichtigt werden.
|
|
||||||
*/
|
|
||||||
function remove( $assignTo=-1 ) {
|
|
||||||
|
|
||||||
GLOBAL $db, $settings, $user;
|
|
||||||
|
|
||||||
if ($assignTo==-1) $assignTo=$settings->_adminID;
|
/**
|
||||||
|
* Remove the user and also remove all its keywords, notifies, etc.
|
||||||
|
* Do not remove folders and documents of the user, but assign them
|
||||||
|
* to a different user.
|
||||||
|
*
|
||||||
|
* @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 ) { /* {{{ */
|
||||||
|
GLOBAL $db, $user;
|
||||||
|
|
||||||
if (($this->_id==$settings->_adminID) ||($this->_id==$settings->_guestID)) {
|
/* Records like folders and documents that formely have belonged to
|
||||||
return false; // Cannot delete administrator.
|
* the user will assign to another user. If no such user is set,
|
||||||
}
|
* the function now returns false and will not use the admin user
|
||||||
|
* anymore.
|
||||||
//Private Stichwortlisten löschen
|
*/
|
||||||
|
if(!$assignToUser)
|
||||||
|
return;
|
||||||
|
$assignTo = $assignToUser->getID();
|
||||||
|
|
||||||
|
// delete private keyword lists
|
||||||
$queryStr = "SELECT tblKeywords.id FROM tblKeywords, tblKeywordCategories WHERE tblKeywords.category = tblKeywordCategories.id AND tblKeywordCategories.owner = " . $this->_id;
|
$queryStr = "SELECT tblKeywords.id FROM tblKeywords, tblKeywordCategories WHERE tblKeywords.category = tblKeywordCategories.id AND tblKeywordCategories.owner = " . $this->_id;
|
||||||
$resultArr = $db->getResultArray($queryStr);
|
$resultArr = $db->getResultArray($queryStr);
|
||||||
if (count($resultArr) > 0) {
|
if (count($resultArr) > 0) {
|
||||||
|
@ -306,10 +311,9 @@ class LetoDMS_User {
|
||||||
|
|
||||||
// unset($this);
|
// unset($this);
|
||||||
return true;
|
return true;
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
function joinGroup($group)
|
function joinGroup($group) { /* {{{ */
|
||||||
{
|
|
||||||
if ($group->isMember($this))
|
if ($group->isMember($this))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -318,10 +322,9 @@ class LetoDMS_User {
|
||||||
|
|
||||||
unset($this->_groups);
|
unset($this->_groups);
|
||||||
return true;
|
return true;
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
function leaveGroup($group)
|
function leaveGroup($group) { /* {{{ */
|
||||||
{
|
|
||||||
if (!$group->isMember($this))
|
if (!$group->isMember($this))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -330,9 +333,9 @@ class LetoDMS_User {
|
||||||
|
|
||||||
unset($this->_groups);
|
unset($this->_groups);
|
||||||
return true;
|
return true;
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
function getGroups() {
|
function getGroups() { /* {{{ */
|
||||||
GLOBAL $db;
|
GLOBAL $db;
|
||||||
|
|
||||||
if (!isset($this->_groups))
|
if (!isset($this->_groups))
|
||||||
|
@ -351,15 +354,24 @@ class LetoDMS_User {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->_groups;
|
return $this->_groups;
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
function isMemberOfGroup($group)
|
/**
|
||||||
{
|
* Checks if user is member of a given group
|
||||||
|
*
|
||||||
|
* @param object $group
|
||||||
|
* @return boolean true if user is member of the given group otherwise false
|
||||||
|
*/
|
||||||
|
function isMemberOfGroup($group) { /* {{{ */
|
||||||
return $group->isMember($this);
|
return $group->isMember($this);
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
function hasImage()
|
/**
|
||||||
{
|
* Check if user has an image in its profile
|
||||||
|
*
|
||||||
|
* @return boolean true if user has a picture of itself
|
||||||
|
*/
|
||||||
|
function hasImage() { /* {{{ */
|
||||||
if (!isset($this->_hasImage))
|
if (!isset($this->_hasImage))
|
||||||
{
|
{
|
||||||
GLOBAL $db;
|
GLOBAL $db;
|
||||||
|
@ -374,16 +386,18 @@ class LetoDMS_User {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_hasImage;
|
return $this->_hasImage;
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
function getImageURL()
|
/* FIXME: This function should not be a method of the class but rather
|
||||||
{
|
* implemented in the calling application
|
||||||
|
*/
|
||||||
|
function getImageURL() { /* {{{ */
|
||||||
GLOBAL $settings;
|
GLOBAL $settings;
|
||||||
|
|
||||||
// if (!$this->hasImage())
|
// if (!$this->hasImage())
|
||||||
// return false;
|
// return false;
|
||||||
return $settings->_httpRoot . "out/out.UserImage.php?userid=" . $this->_id;
|
return $settings->_httpRoot . "out/out.UserImage.php?userid=" . $this->_id;
|
||||||
}
|
} /* }}} */
|
||||||
|
|
||||||
function setImage($tmpfile, $mimeType)
|
function setImage($tmpfile, $mimeType)
|
||||||
{
|
{
|
||||||
|
@ -511,28 +525,6 @@ class LetoDMS_User {
|
||||||
return $status;
|
return $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDocuments() {
|
|
||||||
GLOBAL $db;
|
|
||||||
|
|
||||||
if (!isset($this->_documents))
|
|
||||||
{
|
|
||||||
$queryStr = "SELECT `tblDocuments`.*, `tblDocumentLocks`.`userID` as `lockUser` ".
|
|
||||||
"FROM `tblDocuments` ".
|
|
||||||
"LEFT JOIN `tblDocumentLocks` ON `tblDocuments`.`id`=`tblDocumentLocks`.`document` ".
|
|
||||||
"WHERE `tblDocuments`.`owner` = " . $this->_id . " ORDER BY `sequence`";
|
|
||||||
|
|
||||||
$resArr = $db->getResultArray($queryStr);
|
|
||||||
if (is_bool($resArr) && !$resArr)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
$this->_documents = array();
|
|
||||||
foreach ($resArr as $row) {
|
|
||||||
array_push($this->_documents, new LetoDMS_Document($row["id"], $row["name"], $row["comment"], $row["date"], $row["expires"], $row["owner"], $row["folder"], $row["inheritAccess"], $row["defaultAccess"], $row["lockUser"], $row["keywords"], $row["sequence"]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->_documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMandatoryReviewers()
|
function getMandatoryReviewers()
|
||||||
{
|
{
|
||||||
GLOBAL $db;
|
GLOBAL $db;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user