From 957482bc9b23949923f7ac4a3dbb8b8b54892603 Mon Sep 17 00:00:00 2001 From: Sebastian Bartus-Kunz Date: Fri, 10 Jun 2016 15:06:41 +0200 Subject: [PATCH 01/41] Added change password request. --- restapi/index.php | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/restapi/index.php b/restapi/index.php index a2b17da90..f98ebe8ef 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -929,6 +929,53 @@ function createAccount() { /* {{{ */ return; } /* }}} */ +/** + * Updates the password of an existing Account, the password must be PUT as a md5 string + * + * @param $id The user name or numerical identifier + */ +function changeAccountPassword($id) { /* {{{ */ + global $app, $dms, $userobj; + + checkIfAdmin(); + + if ($app->request()->put('password') == null) + { + $app->response()->header('Content-Type', 'application/json'); + echo json_encode(array('success'=>false, 'message'=>'You must PUT a new password', 'data'=>'')); + return; + } + + $newPassword = $app->request()->put('password'); + + if(is_numeric($id)) + $account = $dms->getUser($id); + else { + $account = $dms->getUserByLogin($id); + } + + /** + * User not found + */ + if (!$account) { + $app->response()->status(404); + return; + } + + $operation = $account->setPwd($newPassword); + + if (!$operation){ + $app->response()->header('Content-Type', 'application/json'); + echo json_encode(array('success'=>false, 'message'=>'', 'data'=>'Could not change password.')); + return; + } + + $app->response()->header('Content-Type', 'application/json'); + echo json_encode(array('success'=>true, 'message'=>'', 'data'=>'')); + + return; +} /* }}} */ + function getAccountById($id) { /* {{{ */ global $app, $dms, $userobj; checkIfAdmin(); @@ -1351,6 +1398,7 @@ $app->get('/account/locked', 'getLockedDocuments'); $app->post('/accounts', 'createAccount'); $app->get('/accounts/:id', 'getAccountById'); $app->put('/accounts/:id/disable', 'setDisabledAccount'); +$app->get('/accounts/:id/password', 'changeAccountPassword'); $app->post('/groups', 'createGroup'); $app->get('/groups/:id', 'getGroup'); $app->put('/groups/:id/addUser', 'addUserToGroup'); From f3490fc6ced1af8d2c96b76c806d47c77553e4f1 Mon Sep 17 00:00:00 2001 From: Sebastian Bartus-Kunz Date: Fri, 10 Jun 2016 15:08:33 +0200 Subject: [PATCH 02/41] Small fix. --- restapi/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restapi/index.php b/restapi/index.php index f98ebe8ef..99b9460b2 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -1398,7 +1398,7 @@ $app->get('/account/locked', 'getLockedDocuments'); $app->post('/accounts', 'createAccount'); $app->get('/accounts/:id', 'getAccountById'); $app->put('/accounts/:id/disable', 'setDisabledAccount'); -$app->get('/accounts/:id/password', 'changeAccountPassword'); +$app->put('/accounts/:id/password', 'changeAccountPassword'); $app->post('/groups', 'createGroup'); $app->get('/groups/:id', 'getGroup'); $app->put('/groups/:id/addUser', 'addUserToGroup'); From 2c1374bea52a17bf376de09d9176ae0948aff0c8 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 27 Sep 2017 06:20:48 +0200 Subject: [PATCH 03/41] take out echo --- SeedDMS_Core/Core/inc.ClassDocument.php | 1 - 1 file changed, 1 deletion(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index deeae9e6a..b94f43ca9 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -3799,7 +3799,6 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ $this->_workflow->setDMS($this->_document->_dms); if($transition) { - echo "Trigger transition"; if(false === $this->triggerWorkflowTransition($user, $transition, $comment)) { $db->rollbackTransaction(); return false; From dde468ca9e6d1a9d030125ff83fdde0353d27a38 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 28 Sep 2017 20:48:29 +0200 Subject: [PATCH 04/41] make strict check for selected options in a select menu without strict checking an option with value=0 will be treated as if no option was selected. --- views/bootstrap/class.Settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index 1fac139f5..7eba8eff8 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -777,7 +777,7 @@ if(!is_writeable($settings->_configFilePath)) { echo "