Merge branch 'seeddms-5.0.x' into seeddms-5.1.x

This commit is contained in:
Uwe Steinmann 2016-09-15 17:04:28 +02:00
commit 40e97f7363
12 changed files with 967 additions and 366 deletions

View File

@ -73,6 +73,7 @@
- new graph layout for workflow manager using cytoscape - new graph layout for workflow manager using cytoscape
- show current workflow and highlight possible transitions on workflow tab - show current workflow and highlight possible transitions on workflow tab
of ViewDocument page of ViewDocument page
- webdav checks authentication against ldap and uses the authentication classes
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Changes in version 4.3.28 Changes in version 4.3.28

View File

@ -3362,6 +3362,10 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
$db->rollbackTransaction(); $db->rollbackTransaction();
return false; return false;
} }
$reviewLogID = $db->getInsertID();
if(!empty($log['file'])) {
SeedDMS_Core_File::copyFile($log['file'], $this->_dms->contentDir . $this->_document->getDir() . 'r' . $reviewLogID);
}
} }
} }
@ -3486,6 +3490,10 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
$db->rollbackTransaction(); $db->rollbackTransaction();
return false; return false;
} }
$approveLogID = $db->getInsertID();
if(!empty($log['file'])) {
SeedDMS_Core_File::copyFile($log['file'], $this->_dms->contentDir . $this->_document->getDir() . 'a' . $approveLogID);
}
} }
} }

View File

