mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +00:00
Merge branch 'seeddms-4.3.x' into seeddms-5.0.x
This commit is contained in:
commit
2045060f78
|
@ -30,6 +30,7 @@
|
||||||
- move some left over javascript from html code into application.js (Closes #253)
|
- move some left over javascript from html code into application.js (Closes #253)
|
||||||
- take out last empty line from view/bootstrap/class.Search.php which causes a
|
- take out last empty line from view/bootstrap/class.Search.php which causes a
|
||||||
header to be send to early (Closes: #252, #254)
|
header to be send to early (Closes: #252, #254)
|
||||||
|
- regular users with sufficient access rights may remove documents via webdav
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 4.3.25
|
Changes in version 4.3.25
|
||||||
|
|
|
@ -1280,7 +1280,16 @@ class SeedDMS_Core_DMS {
|
||||||
if (!$res)
|
if (!$res)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return $this->getUser($this->db->getInsertID());
|
$user = $this->getUser($this->db->getInsertID());
|
||||||
|
|
||||||
|
/* Check if 'onPostAddUser' callback is set */
|
||||||
|
if(isset($this->_dms->callbacks['onPostAddUser'])) {
|
||||||
|
$callback = $this->_dms->callbacks['onPostUser'];
|
||||||
|
if(!call_user_func($callback[0], $callback[1], $user)) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $user;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1332,7 +1341,16 @@ class SeedDMS_Core_DMS {
|
||||||
if (!$this->db->getResult($queryStr))
|
if (!$this->db->getResult($queryStr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return $this->getGroup($this->db->getInsertID());
|
$group = $this->getGroup($this->db->getInsertID());
|
||||||
|
|
||||||
|
/* Check if 'onPostAddGroup' callback is set */
|
||||||
|
if(isset($this->_dms->callbacks['onPostAddGroup'])) {
|
||||||
|
$callback = $this->_dms->callbacks['onPostAddGroup'];
|
||||||
|
if(!call_user_func($callback[0], $callback[1], $group)) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $group;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function getKeywordCategory($id) { /* {{{ */
|
function getKeywordCategory($id) { /* {{{ */
|
||||||
|
@ -1411,7 +1429,16 @@ class SeedDMS_Core_DMS {
|
||||||
if (!$this->db->getResult($queryStr))
|
if (!$this->db->getResult($queryStr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return $this->getKeywordCategory($this->db->getInsertID());
|
$category = $this->getKeywordCategory($this->db->getInsertID());
|
||||||
|
|
||||||
|
/* Check if 'onPostAddKeywordCategory' callback is set */
|
||||||
|
if(isset($this->_dms->callbacks['onPostAddKeywordCategory'])) {
|
||||||
|
$callback = $this->_dms->callbacks['onPostAddKeywordCategory'];
|
||||||
|
if(!call_user_func($callback[0], $callback[1], $category)) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $category;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function getDocumentCategory($id) { /* {{{ */
|
function getDocumentCategory($id) { /* {{{ */
|
||||||
|
@ -1477,7 +1504,16 @@ class SeedDMS_Core_DMS {
|
||||||
if (!$this->db->getResult($queryStr))
|
if (!$this->db->getResult($queryStr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return $this->getDocumentCategory($this->db->getInsertID());
|
$category = $this->getDocumentCategory($this->db->getInsertID());
|
||||||
|
|
||||||
|
/* Check if 'onPostAddDocumentCategory' callback is set */
|
||||||
|
if(isset($this->_dms->callbacks['onPostAddDocumentCategory'])) {
|
||||||
|
$callback = $this->_dms->callbacks['onPostAddDocumentCategory'];
|
||||||
|
if(!call_user_func($callback[0], $callback[1], $category)) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $category;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1828,7 +1828,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
|
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
|
|
||||||
// FIXME: call a new function removeContent instead
|
// remove content of document
|
||||||
foreach ($this->_content as $version) {
|
foreach ($this->_content as $version) {
|
||||||
if (!$this->removeContent($version)) {
|
if (!$this->removeContent($version)) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
|
|
|
@ -531,6 +531,14 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->commitTransaction();
|
$db->commitTransaction();
|
||||||
|
|
||||||
|
/* Check if 'onPostAddSubFolder' callback is set */
|
||||||
|
if(isset($this->_dms->callbacks['onPostAddSubFolder'])) {
|
||||||
|
$callback = $this->_dms->callbacks['onPostAddSubFolder'];
|
||||||
|
if(!call_user_func($callback[0], $callback[1], $newFolder)) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $newFolder;
|
return $newFolder;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -841,6 +849,14 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->commitTransaction();
|
$db->commitTransaction();
|
||||||
|
|
||||||
|
/* Check if 'onPostAddDocument' callback is set */
|
||||||
|
if(isset($this->_dms->callbacks['onPostAddDocument'])) {
|
||||||
|
$callback = $this->_dms->callbacks['onPostAddDocument'];
|
||||||
|
if(!call_user_func($callback[0], $callback[1], $document)) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return array($document, $res);
|
return array($document, $res);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -856,6 +872,14 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
protected function removeFromDatabase() { /* {{{ */
|
protected function removeFromDatabase() { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
/* Check if 'onPreRemoveFolder' callback is set */
|
||||||
|
if(isset($this->_dms->callbacks['onPreRemoveFolder'])) {
|
||||||
|
$callback = $this->_dms->callbacks['onPreRemoveFolder'];
|
||||||
|
if(!call_user_func($callback[0], $callback[1], $this)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
// unset homefolder as it will no longer exist
|
// unset homefolder as it will no longer exist
|
||||||
$queryStr = "UPDATE tblUsers SET homefolder=NULL WHERE homefolder = " . $this->_id;
|
$queryStr = "UPDATE tblUsers SET homefolder=NULL WHERE homefolder = " . $this->_id;
|
||||||
|
@ -863,6 +887,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove database entries
|
// Remove database entries
|
||||||
$queryStr = "DELETE FROM tblFolders WHERE id = " . $this->_id;
|
$queryStr = "DELETE FROM tblFolders WHERE id = " . $this->_id;
|
||||||
if (!$db->getResult($queryStr)) {
|
if (!$db->getResult($queryStr)) {
|
||||||
|
@ -887,6 +912,13 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
}
|
}
|
||||||
$db->commitTransaction();
|
$db->commitTransaction();
|
||||||
|
|
||||||
|
/* Check if 'onPostRemoveFolder' callback is set */
|
||||||
|
if(isset($this->_dms->callbacks['onPostRemoveFolder'])) {
|
||||||
|
$callback = $this->_dms->callbacks['onPostRemoveFolder'];
|
||||||
|
if(!call_user_func($callback[0], $callback[1], $this->_id)) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,11 @@
|
||||||
<email>uwe@steinmann.cx</email>
|
<email>uwe@steinmann.cx</email>
|
||||||
<active>yes</active>
|
<active>yes</active>
|
||||||
</lead>
|
</lead>
|
||||||
<date>2016-03-09</date>
|
<date>2016-04-04</date>
|
||||||
<time>14:34:58</time>
|
<time>08:56:33</time>
|
||||||
<version>
|
<version>
|
||||||
<release>5.0.2</release>
|
<release>5.0.3</release>
|
||||||
<api>5.0.2</api>
|
<api>5.0.3</api>
|
||||||
</version>
|
</version>
|
||||||
<stability>
|
<stability>
|
||||||
<release>stable</release>
|
<release>stable</release>
|
||||||
|
@ -24,10 +24,7 @@
|
||||||
</stability>
|
</stability>
|
||||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||||
<notes>
|
<notes>
|
||||||
- all changes from 4.3.25 merged
|
- all changes from 4.3.26 merged
|
||||||
- rename SeedDMS_Core_Group::getNotificationsByGroup() to getNotifications()
|
|
||||||
- use __construct() for all constructors
|
|
||||||
- fix setting multi value attributes for versions
|
|
||||||
</notes>
|
</notes>
|
||||||
<contents>
|
<contents>
|
||||||
<dir baseinstalldir="SeedDMS" name="/">
|
<dir baseinstalldir="SeedDMS" name="/">
|
||||||
|
@ -1010,6 +1007,24 @@ SeedDMS_Core_DMS::getNotificationsByUser() are deprecated
|
||||||
- SeedDMS_Core_User::getDocumentsLocked() sets locking user propperly
|
- SeedDMS_Core_User::getDocumentsLocked() sets locking user propperly
|
||||||
</notes>
|
</notes>
|
||||||
</release>
|
</release>
|
||||||
|
<release>
|
||||||
|
<date>2016-03-08</date>
|
||||||
|
<time>07:12:53</time>
|
||||||
|
<version>
|
||||||
|
<release>4.3.25</release>
|
||||||
|
<api>4.3.25</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>stable</release>
|
||||||
|
<api>stable</api>
|
||||||
|
</stability>
|
||||||
|
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||||
|
<notes>
|
||||||
|
- rename SeedDMS_Core_Group::getNotificationsByGroup() to getNotifications()
|
||||||
|
- use __construct() for all constructors
|
||||||
|
- fix setting multi value attributes for versions
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
<release>
|
<release>
|
||||||
<date>2016-01-22</date>
|
<date>2016-01-22</date>
|
||||||
<time>14:34:58</time>
|
<time>14:34:58</time>
|
||||||
|
|
|
@ -303,7 +303,7 @@ if (isset($_COOKIE["mydms_session"])) {
|
||||||
setcookie("mydms_session", $id, $lifetime, $settings->_httpRoot, null, null, !$settings->_enableLargeFileUpload);
|
setcookie("mydms_session", $id, $lifetime, $settings->_httpRoot, null, null, !$settings->_enableLargeFileUpload);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: by the PHP manual: The superglobals $_GET and $_REQUEST are already decoded.
|
// TODO: by the PHP manual: The superglobals $_GET and $_REQUEST are already decoded.
|
||||||
// Using urldecode() on an element in $_GET or $_REQUEST could have unexpected and dangerous results.
|
// Using urldecode() on an element in $_GET or $_REQUEST could have unexpected and dangerous results.
|
||||||
|
|
||||||
if (isset($_POST["referuri"]) && strlen($_POST["referuri"])>0) {
|
if (isset($_POST["referuri"]) && strlen($_POST["referuri"])>0) {
|
||||||
|
|
|
@ -668,9 +668,11 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
} else {
|
} else {
|
||||||
// check if user is admin
|
// check if user is admin
|
||||||
// only admins may delete documents
|
// only admins may delete documents
|
||||||
|
/* There is not reason to allow only admins to remove a document
|
||||||
if(!$this->user->isAdmin()) {
|
if(!$this->user->isAdmin()) {
|
||||||
return "403 Forbidden";
|
return "403 Forbidden";
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if(!$obj->remove()) {
|
if(!$obj->remove()) {
|
||||||
return "409 Conflict";
|
return "409 Conflict";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user