From ecdbc03d6ab1cf974d886e4853322a61b222b189 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 5 Apr 2016 15:15:59 +0200 Subject: [PATCH 01/11] stream_select may pass only variables by reference --- SeedDMS_Preview/Preview/Previewer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SeedDMS_Preview/Preview/Previewer.php b/SeedDMS_Preview/Preview/Previewer.php index 33160489f..24d41baae 100644 --- a/SeedDMS_Preview/Preview/Previewer.php +++ b/SeedDMS_Preview/Preview/Previewer.php @@ -75,7 +75,9 @@ class SeedDMS_Preview_Previewer { do { $timeleft = $timeout - time(); $read = array($pipes[1]); - stream_select($read, $write = NULL, $exeptions = NULL, $timeleft, 200000); + $write = NULL; + $exeptions = NULL; + stream_select($read, $write, $exeptions, $timeleft, 200000); if (!empty($read)) { $output .= fread($pipes[1], 8192); From 3b800b702e32c7092171d18f9a8e1806a923cb89 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 5 Apr 2016 15:17:48 +0200 Subject: [PATCH 02/11] new version 1.1.8 --- SeedDMS_Preview/package.xml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/SeedDMS_Preview/package.xml b/SeedDMS_Preview/package.xml index f2d964f76..ee7067f3a 100644 --- a/SeedDMS_Preview/package.xml +++ b/SeedDMS_Preview/package.xml @@ -11,11 +11,11 @@ uwe@steinmann.cx yes - 2016-03-29 - + 2016-04-05 + - 1.1.7 - 1.1.7 + 1.1.8 + 1.1.8 stable @@ -23,7 +23,7 @@ GPL License -set last parameter of stream_select() to 200000 micro sec. in case the timeout in sec. is set to 0 +pass variables to stream_select (required by php7) @@ -180,5 +180,21 @@ timeout for external commands can be passed to contructor of SeedDMS_Preview_Pre check if object passed to createPreview(), hasPreview() is not null + + 2016-03-29 + + + 1.1.7 + 1.1.7 + + + stable + stable + + GPL License + +set last parameter of stream_select() to 200000 micro sec. in case the timeout in sec. is set to 0 + + From 856245868be085d73e2f9305e21f133bb6a2e950 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 5 Apr 2016 17:03:03 +0200 Subject: [PATCH 03/11] do not expect a return value from $indexer->delete() --- utils/indexer.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/utils/indexer.php b/utils/indexer.php index 5b7fc36cf..05d0d6a37 100644 --- a/utils/indexer.php +++ b/utils/indexer.php @@ -98,13 +98,12 @@ function tree($dms, $index, $indexconf, $folder, $indent='') { /* {{{ */ if($created >= $content->getDate()) { echo " (Document unchanged)\n"; } else { - if($index->delete($hit->id)) { - try { - $index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout)); - echo " (Document updated)\n"; - } catch(Exception $e) { - echo " (Timeout)\n"; - } + $index->delete($hit->id); + try { + $index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout)); + echo " (Document updated)\n"; + } catch(Exception $e) { + echo " (Timeout)\n"; } } } From 7fa26ace57e8ad914e73581c38b5936cacdce4ff Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 5 Apr 2016 17:03:33 +0200 Subject: [PATCH 04/11] add entry for 4.3.26 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index b3935a7fe..687568daa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ - take out last empty line from view/bootstrap/class.Search.php which causes a header to be send to early (Closes: #252, #254) - regular users with sufficient access rights may remove documents via webdav +- fix error in utils/indexer.php when new documents were indexed -------------------------------------------------------------------------------- Changes in version 4.3.25 From 2c14ec295af5a210bff80dd82d29e338f1e55920 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 7 Apr 2016 08:29:35 +0200 Subject: [PATCH 05/11] various minor clean ups remove old code, add scope of variables, add additional comments --- SeedDMS_Core/Core/inc.ClassDocument.php | 29 ++++---------- SeedDMS_Core/Core/inc.ClassFolder.php | 25 +++++++----- SeedDMS_Core/Core/inc.ClassUser.php | 51 ++----------------------- 3 files changed, 27 insertions(+), 78 deletions(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 02ad69daa..bdf0e33cb 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -30,7 +30,7 @@ define("S_DRAFT_APP", 1); /* * Document is released. A document is in release state either when * it needs no review or approval after uploaded or has been reviewed - * and/or approved.. + * and/or approved. */ define("S_RELEASED", 2); @@ -2427,6 +2427,8 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ * then its status is set to S_RELEASED immediately. Any change of * the status is monitored in the table tblDocumentStatusLog. This * function will always return the latest entry for the content. + * + * @return array latest record from tblDocumentStatusLog */ function getStatus($limit=1) { /* {{{ */ $db = $this->_document->_dms->getDB(); @@ -2436,20 +2438,6 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ // Retrieve the current overall status of the content represented by // this object. if (!isset($this->_status)) { - /* - if (!$db->createTemporaryTable("ttstatid", $forceTemporaryTable)) { - return false; - } - $queryStr="SELECT `tblDocumentStatus`.*, `tblDocumentStatusLog`.`status`, ". - "`tblDocumentStatusLog`.`comment`, `tblDocumentStatusLog`.`date`, ". - "`tblDocumentStatusLog`.`userID` ". - "FROM `tblDocumentStatus` ". - "LEFT JOIN `tblDocumentStatusLog` USING (`statusID`) ". - "LEFT JOIN `ttstatid` ON `ttstatid`.`maxLogID` = `tblDocumentStatusLog`.`statusLogID` ". - "WHERE `ttstatid`.`maxLogID`=`tblDocumentStatusLog`.`statusLogID` ". - "AND `tblDocumentStatus`.`documentID` = '". $this->_document->getID() ."' ". - "AND `tblDocumentStatus`.`version` = '". $this->_version ."' "; - */ $queryStr= "SELECT `tblDocumentStatus`.*, `tblDocumentStatusLog`.`status`, ". "`tblDocumentStatusLog`.`comment`, `tblDocumentStatusLog`.`date`, ". @@ -2545,7 +2533,6 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ return false; unset($this->_status); - return true; } /* }}} */ @@ -3344,8 +3331,6 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ function delIndReviewer($user, $requestUser) { /* {{{ */ $db = $this->_document->_dms->getDB(); - $userID = $user->getID(); - // Check to see if the user can be removed from the review list. $reviewStatus = $user->getReviewStatus($this->_document->getID(), $this->_version); if (is_bool($reviewStatus) && !$reviewStatus) { @@ -3354,7 +3339,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ if (count($reviewStatus["indstatus"])==0) { // User is not assigned to review this document. No action required. // Return an error. - return -3; + return -2; } $indstatus = array_pop($reviewStatus["indstatus"]); if ($indstatus["status"]!=0) { @@ -3386,7 +3371,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ if (count($reviewStatus)==0) { // User is not assigned to review this document. No action required. // Return an error. - return -3; + return -2; } if ($reviewStatus[0]["status"]!=0) { // User has already submitted a review or has already been deleted; @@ -3417,7 +3402,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ if (count($approvalStatus["indstatus"])==0) { // User is not assigned to approve this document. No action required. // Return an error. - return -3; + return -2; } $indstatus = array_pop($approvalStatus["indstatus"]); if ($indstatus["status"]!=0) { @@ -3449,7 +3434,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ if (count($approvalStatus)==0) { // User is not assigned to approve this document. No action required. // Return an error. - return -3; + return -2; } if ($approvalStatus[0]["status"]!=0) { // User has already submitted an approval or has already been deleted; diff --git a/SeedDMS_Core/Core/inc.ClassFolder.php b/SeedDMS_Core/Core/inc.ClassFolder.php index 9a8302ddf..7d9a004f1 100644 --- a/SeedDMS_Core/Core/inc.ClassFolder.php +++ b/SeedDMS_Core/Core/inc.ClassFolder.php @@ -92,14 +92,14 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { * * @return string name of folder */ - function getName() { return $this->_name; } + public function getName() { return $this->_name; } /* * Set the name of the folder. * * @param string $newName set a new name of the folder */ - function setName($newName) { /* {{{ */ + public function setName($newName) { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "UPDATE tblFolders SET name = " . $db->qstr($newName) . " WHERE id = ". $this->_id; @@ -111,9 +111,9 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { return true; } /* }}} */ - function getComment() { return $this->_comment; } + public function getComment() { return $this->_comment; } - function setComment($newComment) { /* {{{ */ + public function setComment($newComment) { /* {{{ */ $db = $this->_dms->getDB(); $queryStr = "UPDATE tblFolders SET comment = " . $db->qstr($newComment) . " WHERE id = ". $this->_id; @@ -129,7 +129,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { * * @return integer unix timestamp of creation date */ - function getDate() { /* {{{ */ + public function getDate() { /* {{{ */ return $this->_date; } /* }}} */ @@ -162,7 +162,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { * * @return object parent folder or false if there is no parent folder */ - function getParent() { /* {{{ */ + public function getParent() { /* {{{ */ if ($this->_id == $this->_dms->rootFolderID || empty($this->_parentID)) { return false; } @@ -200,7 +200,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { * @param object $newParent new parent folder * @return boolean true if operation was successful otherwise false */ - function setParent($newParent) { /* {{{ */ + public function setParent($newParent) { /* {{{ */ $db = $this->_dms->getDB(); if ($this->_id == $this->_dms->rootFolderID || empty($this->_parentID)) { @@ -274,7 +274,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { * * @return object owner of the folder */ - function getOwner() { /* {{{ */ + public function getOwner() { /* {{{ */ if (!isset($this->_owner)) $this->_owner = $this->_dms->getUser($this->_ownerID); return $this->_owner; @@ -427,7 +427,6 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { $this->_subFolders = array(); for ($i = 0; $i < count($resArr); $i++) -// $this->_subFolders[$i] = new SeedDMS_Core_Folder($resArr[$i]["id"], $resArr[$i]["name"], $resArr[$i]["parent"], $resArr[$i]["comment"], $resArr[$i]["owner"], $resArr[$i]["inheritAccess"], $resArr[$i]["defaultAccess"], $resArr[$i]["sequence"]); $this->_subFolders[$i] = $this->_dms->getFolder($resArr[$i]["id"]); } @@ -743,6 +742,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { * must be the id of the attribute definition. * @param array $version_attributes list of document version attributes. * The element key must be the id of the attribute definition. + * @param object $workflow * @return array/boolean false in case of error, otherwise an array * containing two elements. The first one is the new document, the * second one is the result set returned when inserting the content. @@ -810,6 +810,13 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object { return array($document, $res); } /* }}} */ + /** + * Remove recursively a folder + * + * Removes a folder, all its subfolders and documents + * + * @return boolean true on success, false in case of an error + */ function remove() { /* {{{ */ $db = $this->_dms->getDB(); diff --git a/SeedDMS_Core/Core/inc.ClassUser.php b/SeedDMS_Core/Core/inc.ClassUser.php index b56199843..ec63ee890 100644 --- a/SeedDMS_Core/Core/inc.ClassUser.php +++ b/SeedDMS_Core/Core/inc.ClassUser.php @@ -22,7 +22,7 @@ * 2010 Uwe Steinmann * @version Release: @package_version@ */ -class SeedDMS_Core_User { +class SeedDMS_Core_User { /* {{{ */ /** * @var integer id of user * @@ -67,9 +67,7 @@ class SeedDMS_Core_User { /** * @var string prefered language of user - * possible values are 'English', 'German', 'Chinese_ZH_TW', 'Czech' - * 'Francais', 'Hungarian', 'Italian', 'Portuguese_BR', 'Slovak', - * 'Spanish' + * possible values are subdirectories within the language directory * * @access protected */ @@ -771,8 +769,6 @@ class SeedDMS_Core_User { /** * Returns all documents locked by a given user - * FIXME: Not full implemented. Do not use, because it still requires the - * temporary tables! * * @param object $user * @return array list of documents @@ -802,7 +798,7 @@ class SeedDMS_Core_User { * Get a list of reviews * This function returns a list of all reviews seperated by individual * and group reviews. If the document id - * is passed, then only this document will be checked for approvals. The + * is passed, then only this document will be checked for reviews. The * same is true for the version of a document which limits the list * further. * @@ -818,11 +814,6 @@ class SeedDMS_Core_User { function getReviewStatus($documentID=null, $version=null) { /* {{{ */ $db = $this->_dms->getDB(); -/* - if (!$db->createTemporaryTable("ttreviewid")) { - return false; - } -*/ $status = array("indstatus"=>array(), "grpstatus"=>array()); // See if the user is assigned as an individual reviewer. @@ -912,27 +903,7 @@ class SeedDMS_Core_User { function getApprovalStatus($documentID=null, $version=null) { /* {{{ */ $db = $this->_dms->getDB(); -/* - if (!$db->createTemporaryTable("ttapproveid")) { - return false; - } -*/ $status = array("indstatus"=>array(), "grpstatus"=>array()); - - // See if the user is assigned as an individual approver. - /* - $queryStr = "SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ". - "`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ". - "`tblDocumentApproveLog`.`userID` ". - "FROM `tblDocumentApprovers` ". - "LEFT JOIN `tblDocumentApproveLog` USING (`approveID`) ". - "LEFT JOIN `ttapproveid` on `ttapproveid`.`maxLogID` = `tblDocumentApproveLog`.`approveLogID` ". - "WHERE `ttapproveid`.`maxLogID`=`tblDocumentApproveLog`.`approveLogID` ". - ($documentID==null ? "" : "AND `tblDocumentApprovers`.`documentID` = '". $documentID ."' "). - ($version==null ? "" : "AND `tblDocumentApprovers`.`version` = '". $version ."' "). - "AND `tblDocumentApprovers`.`type`='0' ". - "AND `tblDocumentApprovers`.`required`='". $this->_id ."' "; -*/ $queryStr = "SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ". "`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ". @@ -962,20 +933,6 @@ class SeedDMS_Core_User { // See if the user is the member of a group that has been assigned to // approve the document version. - /* - $queryStr = "SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ". - "`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ". - "`tblDocumentApproveLog`.`userID` ". - "FROM `tblDocumentApprovers` ". - "LEFT JOIN `tblDocumentApproveLog` USING (`approveID`) ". - "LEFT JOIN `tblGroupMembers` ON `tblGroupMembers`.`groupID` = `tblDocumentApprovers`.`required` ". - "LEFT JOIN `ttapproveid` on `ttapproveid`.`maxLogID` = `tblDocumentApproveLog`.`approveLogID` ". - "WHERE `ttapproveid`.`maxLogID`=`tblDocumentApproveLog`.`approveLogID` ". - ($documentID==null ? "" : "AND `tblDocumentApprovers`.`documentID` = '". $documentID ."' "). - ($version==null ? "" : "AND `tblDocumentApprovers`.`version` = '". $version ."' "). - "AND `tblDocumentApprovers`.`type`='1' ". - "AND `tblGroupMembers`.`userID`='". $this->_id ."'"; - */ $queryStr = "SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ". "`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ". @@ -1315,5 +1272,5 @@ class SeedDMS_Core_User { return $notifications; } /* }}} */ -} +} /* }}} */ ?> From 17fc1d7dd4e19695199d490d5572bd16d4334398 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 7 Apr 2016 08:30:25 +0200 Subject: [PATCH 06/11] sync with 5.0.x --- inc/inc.Authentication.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/inc/inc.Authentication.php b/inc/inc.Authentication.php index fa19d09b9..d300504b7 100644 --- a/inc/inc.Authentication.php +++ b/inc/inc.Authentication.php @@ -61,10 +61,17 @@ if (!is_object($user)) { if($user->isAdmin()) { if($resArr["su"]) { $user = $dms->getUser($resArr["su"]); + } else { + $session->resetSu(); } } +$theme = $resArr["theme"]; +$lang = $resArr["language"]; + $dms->setUser($user); + $notifier = new SeedDMS_NotificationService(); + if($settings->_enableEmail) { $notifier->addService(new SeedDMS_EmailNotify($dms)); } @@ -82,9 +89,8 @@ if(file_exists($settings->_rootDir . "languages/" . $resArr["language"] . "/lang } */ -$theme = $resArr["theme"]; -if(file_exists($settings->_rootDir . "view/".$theme."/languages/" . $resArr["language"] . "/lang.inc")) { - include $settings->_rootDir . "view/".$theme."/languages/" . $resArr["language"] . "/lang.inc"; +if(file_exists($settings->_rootDir . "view/".$theme."/languages/" . $lang . "/lang.inc")) { + include $settings->_rootDir . "view/".$theme."/languages/" . $lang . "/lang.inc"; } /* Check if password needs to be changed because it expired. If it needs From df040190f126e70c19c9427c3e8c3b5cc31ab491 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 7 Apr 2016 08:30:47 +0200 Subject: [PATCH 07/11] pass $settings to view, set default theme to bootstrap --- inc/inc.ClassUI.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/inc.ClassUI.php b/inc/inc.ClassUI.php index 085edaf54..a0b457d87 100644 --- a/inc/inc.ClassUI.php +++ b/inc/inc.ClassUI.php @@ -26,7 +26,7 @@ if (!isset($theme) || strlen($theme)==0) { $theme = $settings->_theme; } if (strlen($theme)==0) { - $theme="blue"; + $theme="bootstrap"; } /* Sooner or later the parent will be removed, because all output will @@ -60,6 +60,7 @@ class UI extends UI_Default { $view->setParam('refferer', $_SERVER['REQUEST_URI']); $view->setParam('class', $class); $view->setParam('session', $session); + $view->setParam('settings', $settings); $view->setParam('sitename', $settings->_siteName); $view->setParam('rootfolderid', $settings->_rootFolderID); $view->setParam('disableselfedit', $settings->_disableSelfEdit); From c2d8fb150808cba5d16902ae575f3c4d4add6f4b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 7 Apr 2016 08:31:11 +0200 Subject: [PATCH 08/11] remove empty line --- inc/inc.ClassNotify.php | 1 - 1 file changed, 1 deletion(-) diff --git a/inc/inc.ClassNotify.php b/inc/inc.ClassNotify.php index 8274c8a90..a0c1fa861 100644 --- a/inc/inc.ClassNotify.php +++ b/inc/inc.ClassNotify.php @@ -28,6 +28,5 @@ abstract class SeedDMS_Notify { abstract function toIndividual($sender, $recipient, $subject, $message, $params=array()); abstract function toGroup($sender, $groupRecipient, $subject, $message, $params=array()); abstract function toList($sender, $recipients, $subject, $message, $params=array()); - } ?> From c3ab200c8731a39254fecbae73ac262dca62239c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 7 Apr 2016 08:31:40 +0200 Subject: [PATCH 09/11] use SEEDDMS_CONFIG_FILE if set --- inc/inc.Settings.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/inc.Settings.php b/inc/inc.Settings.php index a766e0811..cc58e53b1 100644 --- a/inc/inc.Settings.php +++ b/inc/inc.Settings.php @@ -2,7 +2,7 @@ // MyDMS. Document Management System // Copyright (C) 2002-2005 Markus Westphal // Copyright (C) 2006-2008 Malcolm Cowe -// Copyright (C) 2010 Matteo Lucarelli +// Copyright (C) 2010 Matteo Lucarelli // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -47,7 +47,10 @@ if (file_exists("../inc/inc.Settings.old.php")) { } require_once('inc.ClassSettings.php'); -$settings = new Settings(); +if(defined("SEEDDMS_CONFIG_FILE")) + $settings = new Settings(SEEDDMS_CONFIG_FILE); +else + $settings = new Settings(); if(!defined("SEEDDMS_INSTALL") && file_exists(dirname($settings->_configFilePath)."/ENABLE_INSTALL_TOOL")) { die("SeedDMS won't run unless your remove the file ENABLE_INSTALL_TOOL from your configuration directory."); } From ef6bbecd1eee6915ff7e0dbd4e74f6db02e0504b Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 7 Apr 2016 08:32:07 +0200 Subject: [PATCH 10/11] add optional parameter to add_log_line() --- inc/inc.Utils.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/inc/inc.Utils.php b/inc/inc.Utils.php index 28c33937d..08b10bc35 100644 --- a/inc/inc.Utils.php +++ b/inc/inc.Utils.php @@ -306,15 +306,26 @@ function dskspace($dir) { /* {{{ */ return $space; } /* }}} */ -function add_log_line($msg="") { /* {{{ */ +/** + * Log a message + * + * This function is still here for convienice and because it is + * used at so many places. + * + * @param string $msg + * @param int $priority can be one of PEAR_LOG_EMERG, PEAR_LOG_ALERT, + * PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING, + * PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG. + */ +function add_log_line($msg="", $priority=null) { /* {{{ */ global $logger, $user; if(!$logger) return; if($user) - $logger->log($user->getLogin()." (".$_SERVER['REMOTE_ADDR'].") ".basename($_SERVER["REQUEST_URI"], ".php").$msg); + $logger->log($user->getLogin()." (".$_SERVER['REMOTE_ADDR'].") ".basename($_SERVER["REQUEST_URI"], ".php").$msg, $priority); else - $logger->log("-- (".$_SERVER['REMOTE_ADDR'].") ".basename($_SERVER["REQUEST_URI"], ".php").$msg); + $logger->log("-- (".$_SERVER['REMOTE_ADDR'].") ".basename($_SERVER["REQUEST_URI"], ".php").$msg, $priority); } /* }}} */ function _add_log_line($msg="") { /* {{{ */ From 0f1a0bece524b12a5d1b06523a86b31633e654df Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 7 Apr 2016 08:36:20 +0200 Subject: [PATCH 11/11] fix typo in hook function --- op/op.AddDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op/op.AddDocument.php b/op/op.AddDocument.php index f7f9b0b4e..ee465d8f3 100644 --- a/op/op.AddDocument.php +++ b/op/op.AddDocument.php @@ -286,7 +286,7 @@ for ($file_num=0;$file_numpreAddDocument(array('name'=>&$name, 'comment'=>&$comment)); } }