mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-01-26 11:10:24 +00:00
remove createDownloadLink and getDownloadLinks
This commit is contained in:
parent
032f5ab719
commit
7f5bd51300
|
|
@ -6102,37 +6102,6 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
return $needwkflaction;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Create a new download link
|
||||
*
|
||||
* @param SeedDMS_Core_User $user
|
||||
* @param string $expirationdate
|
||||
* @return boolean true if link could be created, otherwise false
|
||||
*/
|
||||
function createDownloadLink($user, $expirationdate) { /* {{{ */
|
||||
$db = $this->_document->_dms->getDB();
|
||||
$hash = md5(uniqid());
|
||||
$queryStr = "INSERT INTO tblDownloadLinks (document, version, userID, hash) VALUES (".$this->_document->getID().", ".$this->_version.", ".$user->getID().", '".$hash."')";
|
||||
if (!$db->getResult($queryStr)) {
|
||||
return false;
|
||||
}
|
||||
$id = $db->getInsertID();
|
||||
|
||||
return SeedDMS_Core_DownloadLink::getInstance($id, $this->_document->_dms);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get all download links of version
|
||||
*
|
||||
* @param SeedDMS_Core_User $user
|
||||
* @param object $user return only links created by this user
|
||||
* @param boolean $all set to true if expired links shall be returned
|
||||
* @return array list of links
|
||||
*/
|
||||
function getDownloadLinks($user=null, $all=false) { /* {{{ */
|
||||
return SeedDMS_Core_DownloadLink::getAllInstances($user, $this->_version, $this->_document->_dms);
|
||||
} /* }}} */
|
||||
|
||||
} /* }}} */
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user