@ -282,6 +282,10 @@ class SeedDMS_Core_Workflow { /* {{{ */
return false; return false;
} }
/* force reloading all transitions otherwise getTransition() will fail if two
* transitions are added in a row, without reloading the workflow
*/
$this->_transitions = array();
$transition = $this->getTransition($db->getInsertID()); $transition = $this->getTransition($db->getInsertID());
foreach($users as $user) { foreach($users as $user) {

View File

@ -5,4 +5,4 @@ if [ -z "${SEEDDMS_HOME}" ]; then
exit 1 exit 1
fi fi
exec php -f "${SEEDDMS_HOME}/utils/xmldump" -- "${@}" exec php -f "${SEEDDMS_HOME}/utils/xmldump.php" -- "${@}"

View File

@ -106,6 +106,9 @@ $statistic = array(
'keywordcategories'=>0, 'keywordcategories'=>0,
'documentcategories'=>0, 'documentcategories'=>0,
'transmittals'=>0, 'transmittals'=>0,
'workflows'=>0,
'workflowactions'=>0,
'workflowstates'=>0,
); );
function dumplog($version, $type, $logs, $indent) { /* {{{ */ function dumplog($version, $type, $logs, $indent) { /* {{{ */
@ -138,11 +141,11 @@ function dumplog($version, $type, $logs, $indent) { /* {{{ */
if(!empty($a['file'])) { if(!empty($a['file'])) {
$filename = $dms->contentDir . $document->getDir().'r'.(int) $a[$type2.'LogID']; $filename = $dms->contentDir . $document->getDir().'r'.(int) $a[$type2.'LogID'];
if(file_exists($filename)) { if(file_exists($filename)) {
echo $indent." <data length=\"".filesize($filename)."\""; echo $indent." <data length=\"".filesize($filename)."\"";
if(filesize($filename) < $maxsize) { if(filesize($filename) < $maxsize) {
echo ">\n"; echo ">\n";
echo chunk_split(base64_encode(file_get_contents($filename)), 76, "\n"); echo chunk_split(base64_encode(file_get_contents($filename)), 76, "\n");
echo $indent." </data>\n"; echo $indent." </data>\n";
} else { } else {
echo " fileref=\"".$filename."\" />\n"; echo " fileref=\"".$filename."\" />\n";
if($contentdir) { if($contentdir) {
@ -161,6 +164,25 @@ function dumplog($version, $type, $logs, $indent) { /* {{{ */
echo $indent." </".$type."s>\n"; echo $indent." </".$type."s>\n";
} /* }}} */ } /* }}} */
function dumpNotifications($notifications, $indent) { /* {{{ */
if($notifications) {
if($notifications['groups'] || $notifications['users']) {
echo $indent." <notifications>\n";
if($notifications['users']) {
foreach($notifications['users'] as $user) {
echo $indent." <user id=\"".$user->getID()."\" />\n";
}
}
if($notifications['groups']) {
foreach($notifications['groups'] as $group) {
echo $indent." <group id=\"".$group->getID()."\" />\n";
}
}
echo $indent." </notifications>\n";
}
}
} /* }}} */
function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
global $sections, $statistic, $index, $dms, $maxsize, $contentdir; global $sections, $statistic, $index, $dms, $maxsize, $contentdir;
@ -180,14 +202,22 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
if($attributes = $folder->getAttributes()) { if($attributes = $folder->getAttributes()) {
foreach($attributes as $attribute) { foreach($attributes as $attribute) {
$attrdef = $attribute->getAttributeDefinition(); $attrdef = $attribute->getAttributeDefinition();
echo $indent." <attr type=\"user\" attrdef=\"".$attrdef->getID()."\">".$attribute->getValue()."</attr>\n"; echo $indent." <attr type=\"user\" attrdef=\"".$attrdef->getID()."\">".wrapWithCData($attribute->getValue())."</attr>\n";
} }
} }
if($folder->inheritsAccess()) { $notifications = $folder->getNotifyList();
echo $indent." <acls type=\"inherited\" />\n"; dumpNotifications($notifications, $indent);
} else {
echo $indent." <acls>\n"; /* getAccessList() returns also inherited access. So first check
* if inheritsAccess is set and don't output any acls in that case.
* There could be acls of the folder, which will be visible once the
* inheritsAccess is turned off. Those entries will be lost in the
* xml output.
*/
if(!$folder->inheritsAccess()) {
$accesslist = $folder->getAccessList(); $accesslist = $folder->getAccessList();
if($accesslist['users'] || $accesslist['groups']) {
echo $indent." <acls>\n";
foreach($accesslist['users'] as $acl) { foreach($accesslist['users'] as $acl) {
echo $indent." <acl type=\"user\""; echo $indent." <acl type=\"user\"";
$user = $acl->getUser(); $user = $acl->getUser();
@ -203,6 +233,7 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
echo "/>\n"; echo "/>\n";
} }
echo $indent." </acls>\n"; echo $indent." </acls>\n";
}
} }
echo $indent."</folder>\n"; echo $indent."</folder>\n";
$statistic['folders']++; $statistic['folders']++;
@ -223,7 +254,8 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
if($documents) { if($documents) {
foreach($documents as $document) { foreach($documents as $document) {
$owner = $document->getOwner(); $owner = $document->getOwner();
echo $indent."<document id=\"".$document->getId()."\" folder=\"".$folder->getID()."\""; /* parent folder is only set if it is no skipped */
echo $indent."<document id=\"".$document->getId()."\"".(!$skipcurrent ? " folder=\"".$folder->getID()."\"" : "");
if($document->isLocked()) if($document->isLocked())
echo " locked=\"true\""; echo " locked=\"true\"";
echo ">\n"; echo ">\n";
@ -249,10 +281,16 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
} }
} }
/* Check if acl is not inherited */ /* getAccessList() returns also inherited access. So first check
* if inheritsAccess is set and don't output any acls in that case.
* There could be acls of the folder, which will be visible once the
* inheritsAccess is turned off. Those entries will be lost in the
* xml output.
*/
if(!$document->inheritsAccess()) { if(!$document->inheritsAccess()) {
echo $indent." <acls>\n";
$accesslist = $document->getAccessList(); $accesslist = $document->getAccessList();
if($accesslist['users'] || $accesslist['groups']) {
echo $indent." <acls>\n";
foreach($accesslist['users'] as $acl) { foreach($accesslist['users'] as $acl) {
echo $indent." <acl type=\"user\""; echo $indent." <acl type=\"user\"";
$user = $acl->getUser(); $user = $acl->getUser();
@ -268,6 +306,7 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
echo "/>\n"; echo "/>\n";
} }
echo $indent." </acls>\n"; echo $indent." </acls>\n";
}
} }
$cats = $document->getCategories(); $cats = $document->getCategories();
@ -283,12 +322,6 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
if($versions) { if($versions) {
echo $indent." <versions>\n"; echo $indent." <versions>\n";
foreach($versions as $version) { foreach($versions as $version) {
$approvalStatus = $version->getApprovalStatus(300);
$reviewStatus = $version->getReviewStatus(300);
$receiptStatus = $version->getReceiptStatus(300);
$revisionStatus = $version->getRevisionStatus(300);
$approvalStatus = $version->getApprovalStatus(30);
$reviewStatus = $version->getReviewStatus(30);
$owner = $version->getUser(); $owner = $version->getUser();
echo $indent." <version version=\"".$version->getVersion()."\">\n"; echo $indent." <version version=\"".$version->getVersion()."\">\n";
echo $indent." <attr name=\"mimetype\">".$version->getMimeType()."</attr>\n"; echo $indent." <attr name=\"mimetype\">".$version->getMimeType()."</attr>\n";
@ -315,18 +348,41 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
} }
echo $indent." </status>\n"; echo $indent." </status>\n";
} }
$approvalStatus = $version->getApprovalStatus(300);
if($approvalStatus) { if($approvalStatus) {
dumplog($version, 'approval', $approvalStatus, $indent); dumplog($version, 'approval', $approvalStatus, $indent);
} }
$reviewStatus = $version->getReviewStatus(300);
if($reviewStatus) { if($reviewStatus) {
dumplog($version, 'review', $reviewStatus, $indent); dumplog($version, 'review', $reviewStatus, $indent);
} }
$receiptStatus = $version->getReceiptStatus(300);
if($receiptStatus) { if($receiptStatus) {
dumplog($version, 'receipt', $receiptStatus, $indent); dumplog($version, 'receipt', $receiptStatus, $indent);
} }
$revisionStatus = $version->getRevisionStatus(300);
if($revisionStatus) { if($revisionStatus) {
dumplog($version, 'revision', $revisionStatus, $indent); dumplog($version, 'revision', $revisionStatus, $indent);
} }
$workflow = $version->getWorkflow();
if($workflow) {
$workflowstate = $version->getWorkflowState();
echo $indent." <workflow id=\"".$workflow->getID()."\" state=\"".$workflowstate->getID()."\"></workflow>\n";
}
$wkflogs = $version->getWorkflowLog();
if($wkflogs) {
echo $indent." <workflowlogs>\n";
foreach($wkflogs as $wklog) {
echo $indent." <workflowlog>\n";
echo $indent." <attr name=\"date\" format=\"Y-m-d H:i:s\">".$wklog->getDate()."</attr>\n";
echo $indent." <attr name=\"transition\">".$wklog->getTransition()->getID()."</attr>\n";
$loguser = $wklog->getUser();
echo $indent." <attr name=\"user\">".$loguser->getID()."</attr>\n";
echo $indent." <attr name=\"comment\">".wrapWithCData($wklog->getComment())."</attr>\n";
echo $indent." </workflowlog>\n";
}
echo $indent." </workflowlogs>\n";
}
if(file_exists($dms->contentDir . $version->getPath())) { if(file_exists($dms->contentDir . $version->getPath())) {
echo $indent." <data length=\"".filesize($dms->contentDir . $version->getPath())."\""; echo $indent." <data length=\"".filesize($dms->contentDir . $version->getPath())."\"";
if(filesize($dms->contentDir . $version->getPath()) < $maxsize) { if(filesize($dms->contentDir . $version->getPath()) < $maxsize) {
@ -371,7 +427,7 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
} else { } else {
echo " fileref=\"".$document->getID()."-A-".$file->getID().$file->getFileType()."\" />\n"; echo " fileref=\"".$document->getID()."-A-".$file->getID().$file->getFileType()."\" />\n";
if($contentdir) { if($contentdir) {
copy($dms->contentDir . $version->getPath(), $contentdir.$document->getID()."-A-".$file->getID().$file->getFileType()); copy($dms->contentDir . $file->getPath(), $contentdir.$document->getID()."-A-".$file->getID().$file->getFileType());
} else { } else {
echo "Warning: file content (size=".filesize($dms->contentDir . $file->getPath()).") will be missing from output\n"; echo "Warning: file content (size=".filesize($dms->contentDir . $file->getPath()).") will be missing from output\n";
} }
@ -398,22 +454,7 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
echo $indent." </links>\n"; echo $indent." </links>\n";
} }
$notifications = $document->getNotifyList(); $notifications = $document->getNotifyList();
if($notifications) { dumpNotifications($notifications, $indent);
if($notifications['groups'] || $notifications['users']) {
echo $indent." <notifications>\n";
if($notifications['users']) {
foreach($notifications['users'] as $user) {
echo $indent." <user id=\"".$user->getID()."\" />\n";
}
}
if($notifications['groups']) {
foreach($notifications['groups'] as $group) {
echo $indent." <group id=\"".$group->getID()."\" />\n";
}
}
echo $indent." </notifications>\n";
}
}
echo $indent."</document>\n"; echo $indent."</document>\n";
$statistic['documents']++; $statistic['documents']++;
@ -458,7 +499,8 @@ if($users) {
if($image = $user->getImage()) { if($image = $user->getImage()) {
echo " <image id=\"".$image['id']."\">\n"; echo " <image id=\"".$image['id']."\">\n";
echo " <attr name=\"mimetype\">".$image['mimeType']."</attr>\n"; echo " <attr name=\"mimetype\">".$image['mimeType']."</attr>\n";
echo " <data>".base64_encode($image['image'])."</data>\n"; /* image data is already base64 coded */
echo " <data>".$image['image']."</data>\n";
echo " </image>\n"; echo " </image>\n";
} }
if($mreviewers = $user->getMandatoryReviewers()) { if($mreviewers = $user->getMandatoryReviewers()) {
@ -488,6 +530,13 @@ if($users) {
} }
echo " </substitutes>\n"; echo " </substitutes>\n";
} }
if($mworkflows = $user->getMandatoryWorkflows()) {
echo " <mandatory_workflows>\n";
foreach($mworkflows as $mworkflow) {
echo " <workflow id=\"".$mworkflow->getID()."\"></workflow>\n";
}
echo " </mandatory_workflows>\n";
}
echo " </user>\n"; echo " </user>\n";
$statistic['users']++; $statistic['users']++;
} }
@ -601,6 +650,72 @@ if($attrdefs) {
} }
/* }}} */ /* }}} */
/* Dump workflows {{{ */
if(!$sections || in_array('workflows', $sections)) {
$workflowstates = $dms->getAllWorkflowStates();
if($workflowstates) {
echo "<workflowstates>\n";
foreach ($workflowstates as $workflowstate) {
echo " <workflowstate id=\"".$workflowstate->getID()."\">\n";
echo " <attr name=\"name\">".$workflowstate->getName()."</attr>\n";
echo " <attr name=\"documentstate\">".$workflowstate->getDocumentStatus()."</attr>\n";
echo " </workflowstate>\n";
$statistic['workflowstates']++;
}
echo "</workflowstates>\n";
}
$workflowactions = $dms->getAllWorkflowActions();
if($workflowactions) {
echo "<workflowactions>\n";
foreach ($workflowactions as $workflowaction) {
echo " <workflowaction id=\"".$workflowaction->getID()."\">\n";
echo " <attr name=\"name\">".$workflowaction->getName()."</attr>\n";
echo " </workflowaction>\n";
$statistic['workflowactions']++;
}
echo "</workflowactions>\n";
}
$workflows = $dms->getAllWorkflows();
if($workflows) {
echo "<workflows>\n";
foreach ($workflows as $workflow) {
echo " <workflow id=\"".$workflow->getID()."\">\n";
echo " <attr name=\"name\">".$workflow->getName()."</attr>\n";
echo " <attr name=\"initstate\">".$workflow->getInitState()->getID()."</attr>\n";
if($transitions = $workflow->getTransitions()) {
echo " <transitions>\n";
foreach($transitions as $transition) {
echo " <transition id=\"".$transition->getID()."\">\n";
echo " <attr name=\"startstate\">".$transition->getState()->getID()."</attr>\n";
echo " <attr name=\"nextstate\">".$transition->getNextState()->getID()."</attr>\n";
echo " <attr name=\"action\">".$transition->getAction()->getID()."</attr>\n";
echo " <attr name=\"maxtime\">".$transition->getMaxTime()."</attr>\n";
if($transusers = $transition->getUsers()) {
echo " <users>\n";
foreach($transusers as $transuser) {
echo " <user id=\"".$transuser->getUser()->getID()."\"></user>\n";
}
echo " </users>\n";
}
if($transgroups = $transition->getGroups()) {
echo " <groups>\n";
foreach($transgroups as $transgroup) {
echo " <group id=\"".$transgroup->getGroup()->getID()."\" numofusers=\"".$transgroup->getNumOfUsers()."\"></group>\n";
}
echo " </groups>\n";
}
echo " </transition>\n";
}
echo " </transitions>\n";
}
echo " </workflow>\n";
$statistic['workflows']++;
}
echo "</workflows>\n";
}
}
/* }}} */
/* Dump folders and documents {{{ */ /* Dump folders and documents {{{ */
$folder = $dms->getFolder($folderid); $folder = $dms->getFolder($folderid);
if($folder) { if($folder) {

File diff suppressed because it is too large Load Diff

View File

@ -81,16 +81,17 @@ $(document).ready(function() {
return false; return false;
return true; return true;
}, "<?php printMLText("js_no_file");?>"); }, "<?php printMLText("js_no_file");?>");
var validator = $("#form1").bind("invalid-form.validate", function() { $("#form1").validate({
noty({ invalidHandler: function(e, validator) {
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()), noty({
type: 'error', text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
dismissQueue: true, type: 'error',
layout: 'topRight', dismissQueue: true,
theme: 'defaultTheme', layout: 'topRight',
timeout: 1500, theme: 'defaultTheme',
}); timeout: 1500,
}).validate({ });
},
rules: { rules: {
'userfile[]': { 'userfile[]': {
alternatives: $('#dropfolderfileform1') alternatives: $('#dropfolderfileform1')

View File

@ -66,16 +66,17 @@ $(document).ready( function() {
ev.preventDefault(); ev.preventDefault();
}); });
*/ */
var validator = $("#form1").bind("invalid-form.validate", function() { $("#form1").validate({
noty({ invalidHandler: function(e, validator) {
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()), noty({
type: 'error', text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
dismissQueue: true, type: 'error',
layout: 'topRight', dismissQueue: true,
theme: 'defaultTheme', layout: 'topRight',
timeout: 1500, theme: 'defaultTheme',
}); timeout: 1500,
}).validate({ });
},
messages: { messages: {
name: "<?php printMLText("js_no_name");?>", name: "<?php printMLText("js_no_name");?>",
comment: "<?php printMLText("js_no_comment");?>" comment: "<?php printMLText("js_no_comment");?>"

View File

@ -1337,7 +1337,7 @@ $('#acceptkeywords').click(function(ev) {
if(strlen($objvalue) > 80) { if(strlen($objvalue) > 80) {
echo "<textarea name=\"".$fieldname."[".$attrdef->getId()."]\"".($attrdef->getMinValues() > 0 ? ' required' : '').">".htmlspecialchars($objvalue)."</textarea>"; echo "<textarea name=\"".$fieldname."[".$attrdef->getId()."]\"".($attrdef->getMinValues() > 0 ? ' required' : '').">".htmlspecialchars($objvalue)."</textarea>";
} else { } else {
echo "<input type=\"text\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".htmlspecialchars($objvalue)."\"".($attrdef->getMinValues() > 0 ? ' required' : '')." />"; echo "<input type=\"text\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"".htmlspecialchars($objvalue)."\"".($attrdef->getMinValues() > 0 ? ' required' : '').($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_int ? ' data-rule-digits="true"' : '')." />";
} }
} }
break; break;

View File

@ -71,16 +71,17 @@ $(document).ready( function() {
ev.preventDefault(); ev.preventDefault();
}); });
*/ */
var validator = $("#form1").bind("invalid-form.validate", function() { $("#form1").validate({
noty({ invalidHandler: function(e, validator) {
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()), noty({
type: 'error', text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
dismissQueue: true, type: 'error',
layout: 'topRight', dismissQueue: true,
theme: 'defaultTheme', layout: 'topRight',
timeout: 1500, theme: 'defaultTheme',
}); timeout: 1500,
}).validate({ });
},
messages: { messages: {
name: "<?php printMLText("js_no_name");?>", name: "<?php printMLText("js_no_name");?>",
comment: "<?php printMLText("js_no_comment");?>", comment: "<?php printMLText("js_no_comment");?>",

View File

@ -81,16 +81,17 @@ $(document).ready( function() {
return false; return false;
return true; return true;
}, "<?php printMLText("js_no_file");?>"); }, "<?php printMLText("js_no_file");?>");
var validator = $("#form1").bind("invalid-form.validate", function() { $("#form1").validate({
noty({ invalidHandler: function(e, validator) {
text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()), noty({
type: 'error', text: (validator.numberOfInvalids() == 1) ? "<?php printMLText("js_form_error");?>".replace('#', validator.numberOfInvalids()) : "<?php printMLText("js_form_errors");?>".replace('#', validator.numberOfInvalids()),
dismissQueue: true, type: 'error',
layout: 'topRight', dismissQueue: true,
theme: 'defaultTheme', layout: 'topRight',
timeout: 1500, theme: 'defaultTheme',
}); timeout: 1500,
}).validate({ });
},
rules: { rules: {
userfile: { userfile: {
alternatives: $('#dropfolderfileform1') alternatives: $('#dropfolderfileform1')

View File

@ -113,9 +113,27 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
*/ */
function check_auth($type, $user, $pass) /* {{{ */ function check_auth($type, $user, $pass) /* {{{ */
{ {
global $settings;
if($this->logger) if($this->logger)
$this->logger->log('check_auth: type='.$type.', user='.$user.'', PEAR_LOG_INFO); $this->logger->log('check_auth: type='.$type.', user='.$user.'', PEAR_LOG_INFO);
$userobj = $this->dms->getUserByLogin($user);
$userobj = false;
/* Authenticate against LDAP server {{{ */
if (!$userobj && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) {
require_once("../inc/inc.ClassLdapAuthentication.php");
$authobj = new SeedDMS_LdapAuthentication($this->dms, $settings);
$userobj = $authobj->authenticate($user, $pass);
} /* }}} */
/* Authenticate against SeedDMS database {{{ */
if(!$userobj) {
require_once("../inc/inc.ClassDbAuthentication.php");
$authobj = new SeedDMS_DbAuthentication($this->dms, $settings);
$userobj = $authobj->authenticate($user, $pass);
} /* }}} */
if(!$userobj) if(!$userobj)
return false; return false;
if(md5($pass) != $userobj->getPwd()) if(md5($pass) != $userobj->getPwd())