diff --git a/features/backend/projects/case_scheduler/main_tests_case_scheduler.feature b/features/backend/projects/case_scheduler/main_tests_case_scheduler.feature index 6c715f861..c02c9ddff 100644 --- a/features/backend/projects/case_scheduler/main_tests_case_scheduler.feature +++ b/features/backend/projects/case_scheduler/main_tests_case_scheduler.feature @@ -8,7 +8,7 @@ Feature: Case Scheduler Main Tests Background: Given that I have a valid access_token -Scenario Outline: Get the case schedulers list when there are exactly zero case schedulers +Scenario Outline: Get the case schedulers list when there are exactly case schedulers Given I request "project//case-schedulers" Then the response status code should be 200 And the response charset is "UTF-8" @@ -116,7 +116,7 @@ Scenario Outline: Get the case schedulers list when there are exactly 16 case sc And the response charset is "UTF-8" And the content type is "application/json" And the type is "array" - And the response has 16 record + And the response has record Examples: diff --git a/features/backend/projects/report_tables/main_tests_report_tables.feature b/features/backend/projects/report_tables/main_tests_report_tables.feature index 3bafd669e..63b4ccc5e 100644 --- a/features/backend/projects/report_tables/main_tests_report_tables.feature +++ b/features/backend/projects/report_tables/main_tests_report_tables.feature @@ -3,15 +3,22 @@ Feature: Report Tables Requirements: a workspace with the process 922677707524ac7417ce345089010125 ("Test Designer Report Tables") already loaded there are zero Report Table in the process + and workspace with the process 1455892245368ebeb11c1a5001393784 - "Process Complete BPMN" already loaded" already loaded Background: Given that I have a valid access_token -Scenario: Verify that there are no report tables - Given I request "project/922677707524ac7417ce345089010125/report-tables" +Scenario Outline: Verify that there are no report tables + Given I request "project//report-tables" Then the response status code should be 200 And the response charset is "UTF-8" - And the response has 0 record + And the response has record + + Examples: + | test_description | project | record | + | Get of report table of process Test Designer Report Tables | 922677707524ac7417ce345089010125 | 0 | + | Get of report table of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 1 | + Scenario Outline: Create new report tables from dynaform and grid Given POST this data: @@ -51,10 +58,10 @@ Scenario Outline: Create new report tables from dynaform and grid Examples: - | test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 | - | Create a Report Table - Normal | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | - | Create a Report Table - Grid | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc 2 | workflow | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | - + | test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 | + | Create a Report Table - Normal .pm | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | + | Create a Report Table - Grid .pm | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc 2 | workflow | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 15 | + Scenario: Create a new database connection with same name Given POST this data: @@ -81,12 +88,16 @@ Scenario: Create a new database connection with same name And the response status message should have the following text "already exits" -Scenario: Verify that there are 2 report tables - Given I request "project/922677707524ac7417ce345089010125/report-tables" +Scenario Outline: Verify that there are 2 report tables + Given I request "project//report-tables" Then the response status code should be 200 And the response charset is "UTF-8" - And the response has 2 record + And the response has record + Examples: + | test_description | project | record | + | Get of report table of process Test Designer Report Tables | 922677707524ac7417ce345089010125 | 2 | + Scenario Outline: Update a created report tables Given PUT this data: @@ -122,13 +133,13 @@ Scenario Outline: Update a created report tables Then the response status code should be 200 And the response charset is "UTF-8" And the type is "object" - + Examples: - | test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 | - | Update a Report Table - Normal | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | - | Update a Report Table - Grid | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | - + | test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 | + | Update a Report Table - Normal .pm | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | + | Update a Report Table - Grid .pm | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | 267480685524ac9b3bd5e23004484669 | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | + Scenario Outline: Get a details of created report tables Given that I want to get a resource with the key "rep_uid" stored in session array as variable "rep_uid_" @@ -141,10 +152,10 @@ Scenario Outline: Get a details of created report tables Examples: - | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 | - | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | - | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | - + | test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 | + | Update a Report Table - Normal .pm | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | + | Update a Report Table - Grid .pm | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | + Scenario Outline: Populate report tables Given I request "project//report-table/rep_uid/populate" with the key "rep_uid" stored in session array as variable "rep_uid_" @@ -152,12 +163,11 @@ Scenario Outline: Populate report tables Examples: - - | test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 | - | Populate Report Table Normal | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | - | Populate Report Table Grid | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | - - + + | test_description | project | rep_uid_number | rep_tab_name | rep_tab_dsc | rep_tab_connection | rep_tab_type | rep_tab_grid | fld_dyn_1 | fld_name_1 | fld_label_1 | fld_type_1 | fld_size_1 | fld_dyn_2 | fld_name_2 | fld_label_2 | fld_type_2 | fld_size_2 | fld_dyn_3 | fld_name_3 | fld_label_3 | fld_type_3 | fld_size_3 | + | Populate Report Table Normal .pm | 922677707524ac7417ce345089010125 | 1 | REPORT_TABLE_1 | Report Table Desc Updated 1 | workflow | NORMAL | | nameany | NAME_ANY | Name Any | VARCHAR | 64 | date1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | + | Populate Report Table Grid .pm | 922677707524ac7417ce345089010125 | 2 | REPORT_TABLE_2 | Report Table Desc Updated 2 | workflow | GRID | grid | text1 | TEXT_1 | Text 1 | VARCHAR | 64 | fecha1 | DATE_1 | Date | DATE | 0 | | CUSTOM_FIELD_1 | Custom Field 1 | VARCHAR | 150 | + Scenario Outline: Delete a created report tables Given that I want to delete a resource with the key "rep_uid" stored in session array as variable "rep_uid_" @@ -168,13 +178,19 @@ Scenario Outline: Delete a created report tables Examples: - | test_description | project | rep_uid_number | - | Delete Report Table Normal | 922677707524ac7417ce345089010125 | 1 | - | Delete Report Table Grid | 922677707524ac7417ce345089010125 | 2 | + | test_description | project | rep_uid_number | + | Delete Report Table Normal .pm | 922677707524ac7417ce345089010125 | 1 | + | Delete Report Table Grid .pm | 922677707524ac7417ce345089010125 | 2 | + + - -Scenario: Verify that the report tables were deleted correctly - Given I request "project/922677707524ac7417ce345089010125/report-tables" +Scenario Outline: Verify that the report tables were deleted correctly + Given I request "project//report-tables" Then the response status code should be 200 And the response charset is "UTF-8" - And the response has 0 record + And the response has record + + Examples: + | test_description | project | record | + | Get of report table of process Test Designer Report Tables | 922677707524ac7417ce345089010125 | 0 | + | Get of report table of process Process Complete BPMN | 1455892245368ebeb11c1a5001393784 | 1 | \ No newline at end of file diff --git a/features/backend/projects/web_entry/main_tests_web_entry.feature b/features/backend/projects/web_entry/main_tests_web_entry.feature index 355fc36c4..290c31f01 100644 --- a/features/backend/projects/web_entry/main_tests_web_entry.feature +++ b/features/backend/projects/web_entry/main_tests_web_entry.feature @@ -3,6 +3,7 @@ Feature: Web Entry Main Tests Requirements: a workspace with the process 28733629952e66a362c4f63066393844 ("Sample Project #5 (Web Entry)") already loaded there are zero web entry in the process +and workspace with the process 1455892245368ebeb11c1a5001393784 - "Process Complete BPMN" already loaded" already loaded Background: Given that I have a valid access_token @@ -10,21 +11,24 @@ Background: #ASSIGNEE USER OF AN ACTIVITY Scenario Outline: List assignees of an activity - Given I request "project/28733629952e66a362c4f63066393844/activity//assignee" + Given I request "project//activity//assignee" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the json data is an empty array + And the response has records Examples: - | tas_uid | tas_title | - | 44199549652e66ba533bb06088252754 | Task 1 | - | 56118778152e66babcc2103002009439 | Task 2 | - | 18096002352e66bc1643af8048493068 | Task 3 | + | Description | project | tas_uid | tas_title | records | + | Get list activity of process .pm | 28733629952e66a362c4f63066393844 | 44199549652e66ba533bb06088252754 | Task 1 | 0 | + | Get list activity of process .pm | 28733629952e66a362c4f63066393844 | 56118778152e66babcc2103002009439 | Task 2 | 0 | + | Get list activity of process .pm | 28733629952e66a362c4f63066393844 | 18096002352e66bc1643af8048493068 | Task 3 | 0 | + | Get list activity of process .pmx | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | Task 1 | 1 | + | Get list activity of process .pmx | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | Task 2 | 1 | + | Get list activity of process .pmx | 1455892245368ebeb11c1a5001393784 | 2072984565368efc137a394001073529 | Task 3 | 1 | + - Scenario Outline: Assign a user or group to an activity Given POST this data: """ @@ -48,14 +52,20 @@ Scenario Outline: Assign a user or group to an activity #WEB ENTRY -Scenario: Get list Web Entries of a Project when there are exactly zero web entries - And I request "project/28733629952e66a362c4f63066393844/web-entries" +Scenario Outline: Get list Web Entries of a Project when there are exactly zero web entries + And I request "project//web-entries" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 0 records + And the response has records + Examples: + + | Description | project | records | + | Get list web entry of process .pm | 28733629952e66a362c4f63066393844 | 0 | + | Get list web entry of process .pmx | 1455892245368ebeb11c1a5001393784 | 1 | + Scenario Outline: Create a new Web Entry using the method: PHP pages with Web Services Given POST this data: @@ -70,7 +80,7 @@ Scenario Outline: Create a new Web Entry using the method: PHP pages with Web Se "we_input_document_access": } """ - And I request "project/28733629952e66a362c4f63066393844/web-entry" + And I request "project//web-entry" And the content type is "application/json" Then the response status code should be 201 And the response charset is "UTF-8" @@ -85,24 +95,33 @@ Scenario Outline: Create a new Web Entry using the method: PHP pages with Web Se Examples: - | Description | we_number | tas_uid | we_title | dyn_uid | we_description | we_input_document_access | - | Web entry PHP task 1, with values normal | 1 | 44199549652e66ba533bb06088252754 | Web Entry PHP 1 | 60308801852e66b7181ae21045247174 | Webservice PHP Description 1 | 1 | - | Web entry PHP task 2, with character special | 2 | 56118778152e66babcc2103002009439 | Web Entry PHP 2 @#$%&* | 99869771852e66b7dc4b858088901665 | Webservice PHP Description 2 | 1 | - | Web entry PHP task 3, with we_input_document_access in 0 | 3 | 18096002352e66bc1643af8048493068 | Web Entry PHP 3 | 37977455352e66b892babe6071295002 | Webservice PHP Description 3 | 0 | + | Description | we_number | project | tas_uid | we_title | dyn_uid | we_description | we_input_document_access | + | Web entry PHP task 1, with values normal .pm | 1 | 28733629952e66a362c4f63066393844 | 44199549652e66ba533bb06088252754 | Web Entry PHP 1 | 60308801852e66b7181ae21045247174 | Webservice PHP Description 1 | 1 | + | Web entry PHP task 2, with character special .pm | 2 | 28733629952e66a362c4f63066393844 | 56118778152e66babcc2103002009439 | Web Entry PHP 2 @#$%&* | 99869771852e66b7dc4b858088901665 | Webservice PHP Description 2 | 1 | + | Web entry PHP task 3, with we_input_document_access in 0 .pm | 3 | 28733629952e66a362c4f63066393844 | 18096002352e66bc1643af8048493068 | Web Entry PHP 3 | 37977455352e66b892babe6071295002 | Webservice PHP Description 3 | 0 | + | Web entry PHP task 1, with values normal .pmx | 7 | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | x Web Entry PHP 1 | 898822326536be3a12addb0034537553 | Webservice PHP Description 1 | 1 | + | Web entry PHP task 2, with character special .pmx | 8 | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | x Web Entry PHP 2 @#$%&* | 318701641536be67467eb84048959982 | Webservice PHP Description 2 | 1 | + | Web entry PHP task 3, with we_input_document_access in 0 .pmx | 9 | 1455892245368ebeb11c1a5001393784 | 2072984565368efc137a394001073529 | x Web Entry PHP 3 | 923528807536be661d3d421038593630 | Webservice PHP Description 3 | 0 | - -Scenario: Get list Web Entries of a Project after created in this scritp web entries PHP - And I request "project/28733629952e66a362c4f63066393844/web-entries" + +Scenario Outline: Get list Web Entries of a Project after created in this scritp web entries PHP + And I request "project//web-entries" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 3 records + And the response has records + + Examples: + + | Description | project | records | + | Get list web entry of process .pm | 28733629952e66a362c4f63066393844 | 3 | + | Get list web entry of process .pmx | 1455892245368ebeb11c1a5001393784 | 4 | Scenario Outline: Get a single Web Entry PHP of a Project Given that I want to get a resource with the key "we_uid" stored in session array as variable "we_uid_" - And I request "project/28733629952e66a362c4f63066393844/web-entry" + And I request "project//web-entry" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" @@ -113,10 +132,13 @@ Scenario Outline: Get a single Web Entry PHP of a Project Examples: - | we_number | tas_uid | we_title | dyn_uid | we_description | we_input_document_access | - | 1 | 44199549652e66ba533bb06088252754 | Web Entry PHP 1 | 60308801852e66b7181ae21045247174 | Webservice PHP Description 1 | 1 | - | 2 | 56118778152e66babcc2103002009439 | Web Entry PHP 2 @#$%&* | 99869771852e66b7dc4b858088901665 | Webservice PHP Description 2 | 1 | - | 3 | 18096002352e66bc1643af8048493068 | Web Entry PHP 3 | 37977455352e66b892babe6071295002 | Webservice PHP Description 3 | 0 | + | we_number | project | tas_uid | we_title | dyn_uid | we_description | we_input_document_access | + | 1 | 28733629952e66a362c4f63066393844 | 44199549652e66ba533bb06088252754 | Web Entry PHP 1 | 60308801852e66b7181ae21045247174 | Webservice PHP Description 1 | 1 | + | 2 | 28733629952e66a362c4f63066393844 | 56118778152e66babcc2103002009439 | Web Entry PHP 2 @#$%&* | 99869771852e66b7dc4b858088901665 | Webservice PHP Description 2 | 1 | + | 3 | 28733629952e66a362c4f63066393844 | 18096002352e66bc1643af8048493068 | Web Entry PHP 3 | 37977455352e66b892babe6071295002 | Webservice PHP Description 3 | 0 | + | 7 | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | xWeb Entry PHP 1 | 898822326536be3a12addb0034537553 | Webservice PHP Description 1 | 1 | + | 8 | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | xWeb Entry PHP 2 @#$%&* | 318701641536be67467eb84048959982 | Webservice PHP Description 2 | 1 | + | 9 | 1455892245368ebeb11c1a5001393784 | 2072984565368efc137a394001073529 | xWeb Entry PHP 3 | 923528807536be661d3d421038593630 | Webservice PHP Description 3 | 0 | Scenario Outline: Update Web Entry PHP @@ -125,29 +147,30 @@ Scenario Outline: Update Web Entry PHP { "tas_uid": "", "dyn_uid": "", - "usr_uid": "", "we_title": "", "we_description": "", - "we_method": "", + "we_method": "WS", "we_input_document_access": 1 } """ And that I want to update a resource with the key "we_uid" stored in session array as variable "we_uid_" - And I request "project/28733629952e66a362c4f63066393844/web-entry" + And I request "project//web-entry" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" Examples: - | we_number | tas_uid | we_title | dyn_uid | we_description | usr_uid | we_method | - | 1 | 44199549652e66ba533bb06088252754 | Update Web Entry PHP 1 | 60308801852e66b7181ae21045247174 | Update Webservice PHP Description 1 | 00000000000000000000000000000001 | WS | - | 2 | 56118778152e66babcc2103002009439 | Update Web Entry PHP 2 @#$%&* | 99869771852e66b7dc4b858088901665 | Update Webservice PHP Description 2 | 00000000000000000000000000000001 | WS | - + | we_number | project | tas_uid | we_title | dyn_uid | we_description | we_input_document_access | + | 1 | 28733629952e66a362c4f63066393844 | 44199549652e66ba533bb06088252754 | Update Web Entry PHP 1 | 60308801852e66b7181ae21045247174 | Update Webservice PHP Description 1 | 1 | + | 2 | 28733629952e66a362c4f63066393844 | 56118778152e66babcc2103002009439 | Update Web Entry PHP 2 @#$%&* | 99869771852e66b7dc4b858088901665 | Update Webservice PHP Description 2 | 1 | + | 7 | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | xUpdate Web Entry PHP 1 | 898822326536be3a12addb0034537553 | Upadte Webservice PHP Description 1 | 1 | + | 8 | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | xUpdate Web Entry PHP 2 @#$%&* | 318701641536be67467eb84048959982 | Upadte Webservice PHP Description 2 | 1 | + Scenario Outline: Get a single Web Entry PHP of a Project Given that I want to get a resource with the key "we_uid" stored in session array as variable "we_uid_" - And I request "project/28733629952e66a362c4f63066393844/web-entry" + And I request "project//web-entry" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" @@ -158,10 +181,13 @@ Scenario Outline: Get a single Web Entry PHP of a Project Examples: - | we_number | tas_uid | we_title | dyn_uid | we_description | usr_uid | we_method | - | 1 | 44199549652e66ba533bb06088252754 | Update Web Entry PHP 1 | 60308801852e66b7181ae21045247174 | Update Webservice PHP Description 1 | 00000000000000000000000000000001 | WS | - | 2 | 56118778152e66babcc2103002009439 | Update Web Entry PHP 2 @#$%&* | 99869771852e66b7dc4b858088901665 | Update Webservice PHP Description 2 | 00000000000000000000000000000001 | WS | - | 3 | 18096002352e66bc1643af8048493068 | Web Entry PHP 3 | 37977455352e66b892babe6071295002 | Webservice PHP Description 3 | 00000000000000000000000000000001 | WS | + | we_number | project | tas_uid | we_title | dyn_uid | we_description | usr_uid | we_method | + | 1 | 28733629952e66a362c4f63066393844 | 44199549652e66ba533bb06088252754 | Update Web Entry PHP 1 | 60308801852e66b7181ae21045247174 | Update Webservice PHP Description 1 | 00000000000000000000000000000001 | WS | + | 2 | 28733629952e66a362c4f63066393844 | 56118778152e66babcc2103002009439 | Update Web Entry PHP 2 @#$%&* | 99869771852e66b7dc4b858088901665 | Update Webservice PHP Description 2 | 00000000000000000000000000000001 | WS | + | 3 | 28733629952e66a362c4f63066393844 | 18096002352e66bc1643af8048493068 | Web Entry PHP 3 | 37977455352e66b892babe6071295002 | Webservice PHP Description 3 | 00000000000000000000000000000001 | WS | + | 7 | 1455892245368ebeb11c1a5001393784 | 6274755055368eed1116388064384542 | xUpdate Web Entry PHP 1 | 898822326536be3a12addb0034537553 | Upadte Webservice PHP Description 1 | 00000000000000000000000000000001 | WS | + | 8 | 1455892245368ebeb11c1a5001393784 | 4790702485368efad167477011123879 | xUpdate Web Entry PHP 2 @#$%&* | 318701641536be67467eb84048959982 | Upadte Webservice PHP Description 2 | 00000000000000000000000000000001 | WS | + | 9 | 1455892245368ebeb11c1a5001393784 | 2072984565368efc137a394001073529 | xWeb Entry PHP 3 | 923528807536be661d3d421038593630 | Webservice PHP Description 3 | 00000000000000000000000000000001 | WS | Scenario Outline: Update Web Entry, when we_method is change a other method of the register 3 @@ -294,7 +320,7 @@ Scenario Outline: Get a single Web Entry HTML of a Project Scenario Outline: Delete a Web Entry of a Project Given that I want to delete a resource with the key "we_uid" stored in session array as variable "we_uid_" - And I request "project/28733629952e66a362c4f63066393844/web-entry" + And I request "project//web-entry" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" @@ -302,22 +328,31 @@ Scenario Outline: Delete a Web Entry of a Project Examples: - | we_number | - | 1 | - | 2 | - | 3 | - | 4 | - | 5 | - | 6 | + | project | we_number | + | 28733629952e66a362c4f63066393844 | 1 | + | 28733629952e66a362c4f63066393844 | 2 | + | 28733629952e66a362c4f63066393844 | 3 | + | 28733629952e66a362c4f63066393844 | 4 | + | 28733629952e66a362c4f63066393844 | 5 | + | 28733629952e66a362c4f63066393844 | 6 | + | 1455892245368ebeb11c1a5001393784 | 7 | + | 1455892245368ebeb11c1a5001393784 | 8 | + | 1455892245368ebeb11c1a5001393784 | 9 | -Scenario: Get list Web Entries of a Project - And I request "project/28733629952e66a362c4f63066393844/web-entries" +Scenario Outline: Get list Web Entries of a Project + And I request "project//web-entries" And the content type is "application/json" Then the response status code should be 200 And the response charset is "UTF-8" And the type is "array" - And the response has 0 records + And the response has records + + Examples: + + | Description | project | records | + | Get list web entry of process .pm | 28733629952e66a362c4f63066393844 | 0 | + | Get list web entry of process .pmx | 1455892245368ebeb11c1a5001393784 | 1 | #WEB ENTRY - END diff --git a/framework/src/Maveriks/WebApplication.php b/framework/src/Maveriks/WebApplication.php index 94e8cdfe8..d72b62d15 100644 --- a/framework/src/Maveriks/WebApplication.php +++ b/framework/src/Maveriks/WebApplication.php @@ -112,7 +112,7 @@ class WebApplication list($this->requestUri,) = explode('?', $this->requestUri); $uriParts = explode('/', $this->requestUri); - if ($uriParts[2] == 'oauth2') { + if (isset($uriParts[2]) && $uriParts[2] == "oauth2") { return self::RUNNING_OAUTH2; } else { return self::RUNNING_WORKFLOW; diff --git a/gulliver/js/form/core/form.js b/gulliver/js/form/core/form.js index e69a56446..3e49ee588 100755 --- a/gulliver/js/form/core/form.js +++ b/gulliver/js/form/core/form.js @@ -3308,9 +3308,9 @@ var validateForm = function(sRequiredFields) { } } - var arrayForm = document.getElementsByTagName("form"); - var i1 = 0; - var i2 = 0; + arrayForm = document.getElementsByTagName("form"); + i1 = 0; + i2 = 0; for (i1 = 0; i1 <= arrayForm.length - 1; i1++) { var frm = arrayForm[i1]; @@ -3318,14 +3318,14 @@ var validateForm = function(sRequiredFields) { var arrayInput = frm.getElementsByTagName("input"); for (i2 = 0; i2 <= arrayInput.length - 1; i2++) { - var input = arrayInput[i2]; + var inputAux2 = arrayInput[i2]; - if (input.type == "file") { - if (input.value != "") { - var pmindocmaxfilesize = input.getAttribute("pmindocmaxfilesize"); + if (inputAux2.type == "file") { + if (inputAux2.value != "") { + var pmindocmaxfilesize = inputAux2.getAttribute("pmindocmaxfilesize"); if (pmindocmaxfilesize != null && pmindocmaxfilesize != "" && pmindocmaxfilesize > 0) { - var flagFilesize = inputDocumentVerifySize(parseInt(pmindocmaxfilesize), input); + var flagFilesize = inputDocumentVerifySize(parseInt(pmindocmaxfilesize), inputAux2); if (flagFilesize == 0) { new leimnud.module.app.alert().make({label: _("ID_SIZE_VERY_LARGE_PERMITTED")}); diff --git a/gulliver/js/maborak/core/maborak.js b/gulliver/js/maborak/core/maborak.js index be6a8f6b4..f3ecd6e20 100644 --- a/gulliver/js/maborak/core/maborak.js +++ b/gulliver/js/maborak/core/maborak.js @@ -1241,7 +1241,7 @@ if(fielEmailInvalid.length>0){systemMessaggeInvalid+="\n \n"+G_STRINGS.ID_VALIDA alert(systemMessaggeInvalid);swSubmitValidateForm=1;return false;} else{var arrayForm=document.getElementsByTagName("form");var inputAux;var id="";var i1=0;var i2=0;for(i1=0;i1<=arrayForm.length-1;i1++){var frm=arrayForm[i1];for(i2=0;i2<=frm.elements.length-1;i2++){var elem=frm.elements[i2];if(elem.type=="checkbox"&&elem.disabled&&elem.checked){id=elem.id+"_";if(!document.getElementById(id)){inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id;inputAux.name=elem.name;inputAux.value=elem.value;frm.appendChild(inputAux);}}} var arrayLink=frm.getElementsByTagName("a");for(i2=0;i2<=arrayLink.length-1;i2++){var link=arrayLink[i2];if(typeof link.id!="undefined"&&link.id!=""&&link.id!="form[DYN_BACKWARD]"&&link.id!="form[DYN_FORWARD]"){var strHtml=link.parentNode.innerHTML;strHtml=stringReplace("\\x0A","",strHtml);strHtml=stringReplace("\\x0D","",strHtml);strHtml=stringReplace("\\x09","",strHtml);if(/^.*pm:field.*$/.test(strHtml)){id=link.id+"_";if(!document.getElementById(id)){var strAux=link.id.replace("form[","");strAux=strAux.substring(0,strAux.length-1);inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id;inputAux.name=link.id;inputAux.value=link.href;frm.appendChild(inputAux);inputAux=document.createElement("input");inputAux.type="hidden";inputAux.id=id+"label";inputAux.name="form["+strAux+"_label]";inputAux.value=link.innerHTML;frm.appendChild(inputAux);}}}}} -var arrayForm=document.getElementsByTagName("form");var i1=0;var i2=0;for(i1=0;i1<=arrayForm.length-1;i1++){var frm=arrayForm[i1];var arrayInput=frm.getElementsByTagName("input");for(i2=0;i2<=arrayInput.length-1;i2++){var input=arrayInput[i2];if(input.type=="file"){if(input.value!=""){var pmindocmaxfilesize=input.getAttribute("pmindocmaxfilesize");if(pmindocmaxfilesize!=null&&pmindocmaxfilesize!=""&&pmindocmaxfilesize>0){var flagFilesize=inputDocumentVerifySize(parseInt(pmindocmaxfilesize),input);if(flagFilesize==0){new leimnud.module.app.alert().make({label:_("ID_SIZE_VERY_LARGE_PERMITTED")});swSubmitValidateForm=1;return false;}}}}}} +arrayForm=document.getElementsByTagName("form");i1=0;i2=0;for(i1=0;i1<=arrayForm.length-1;i1++){var frm=arrayForm[i1];var arrayInput=frm.getElementsByTagName("input");for(i2=0;i2<=arrayInput.length-1;i2++){var inputAux2=arrayInput[i2];if(inputAux2.type=="file"){if(inputAux2.value!=""){var pmindocmaxfilesize=inputAux2.getAttribute("pmindocmaxfilesize");if(pmindocmaxfilesize!=null&&pmindocmaxfilesize!=""&&pmindocmaxfilesize>0){var flagFilesize=inputDocumentVerifySize(parseInt(pmindocmaxfilesize),inputAux2);if(flagFilesize==0){new leimnud.module.app.alert().make({label:_("ID_SIZE_VERY_LARGE_PERMITTED")});swSubmitValidateForm=1;return false;}}}}}} return true;}}else{return false;}};var getObject=function(sObject){var i;var oAux=null;var iLength=__aObjects__.length;for(i=0;i0){oAux[0].action+='&_REFRESH_=1';oAux[0].submit();}}};var sessionPersits=function(){var rpc=new leimnud.module.rpc.xmlhttp({url:'../services/sessionPersists',args:'dynaformRestoreValues='+(typeof(__dynaformSVal__)!='undefined'?__dynaformSVal__:''),async:false});rpc.make();var response=rpc.xmlhttp.responseText.parseJSON();return response.status;};var showPromptLogin=function(lastAction){lastActionPerformed=lastAction;promptPanel=new leimnud.module.panel();promptPanel.options={statusBarButtons:[{value:_('LOGIN')}],position:{center:true},size:{w:300,h:130},control:{close:false,resize:false},fx:{modal:true}};promptPanel.setStyle={content:{padding:10,paddingBottom:2,textAlign:'left',paddingLeft:50,backgroundRepeat:'no-repeat',backgroundPosition:'10 50%',backgroundColor:'transparent',borderWidth:0}};promptPanel.make();promptPanel.addContent(_('ID_DYNAFORM_EDITOR_LOGIN_AGAIN'));promptPanel.addContent('
');var thePassword=$dce('input');thePassword.type='password';thePassword.id='thePassword';leimnud.dom.setStyle(thePassword,{font:'normal 8pt Tahoma,MiscFixed',color:'#000',width:'100%',marginTop:3,backgroundColor:'white',border:'1px solid #919B9C'});promptPanel.addContent(thePassword);thePassword.focus();thePassword.onkeyup=function(evt) diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index 7347495ad..fe35fa8e8 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -2860,29 +2860,60 @@ class Bootstrap } } - public function hasPassword($pass, $previous=false) { - $passEncrypt = md5($pass); - try { - require_once PATH_CORE .'methods' . PATH_SEP .'enterprise/enterprise.php'; - $passEncrypt = enterprisePlugin::hashPassword($pass, $previous); - } catch (Exception $e) { - + public function getPasswordHashConfig() + { + G::LoadClass('configuration'); + $config= new Configurations(); + $passwordHashConfig = $config->getConfiguration('ENTERPRISE_SETTING_ENCRYPT', ''); + if (!is_null($passwordHashConfig)) { + if (!is_array($passwordHashConfig)) { + $passwordHashConfig = array(); + } + if (!isset($passwordHashConfig['current'])) { + $passwordHashConfig['current'] = 'md5'; + } + if (!isset($passwordHashConfig['previous'])) { + $passwordHashConfig['previous'] = 'md5'; + } + } else { + $passwordHashConfig = array('current' => 'md5', 'previous' => 'md5'); + } + return $passwordHashConfig; + } + + public function getPasswordHashType() + { + $passwordHashConfig = Bootstrap::getPasswordHashConfig(); + return $passwordHashConfig['current']; + } + + public function hashPassword($pass, $hashType = '', $includeHashType = false) + { + if ($hashType == '') { + $hashType = Bootstrap::getPasswordHashType(); } - return $passEncrypt; + eval("\$var = hash('" . $hashType . "', '" . $pass . "');"); + + if ($includeHashType) { + $var = $hashType . ':' . $var; + } + + return $var; } - + public function verifyHashPassword ($pass, $userPass) { - //$verify = Bootstrap::hasPassword($pass); - if (Bootstrap::hasPassword($pass) == $userPass) { + $passwordHashConfig = Bootstrap::getPasswordHashConfig(); + $hashTypeCurrent = $passwordHashConfig['current']; + $hashTypePrevious = $passwordHashConfig['previous']; + if ((Bootstrap::hashPassword($pass, $hashTypeCurrent) == $userPass) || ($pass === $hashTypeCurrent . ':' . $userPass)) { return true; } - if (Bootstrap::hasPassword($pass, true) == $userPass) { + if ((Bootstrap::hashPassword($pass, $hashTypePrevious) == $userPass) || ($pass === $hashTypePrevious . ':' . $userPass)) { return true; } return false; } - } diff --git a/gulliver/system/class.logger.php b/gulliver/system/class.logger.php index 24d7035ab..c107dd71d 100644 --- a/gulliver/system/class.logger.php +++ b/gulliver/system/class.logger.php @@ -2,7 +2,7 @@ /** * class.logger.php - * Stores a message in the log file, if the file size exceeds + * Stores a message in the log file, if the file size exceeds * specified log file is renamed and a new one is created. * $fileName = "filename"; * $fileExtension = ".log"; @@ -10,7 +10,7 @@ * $limitSize = 1000000; * 10000000 -> approximately 10 megabytes * 1000000 -> approximately 1 megabytes - * + * * @author Roly Rudy Gutierrez Pinto * @package gulliver.system */ @@ -103,7 +103,7 @@ class Logger { $this->renameFile(); $file = fopen($this->filePath, "a+"); - $message = date('Y-m-d H:i:s') . " " . $message; + $message = date('Y-m-d H:i:s') . " " . $message . "\n"; fwrite($file, $message); fclose($file); } diff --git a/workflow/engine/bin/cron_single.php b/workflow/engine/bin/cron_single.php index 45a48979b..a02100e11 100755 --- a/workflow/engine/bin/cron_single.php +++ b/workflow/engine/bin/cron_single.php @@ -950,7 +950,7 @@ function saveLog($sSource, $sType, $sDescription) } G::verifyPath(PATH_DATA . "log" . PATH_SEP, true); - G::log("| $sObject | " . $sSource . " | $sType | " . $sDescription . "\n", PATH_DATA); + G::log("| $sObject | " . $sSource . " | $sType | " . $sDescription, PATH_DATA); } catch (Exception $e) { //CONTINUE } diff --git a/workflow/engine/bin/reindex_solr.php b/workflow/engine/bin/reindex_solr.php index 561ff13bc..0c4795091 100644 --- a/workflow/engine/bin/reindex_solr.php +++ b/workflow/engine/bin/reindex_solr.php @@ -350,7 +350,7 @@ function saveLog($sSource, $sType, $sDescription) print date ('H:i:s') . " ($sSource) $sType $sDescription
\n"; G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true); - $message = '(' . $sSource . ') ' . $sDescription . "\n"; + $message = '(' . $sSource . ') ' . $sDescription; if ($sType == 'action') { G::log($message, PATH_DATA); } diff --git a/workflow/engine/bin/verify_solr.php b/workflow/engine/bin/verify_solr.php index 9d1103a3a..5466c7362 100644 --- a/workflow/engine/bin/verify_solr.php +++ b/workflow/engine/bin/verify_solr.php @@ -499,7 +499,7 @@ function saveLog($sSource, $sType, $sDescription) print date ('H:i:s') . " ($sSource) $sType $sDescription
\n"; G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true); - $message = '(' . $sSource . ') ' . $sDescription . "\n"; + $message = '(' . $sSource . ') ' . $sDescription; if ($sType == 'action') { G::log($message, PATH_DATA); } diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 776ef207e..de3d3accf 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -378,7 +378,7 @@ function evaluateFunction ($aGrid, $sExpresion) * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#WSLogin.28.29 * * @param string(32) | $user | Username of the user | The username of the user who will login to ProcessMaker. All subsequent actions will be limited to the permissions of that user. - * @param string(32) | $pass | Password encrypted | The user's password encrypted as an MD5 hash with 'md5:' prepended. + * @param string(32) | $pass | Password encrypted | The user's password encrypted as an MD5 or SHA256 hash with '{hashType}:' prepended. * @param string(32) | $endpoint="" | URI of the WSDL | The URI (address) of the WSDL definition of the ProcessMaker web services. * @return string | $unique ID | Unique Id |The unique ID for the initiated session. * @@ -2849,7 +2849,7 @@ function PMFAddAttachmentToArray($arrayData, $index, $value, $suffix = " Copy({i * * @name PMFRemoveMask * @label PMF Remove Mask - * + * * @param string | $field | Value the field * @param string | $separator | Separator of thousands (, or .) * @param string | $currency | symbol of currency diff --git a/workflow/engine/classes/class.wsBase.php b/workflow/engine/classes/class.wsBase.php index 500799f7a..3e4c65a9a 100755 --- a/workflow/engine/classes/class.wsBase.php +++ b/workflow/engine/classes/class.wsBase.php @@ -1189,7 +1189,7 @@ class wsBase $arrayData = array (); $arrayData["USR_USERNAME"] = $userName; - $arrayData["USR_PASSWORD"] = Bootstrap::hasPassword( $password ); + $arrayData["USR_PASSWORD"] = Bootstrap::hashPassword( $password ); $arrayData["USR_FIRSTNAME"] = $firstName; $arrayData["USR_LASTNAME"] = $lastName; $arrayData["USR_EMAIL"] = $email; @@ -1380,7 +1380,7 @@ class wsBase } if (! empty( $password )) { - $arrayData["USR_PASSWORD"] = Bootstrap::hasPassword( $password ); + $arrayData["USR_PASSWORD"] = Bootstrap::hashPassword( $password ); } //Update user diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index cdc4aeb6a..8a37199b2 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -61,7 +61,7 @@ class workspaceTools * @param bool $first true if this is the first workspace to be upgrade */ public function upgrade($first = false, $buildCacheView = false, $workSpace = SYS_SYS, $onedb = false, $lang = 'en') - { + { $start = microtime(true); CLI::logging("> Verify enterprise old...\n"); $this->verifyEnterprise($workSpace); @@ -111,63 +111,63 @@ class workspaceTools $final = $stop - $start; CLI::logging("<*> Backup log files Process took $final seconds.\n"); - CLI::logging("> Updating Files Manager...\n\n"); + CLI::logging("> Updating Files Manager...\n\n"); $this->upgradeFilesManager($workSpace); } - /** - * Function upgradeFilesManager - * access public - */ - public function upgradeFilesManager($workSpace) { + /** + * Function upgradeFilesManager + * access public + */ + public function upgradeFilesManager($workSpace) { $this->initPropel(true); - $con = Propel::getConnection("root"); - $stmt = $con->createStatement(); - $sDirectory = glob(PATH_DATA . "sites/" . $workSpace . "/" . "mailTemplates/*"); - $sDirectoryPublic = glob(PATH_DATA . "sites/" . $workSpace . "/" . "public/*"); - $files = array(); - foreach($sDirectory as $mailTemplate) { - if (is_dir($mailTemplate)) { - $inner_files = listFiles($mailTemplate); - if (is_array($inner_files)) $files = array_merge($files, $inner_files); - } - if (is_file($mailTemplate)) { - array_push($files, $mailTemplate); - } - } - foreach($sDirectoryPublic as $publicFile) { - if (is_dir($publicFile)) { - $inner_files = listFiles($publicFile); - if (is_array($inner_files)) $files = array_merge($files, $inner_files); - } - if (is_file($publicFile)) { - array_push($files, $publicFile); - } - } - $sDir = PATH_DATA . "sites/" . $workSpace . "/" . "mailTemplates/"; - $sDirPublic = PATH_DATA . "sites/" . $workSpace . "/" . "public/"; - foreach ($files as $aFile) { - if (strpos($aFile, $sDir) !== false){ - $processUid = current(explode("/", str_replace($sDir,'',$aFile))); - } else { - $processUid = current(explode("/", str_replace($sDirPublic,'',$aFile))); - } - $sql = "SELECT PROCESS_FILES.PRF_PATH FROM PROCESS_FILES WHERE PROCESS_FILES.PRF_PATH='" . $aFile ."'"; - $appRows = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC); - $fileUid = ''; - foreach ($appRows as $row) { - $fileUid = $row["PRF_PATH"]; - } - if ($fileUid !== $aFile) { - $sPkProcessFiles = G::generateUniqueID(); - $sDate = date('Y-m-d H:i:s'); - $sql = "INSERT INTO PROCESS_FILES (PRF_UID, PRO_UID, USR_UID, PRF_UPDATE_USR_UID, - PRF_PATH, PRF_TYPE, PRF_EDITABLE, PRF_CREATE_DATE, PRF_UPDATE_DATE) - VALUES ('".$sPkProcessFiles."', '".$processUid."', '00000000000000000000000000000001', '', - '".$aFile."', 'file', 'true', '".$sDate."', NULL)"; - $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC); - } - } + $con = Propel::getConnection("root"); + $stmt = $con->createStatement(); + $sDirectory = glob(PATH_DATA . "sites/" . $workSpace . "/" . "mailTemplates/*"); + $sDirectoryPublic = glob(PATH_DATA . "sites/" . $workSpace . "/" . "public/*"); + $files = array(); + foreach($sDirectory as $mailTemplate) { + if (is_dir($mailTemplate)) { + $inner_files = listFiles($mailTemplate); + if (is_array($inner_files)) $files = array_merge($files, $inner_files); + } + if (is_file($mailTemplate)) { + array_push($files, $mailTemplate); + } + } + foreach($sDirectoryPublic as $publicFile) { + if (is_dir($publicFile)) { + $inner_files = listFiles($publicFile); + if (is_array($inner_files)) $files = array_merge($files, $inner_files); + } + if (is_file($publicFile)) { + array_push($files, $publicFile); + } + } + $sDir = PATH_DATA . "sites/" . $workSpace . "/" . "mailTemplates/"; + $sDirPublic = PATH_DATA . "sites/" . $workSpace . "/" . "public/"; + foreach ($files as $aFile) { + if (strpos($aFile, $sDir) !== false){ + $processUid = current(explode("/", str_replace($sDir,'',$aFile))); + } else { + $processUid = current(explode("/", str_replace($sDirPublic,'',$aFile))); + } + $sql = "SELECT PROCESS_FILES.PRF_PATH FROM PROCESS_FILES WHERE PROCESS_FILES.PRF_PATH='" . $aFile ."'"; + $appRows = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC); + $fileUid = ''; + foreach ($appRows as $row) { + $fileUid = $row["PRF_PATH"]; + } + if ($fileUid !== $aFile) { + $sPkProcessFiles = G::generateUniqueID(); + $sDate = date('Y-m-d H:i:s'); + $sql = "INSERT INTO PROCESS_FILES (PRF_UID, PRO_UID, USR_UID, PRF_UPDATE_USR_UID, + PRF_PATH, PRF_TYPE, PRF_EDITABLE, PRF_CREATE_DATE, PRF_UPDATE_DATE) + VALUES ('".$sPkProcessFiles."', '".$processUid."', '00000000000000000000000000000001', '', + '".$aFile."', 'file', 'true', '".$sDate."', NULL)"; + $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC); + } + } } /** @@ -223,20 +223,22 @@ class workspaceTools } private function resetDBInfoCallback($matches) - { + { /* This function changes the values of defines while keeping their formatting * intact. * $matches will contain several groups: * ((define('()2', ')1 ()3 (');)4 )0 */ - $dbPrefix = array('DB_NAME' => 'wf_', 'DB_USER' => 'wf_', 'DB_RBAC_NAME' => 'wf_', 'DB_RBAC_USER' => 'wf_', 'DB_REPORT_NAME' => 'wf_', 'DB_REPORT_USER' => 'wf_'); $key = isset($matches['key']) ? $matches['key'] : $matches[2]; $value = isset($matches['value']) ? $matches['value'] : $matches[3]; - - if (!$this->onedb) { - if (array_search($key, array('DB_PASS', 'DB_RBAC_PASS', 'DB_REPORT_PASS'))) { - $value = $this->dbInfo['DB_PASS']; - } + + if($this->onedb){ + $dbPrefix = array('DB_NAME' => 'wf_', 'DB_USER' => 'wf_', 'DB_RBAC_NAME' => 'wf_', 'DB_RBAC_USER' => 'wf_', 'DB_REPORT_NAME' => 'wf_', 'DB_REPORT_USER' => 'wf_'); + if (array_search($key, array('DB_PASS', 'DB_RBAC_PASS', 'DB_REPORT_PASS'))) { + $value = $this->dbInfo['DB_PASS']; + } + } else{ + $dbPrefix = array('DB_NAME' => 'wf_', 'DB_USER' => 'wf_', 'DB_RBAC_NAME' => 'rb_', 'DB_RBAC_USER' => 'rb_', 'DB_REPORT_NAME' => 'rp_', 'DB_REPORT_USER' => 'rp_'); } if (array_search($key, array('DB_HOST', 'DB_RBAC_HOST', 'DB_REPORT_HOST')) !== false) { @@ -284,7 +286,7 @@ class workspaceTools throw new Exception("Could not find db.php in the workspace"); } $sDbFile = file_get_contents($this->dbPath); - + if ($sDbFile === false) { throw new Exception("Could not read database information from db.php"); } else { @@ -294,7 +296,7 @@ class workspaceTools $this->onedb = true; } } - + /* Match all defines in the config file. Check updateDBCallback to know what * keys are changed and what groups are matched. * This regular expression will match any "define ('', '');" @@ -538,7 +540,7 @@ class workspaceTools * @param string $lang not currently used */ public function upgradeCacheView($fill = true, $checkOnly = false, $lang = "en") - { + { $this->initPropel(true); //require_once ('classes/model/AppCacheView.php'); @@ -552,19 +554,19 @@ class workspaceTools //setup the appcacheview object, and the path for the sql files $appCache = new AppCacheView(); $appCache->setPathToAppCacheFiles(PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP); - + $userGrants = $appCache->checkGrantsForUser(false); - + $currentUser = $userGrants['user']; $currentUserIsSuper = $userGrants['super']; //if user does not have the SUPER privilege we need to use the root user and grant the SUPER priv. to normal user. - + if (!$currentUserIsSuper) { $appCache->checkGrantsForUser(true); $appCache->setSuperForUser($currentUser); $currentUserIsSuper = true; } - + CLI::logging("-> Creating tables \n"); //now check if table APPCACHEVIEW exists, and it have correct number of fields, etc. $res = $appCache->checkAppCacheView(); @@ -572,7 +574,7 @@ class workspaceTools CLI::logging("-> Update DEL_LAST_INDEX field in APP_DELEGATION table \n"); //Update APP_DELEGATION.DEL_LAST_INDEX data $res = $appCache->updateAppDelegationDelLastIndex($lang, $checkOnly); - + CLI::logging("-> Verifying roles permissions in RBAC \n"); //Update table RBAC permissions Bootstrap::LoadSystem( 'rbac' ); @@ -756,7 +758,7 @@ class workspaceTools * @return array bool upgradeSchema for more information */ public function upgradeDatabase ($onedb = false, $checkOnly = false) - { + { G::LoadClass("patch"); $this->initPropel( true ); p11835::$dbAdapter = $this->dbAdapter; @@ -798,7 +800,7 @@ class workspaceTools public function upgradeSchema($schema, $checkOnly = false, $rbac = false, $onedb = false) { $dbInfo = $this->getDBInfo(); - + if ($dbInfo['DB_NAME'] == $dbInfo['DB_RBAC_NAME']) { $onedb = true; } else { @@ -1030,7 +1032,7 @@ class workspaceTools } $wfDsn = $fields['DB_ADAPTER'] . '://' . $fields['DB_USER'] . ':' . $fields['DB_PASS'] . '@' . $fields['DB_HOST'] . '/' . $fields['DB_NAME']; - + $info = array('Workspace Name' => $fields['WORKSPACE_NAME'], //'Available Databases' => $fields['AVAILABLE_DB'], 'Workflow Database' => sprintf("%s://%s:%s@%s/%s", $fields['DB_ADAPTER'], $fields['DB_USER'], $fields['DB_PASS'], $fields['DB_HOST'], $fields['DB_NAME']), 'RBAC Database' => sprintf("%s://%s:%s@%s/%s", $fields['DB_ADAPTER'], $fields['DB_RBAC_USER'], $fields['DB_RBAC_PASS'], $fields['DB_RBAC_HOST'], $fields['DB_RBAC_NAME']), 'Report Database' => sprintf("%s://%s:%s@%s/%s", $fields['DB_ADAPTER'], $fields['DB_REPORT_USER'], $fields['DB_REPORT_PASS'], $fields['DB_REPORT_HOST'], $fields['DB_REPORT_NAME']), 'MySql Version' => $fields['DATABASE'] @@ -1260,6 +1262,7 @@ class workspaceTools $lines = explode("\n", $script); $previous = null; + $insert = false; foreach ($lines as $j => $line) { // Remove comments from the script $line = trim($line); @@ -1284,6 +1287,7 @@ class workspaceTools $line = substr($line, 0, strrpos($line, ";")); if (strrpos($line, "INSERT INTO") !== false) { + $insert = true; if ($insert) { $result = mysql_query("START TRANSACTION"); $insert = false; @@ -1353,7 +1357,7 @@ class workspaceTools $chmod = @chmod($filename, $perms); if ($chgrp === false || $chmod === false || $chown === false) { if (strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN') { - exec( 'icacls ' . $dirNameWin . '/grant Administrador:(D,WDAC) /T', $res ); + exec( 'icacls ' . $filename . '/grant Administrador:(D,WDAC) /T', $res ); } else { CLI::logging(CLI::error("Failed to set permissions for $filename") . "\n"); } @@ -1445,9 +1449,9 @@ class workspaceTools CLI::logging("> Restoring " . CLI::info($backupWorkspace) . " to " . CLI::info($workspaceName) . "\n"); } $workspace = new workspaceTools($workspaceName); - + if ($workspace->workspaceExists()) { - + if ($overwrite) { CLI::logging(CLI::warning("> Workspace $workspaceName already exist, overwriting!") . "\n"); } else { @@ -1487,7 +1491,7 @@ class workspaceTools if (!$link) { throw new Exception('Could not connect to system database: ' . mysql_error()); } - + $newDBNames = $workspace->resetDBInfo($dbHost, $createWorkspace); foreach ($metadata->databases as $db) { @@ -1502,7 +1506,7 @@ class workspaceTools $versionOld = ( isset($version[0])) ? $version[0] : ''; CLI::logging(CLI::info("$versionOld < $versionPresent") . "\n"); - if ( $versionOld < $versionPresent) { + if ( $versionOld < $versionPresent || strpos($versionPresent, "Branch")) { $start = microtime(true); CLI::logging("> Updating database...\n"); $workspace->upgradeDatabase(); @@ -1594,7 +1598,7 @@ class workspaceTools } public function checkMafeRequirements ($workspace,$lang) { - $this->initPropel(true); + $this->initPropel(true); $pmRestClient = OauthClientsPeer::retrieveByPK('x-pm-local-client'); if (empty($pmRestClient)) { if (is_file(PATH_DATA . 'sites/' . $workspace . '/' . '.server_info')) { @@ -1649,7 +1653,7 @@ class workspaceTools $pathDirectoryEnterprise = PATH_CORE . 'plugins' . PATH_SEP . 'enterprise'; $pathFileEnterprise = PATH_CORE . 'plugins' . PATH_SEP . 'enterprise.php'; - if (!file_exists($pathDirectoryEnterprise) && !file_exists(PATH_PLUGIN . 'enterprise.php')) { + if (!file_exists($pathDirectoryEnterprise) && !file_exists($pathFileEnterprise)) { CLI::logging(" Without changes... \n"); return true; } diff --git a/workflow/engine/classes/model/CaseScheduler.php b/workflow/engine/classes/model/CaseScheduler.php index fb86245ff..e4259cd01 100755 --- a/workflow/engine/classes/model/CaseScheduler.php +++ b/workflow/engine/classes/model/CaseScheduler.php @@ -338,7 +338,7 @@ class CaseScheduler extends BaseCaseScheduler $processId = $aRow["PRO_UID"]; $taskId = $aRow["TAS_UID"]; $client = new SoapClient( $defaultEndpoint ); - $params = array ('userid' => $user,'password' => 'md5:' . $pass); + $params = array ('userid' => $user,'password' => Bootstrap::getPasswordHashType() . ':' . $pass); $result = $client->__SoapCall( 'login', array ($params) ); eprint( " - Logging as user $user............." ); if ($result->status_code == 0) { @@ -500,7 +500,7 @@ class CaseScheduler extends BaseCaseScheduler $processId = $aRow["PRO_UID"]; $taskId = $aRow["TAS_UID"]; $client = new SoapClient( $defaultEndpoint ); - $params = array ('userid' => $user,'password' => 'md5:' . $pass); + $params = array ('userid' => $user,'password' => Bootstrap::getPasswordHashType() . ':' . $pass); $result = $client->__SoapCall( 'login', array ($params) ); eprint( " - Logging as user $user............." ); if ($result->status_code == 0) { diff --git a/workflow/engine/classes/model/Process.php b/workflow/engine/classes/model/Process.php index fd33bfebd..d9a0422ab 100755 --- a/workflow/engine/classes/model/Process.php +++ b/workflow/engine/classes/model/Process.php @@ -601,7 +601,7 @@ class Process extends BaseProcess } } - public function getAllProcesses ($start, $limit, $category = null, $processName = null, $counters = true, $reviewSubProcess = false) + public function getAllProcesses ($start, $limit, $category = null, $processName = null, $counters = true, $reviewSubProcess = false, $userLogged = "") { require_once PATH_RBAC . "model/RbacUsers.php"; require_once "classes/model/ProcessCategory.php"; @@ -642,10 +642,13 @@ class Process extends BaseProcess $oCriteria->addJoin( ProcessPeer::PRO_CREATE_USER, UsersPeer::USR_UID, Criteria::LEFT_JOIN ); $oCriteria->addJoin( ProcessPeer::PRO_CATEGORY, ProcessCategoryPeer::CATEGORY_UID, Criteria::LEFT_JOIN ); - $oCriteria->add( + + if ($userLogged != "") { + $oCriteria->add( $oCriteria->getNewCriterion(ProcessPeer::PRO_TYPE_PROCESS, "PUBLIC", Criteria::EQUAL)->addOr( - $oCriteria->getNewCriterion(ProcessPeer::PRO_CREATE_USER, $_SESSION["USER_LOGGED"], Criteria::EQUAL)) - ); + $oCriteria->getNewCriterion(ProcessPeer::PRO_CREATE_USER, $userLogged, Criteria::EQUAL)) + ); + } $this->tmpCriteria = clone $oCriteria; diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index ea28e82c0..3ec91b108 100755 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -3245,7 +3245,7 @@ - + @@ -3274,10 +3274,10 @@ - + - + @@ -3331,13 +3331,13 @@ - + - + - + @@ -3367,13 +3367,13 @@ - + - + - + @@ -3398,10 +3398,10 @@ - + - + @@ -3438,13 +3438,13 @@ - + - + - + @@ -3480,13 +3480,13 @@ - + - + - + @@ -3533,13 +3533,13 @@ - + - + - + @@ -3581,13 +3581,13 @@ - + - + - + @@ -3622,13 +3622,13 @@ - + - + - + @@ -3659,13 +3659,13 @@ - + - + - + @@ -3695,13 +3695,13 @@ - + - + - + @@ -3731,10 +3731,10 @@ - + - + @@ -3760,10 +3760,10 @@ - + - + @@ -3789,10 +3789,10 @@ - + - + @@ -3818,7 +3818,7 @@ - + @@ -3847,7 +3847,7 @@
- + diff --git a/workflow/engine/controllers/main.php b/workflow/engine/controllers/main.php index 4d0dc52d4..295e11bd1 100644 --- a/workflow/engine/controllers/main.php +++ b/workflow/engine/controllers/main.php @@ -379,7 +379,7 @@ class Main extends Controller $newPass = G::generate_password(); $aData['USR_UID'] = $userData['USR_UID']; - $aData['USR_PASSWORD'] = Bootstrap::hasPassword( $newPass ); + $aData['USR_PASSWORD'] = Bootstrap::hashPassword( $newPass ); $rbacUser->update( $aData ); $user->update( $aData ); diff --git a/workflow/engine/controllers/webEntryProxy.php b/workflow/engine/controllers/webEntryProxy.php index 28acafe36..6601dcda1 100755 --- a/workflow/engine/controllers/webEntryProxy.php +++ b/workflow/engine/controllers/webEntryProxy.php @@ -185,7 +185,7 @@ class webEntryProxy extends HttpProxyController $template->assign( 'dynaformUid', $sDYNAFORM ); $template->assign( 'taskUid', $sTASKS ); $template->assign( 'wsUser', $sWS_USER ); - $template->assign( 'wsPass', 'md5:' . md5( $sWS_PASS ) ); + $template->assign( 'wsPass', Bootstrap::hashPassword($sWS_PASS, '', true) ); $template->assign( 'wsRoundRobin', $sWS_ROUNDROBIN ); if ($sWE_USR == "2") { diff --git a/workflow/engine/methods/enterprise/enterprise.php b/workflow/engine/methods/enterprise/enterprise.php index dcbce73c6..d8a122412 100644 --- a/workflow/engine/methods/enterprise/enterprise.php +++ b/workflow/engine/methods/enterprise/enterprise.php @@ -346,25 +346,6 @@ class enterprisePlugin extends PMPlugin fclose($file); } } - - public function hashPassword ($pass, $previous=false) - { - G::LoadClass( "configuration" ); - $config= new Configurations(); - $typeEncrypt = $config->getConfiguration('ENTERPRISE_SETTING_ENCRYPT', ''); - $encrypt = 'md5'; - if ($typeEncrypt != null) { - if (isset($typeEncrypt['current']) && $typeEncrypt['current'] != '') { - $encrypt = $typeEncrypt['current']; - } - if ($previous && isset($typeEncrypt['previous']) && $typeEncrypt['previous'] != '' ) { - $encrypt = $typeEncrypt['previous']; - } - } - eval("\$var = hash('" . $encrypt . "', '" . $pass . "');"); - - return $var; - } } $oPluginRegistry = &PMPluginRegistry::getSingleton(); diff --git a/workflow/engine/methods/login/authentication.php b/workflow/engine/methods/login/authentication.php index 2403d4d0e..6c0d191eb 100755 --- a/workflow/engine/methods/login/authentication.php +++ b/workflow/engine/methods/login/authentication.php @@ -131,7 +131,7 @@ try { } //Log failed authentications $message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . SYS_SYS; - $message .= " | BROWSER: " . $_SERVER['HTTP_USER_AGENT'] ." | \n" ; + $message .= " | BROWSER: " . $_SERVER['HTTP_USER_AGENT']; G::log($message, PATH_DATA, 'loginFailed.log'); } diff --git a/workflow/engine/methods/login/changePassword.php b/workflow/engine/methods/login/changePassword.php index 20bdaf3a4..8eec6306c 100755 --- a/workflow/engine/methods/login/changePassword.php +++ b/workflow/engine/methods/login/changePassword.php @@ -5,7 +5,7 @@ $aUser = $oUser->load($_SESSION['USER_LOGGED']); global $RBAC; $aData['USR_UID'] = $aUser['USR_UID']; $aData['USR_USERNAME'] = $aUser['USR_USERNAME']; -$aData['USR_PASSWORD'] = Bootstrap::hasPassword($_POST['form']['USR_PASSWORD']); +$aData['USR_PASSWORD'] = Bootstrap::hashPassword($_POST['form']['USR_PASSWORD']); $aData['USR_FIRSTNAME'] = $aUser['USR_FIRSTNAME']; $aData['USR_LASTNAME'] = $aUser['USR_LASTNAME']; $aData['USR_EMAIL'] = $aUser['USR_EMAIL']; diff --git a/workflow/engine/methods/login/retrivePassword.php b/workflow/engine/methods/login/retrivePassword.php index 426f2ac05..f5d5dd739 100755 --- a/workflow/engine/methods/login/retrivePassword.php +++ b/workflow/engine/methods/login/retrivePassword.php @@ -22,7 +22,7 @@ if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL' $newPass = G::generate_password(); $aData['USR_UID'] = $userData['USR_UID']; - $aData['USR_PASSWORD'] = Bootstrap::hasPassword($newPass); + $aData['USR_PASSWORD'] = Bootstrap::hashPassword($newPass); /* **Save after sending the mail $rbacUser->update($aData); $user->update($aData); diff --git a/workflow/engine/methods/processes/processesList.php b/workflow/engine/methods/processes/processesList.php index c80131f6b..f677292ed 100755 --- a/workflow/engine/methods/processes/processesList.php +++ b/workflow/engine/methods/processes/processesList.php @@ -64,7 +64,7 @@ if (isset( $_POST['category'] ) && $_POST['category'] !== '') { $memkeyTotal = $memkey . '-total'; $memcacheUsed = 'yes'; if (($proData = $memcache->get( $memkey )) === false || ($totalCount = $memcache->get( $memkeyTotal )) === false) { - $proData = $oProcess->getAllProcesses( $start, $limit); + $proData = $oProcess->getAllProcesses( $start, $limit, null, null, true, false, $_SESSION["USER_LOGGED"]); $totalCount = count($proData); $proData = array_splice($proData, $start, $limit); $memcache->set( $memkey, $proData, PMmemcached::ONE_HOUR ); diff --git a/workflow/engine/methods/processes/processes_webEntryGenerate.php b/workflow/engine/methods/processes/processes_webEntryGenerate.php index c3277b202..a46b97dfb 100755 --- a/workflow/engine/methods/processes/processes_webEntryGenerate.php +++ b/workflow/engine/methods/processes/processes_webEntryGenerate.php @@ -71,7 +71,7 @@ try { $template->assign( 'dynaformUid', $sDYNAFORM ); $template->assign( 'taskUid', $sTASKS ); $template->assign( 'wsUser', $sWS_USER ); - $template->assign( 'wsPass', 'md5:' . md5( $sWS_PASS ) ); + $template->assign( 'wsPass', Bootstrap::hashPassword($sWS_PASS, '', true) ); $template->assign( 'wsRoundRobin', $sWS_ROUNDROBIN ); if ($sWE_USR == "2") { diff --git a/workflow/engine/methods/users/myInfo_Save.php b/workflow/engine/methods/users/myInfo_Save.php index 48ba3943c..df3143bb4 100755 --- a/workflow/engine/methods/users/myInfo_Save.php +++ b/workflow/engine/methods/users/myInfo_Save.php @@ -50,7 +50,7 @@ try { $_POST['form']['USR_NEW_PASS'] = ''; } if ($_POST['form']['USR_NEW_PASS'] != '') { - $_POST['form']['USR_PASSWORD'] = Bootstrap::hasPassword( $_POST['form']['USR_NEW_PASS'] ); + $_POST['form']['USR_PASSWORD'] = Bootstrap::hashPassword( $_POST['form']['USR_NEW_PASS'] ); } if (! isset( $_POST['form']['USR_CITY'] )) { $_POST['form']['USR_CITY'] = ''; diff --git a/workflow/engine/methods/users/usersAjax.php b/workflow/engine/methods/users/usersAjax.php index 537582898..1f7220c82 100755 --- a/workflow/engine/methods/users/usersAjax.php +++ b/workflow/engine/methods/users/usersAjax.php @@ -130,7 +130,7 @@ switch ($_POST['action']) { $form['USR_NEW_PASS'] = ''; } if ($form['USR_NEW_PASS'] != '') { - $form['USR_PASSWORD'] = Bootstrap::hasPassword($form['USR_NEW_PASS']); + $form['USR_PASSWORD'] = Bootstrap::hashPassword($form['USR_NEW_PASS']); } if (!isset($form['USR_CITY'])) { $form['USR_CITY'] = ''; @@ -214,7 +214,7 @@ switch ($_POST['action']) { */ require_once 'classes/model/UsersProperties.php'; $oUserProperty = new UsersProperties(); - $aUserProperty = $oUserProperty->loadOrCreateIfNotExists($aData['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(Bootstrap::hasPassword($aData['USR_PASSWORD']))))); + $aUserProperty = $oUserProperty->loadOrCreateIfNotExists($aData['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(Bootstrap::hashPassword($aData['USR_PASSWORD']))))); $aUserProperty['USR_LOGGED_NEXT_TIME'] = $form['USR_LOGGED_NEXT_TIME']; $oUserProperty->update($aUserProperty); } else { @@ -228,7 +228,7 @@ switch ($_POST['action']) { $aData['USR_PASSWORD'] = $form['USR_PASSWORD']; require_once 'classes/model/UsersProperties.php'; $oUserProperty = new UsersProperties(); - $aUserProperty = $oUserProperty->loadOrCreateIfNotExists($form['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($form['USR_PASSWORD']))))); + $aUserProperty = $oUserProperty->loadOrCreateIfNotExists($form['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(Bootstrap::hashPassword($form['USR_PASSWORD']))))); $memKey = 'rbacSession' . session_id(); $memcache = & PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : '' ); diff --git a/workflow/engine/methods/users/users_Save.php b/workflow/engine/methods/users/users_Save.php index f816337c6..9ab2ae2ce 100755 --- a/workflow/engine/methods/users/users_Save.php +++ b/workflow/engine/methods/users/users_Save.php @@ -63,7 +63,7 @@ try { $form['USR_NEW_PASS'] = ''; } if ($form['USR_NEW_PASS'] != '') { - $form['USR_PASSWORD'] = Bootstrap::hasPassword( $form['USR_NEW_PASS'] ); + $form['USR_PASSWORD'] = Bootstrap::hashPassword( $form['USR_NEW_PASS'] ); } if (! isset( $form['USR_CITY'] )) { $form['USR_CITY'] = ''; diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Calendar.php b/workflow/engine/src/ProcessMaker/BusinessModel/Calendar.php index 5e97b8c98..83ff11b05 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Calendar.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Calendar.php @@ -650,20 +650,6 @@ class Calendar ); } - //Number records total - $criteriaCount = clone $criteria; - - $criteriaCount->clearSelectColumns(); - $criteriaCount->addSelectColumn("COUNT(" . \CalendarDefinitionPeer::CALENDAR_UID . ") AS NUM_REC"); - - $rsCriteriaCount = \CalendarDefinitionPeer::doSelectRS($criteriaCount); - $rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - - $rsCriteriaCount->next(); - $row = $rsCriteriaCount->getRow(); - - $numRecTotal = $row["NUM_REC"]; - //SQL if (!is_null($sortField) && trim($sortField) != "") { $sortField = strtoupper($sortField); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Group.php b/workflow/engine/src/ProcessMaker/BusinessModel/Group.php index be8ed2978..d58127b0c 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Group.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Group.php @@ -480,20 +480,6 @@ class Group $criteria->add(\ContentPeer::CON_VALUE, "%" . $arrayFilterData["filter"] . "%", \Criteria::LIKE); } - //Number records total - $criteriaCount = clone $criteria; - - $criteriaCount->clearSelectColumns(); - $criteriaCount->addAsColumn("NUM_REC", "COUNT(" . \GroupwfPeer::GRP_UID . ")"); - - $rsCriteriaCount = \GroupwfPeer::doSelectRS($criteriaCount); - $rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - - $rsCriteriaCount->next(); - $row = $rsCriteriaCount->getRow(); - - $numRecTotal = (int)($row["NUM_REC"]); - //SQL if (!is_null($sortField) && trim($sortField) != "") { $sortField = strtoupper($sortField); @@ -704,20 +690,6 @@ class Group break; } - //Number records total - $criteriaCount = clone $criteria; - - $criteriaCount->clearSelectColumns(); - $criteriaCount->addAsColumn("NUM_REC", "COUNT(" . \UsersPeer::USR_UID . ")"); - - $rsCriteriaCount = \UsersPeer::doSelectRS($criteriaCount); - $rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - - $rsCriteriaCount->next(); - $row = $rsCriteriaCount->getRow(); - - $numRecTotal = (int)($row["NUM_REC"]); - //SQL if (!is_null($sortField) && trim($sortField) != "") { $sortField = strtoupper($sortField); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/ProcessCategory.php b/workflow/engine/src/ProcessMaker/BusinessModel/ProcessCategory.php index fafc1aa3b..b939a56d5 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/ProcessCategory.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/ProcessCategory.php @@ -396,20 +396,6 @@ class ProcessCategory $criteria->add(\ProcessCategoryPeer::CATEGORY_NAME, "%" . $arrayFilterData["filter"] . "%", \Criteria::LIKE); } - //Number records total - $criteriaCount = clone $criteria; - - $criteriaCount->clearSelectColumns(); - $criteriaCount->addAsColumn("NUM_REC", "COUNT(" . \ProcessCategoryPeer::CATEGORY_UID . ")"); - - $rsCriteriaCount = \ProcessCategoryPeer::doSelectRS($criteriaCount); - $rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - - $rsCriteriaCount->next(); - $row = $rsCriteriaCount->getRow(); - - $numRecTotal = (int)($row["NUM_REC"]); - //SQL if (!is_null($sortField) && trim($sortField) != "") { $sortField = strtoupper($sortField); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/ProjectUser.php b/workflow/engine/src/ProcessMaker/BusinessModel/ProjectUser.php index 7f7ab9fa0..a1f9f591b 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/ProjectUser.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/ProjectUser.php @@ -336,7 +336,7 @@ class ProjectUser $params = array( "userid" => $username, - "password" => "md5:" . md5($password) + "password" => Bootstrap::hashPassword($password, '', true) ); $response = $client->login($params); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Role.php b/workflow/engine/src/ProcessMaker/BusinessModel/Role.php index 302a8cf3a..46d391d34 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Role.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Role.php @@ -518,20 +518,6 @@ class Role $criteria->add(\RolesPeer::ROL_CODE, "%" . $arrayFilterData["filter"] . "%", \Criteria::LIKE); } - //Number records total - $criteriaCount = clone $criteria; - - $criteriaCount->clearSelectColumns(); - $criteriaCount->addAsColumn("NUM_REC", "COUNT(" . \RolesPeer::ROL_UID . ")"); - - $rsCriteriaCount = \RolesPeer::doSelectRS($criteriaCount); - $rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - - $rsCriteriaCount->next(); - $row = $rsCriteriaCount->getRow(); - - $numRecTotal = (int)($row["NUM_REC"]); - //SQL if (!is_null($sortField) && trim($sortField) != "") { $sortField = strtoupper($sortField); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Role/Permission.php b/workflow/engine/src/ProcessMaker/BusinessModel/Role/Permission.php index 4f2d10c18..d6d846a25 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Role/Permission.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Role/Permission.php @@ -341,20 +341,6 @@ class Permission $criteria->add(\PermissionsPeer::PER_CODE, "%" . $arrayFilterData["filter"] . "%", \Criteria::LIKE); } - //Number records total - $criteriaCount = clone $criteria; - - $criteriaCount->clearSelectColumns(); - $criteriaCount->addAsColumn("NUM_REC", "COUNT(" . \PermissionsPeer::PER_UID . ")"); - - $rsCriteriaCount = \PermissionsPeer::doSelectRS($criteriaCount); - $rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - - $rsCriteriaCount->next(); - $row = $rsCriteriaCount->getRow(); - - $numRecTotal = $row["NUM_REC"]; - //SQL if (!is_null($sortField) && trim($sortField) != "") { $sortField = strtoupper($sortField); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Role/User.php b/workflow/engine/src/ProcessMaker/BusinessModel/Role/User.php index f45d9e2d8..0cf9e2040 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Role/User.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Role/User.php @@ -353,20 +353,6 @@ class User ); } - //Number records total - $criteriaCount = clone $criteria; - - $criteriaCount->clearSelectColumns(); - $criteriaCount->addAsColumn("NUM_REC", "COUNT(" . \RbacUsersPeer::USR_UID . ")"); - - $rsCriteriaCount = \RbacUsersPeer::doSelectRS($criteriaCount); - $rsCriteriaCount->setFetchmode(\ResultSet::FETCHMODE_ASSOC); - - $rsCriteriaCount->next(); - $row = $rsCriteriaCount->getRow(); - - $numRecTotal = $row["NUM_REC"]; - //SQL if (!is_null($sortField) && trim($sortField) != "") { $sortField = strtoupper($sortField); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php index fdff6acf0..ba972ce26 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntry.php @@ -396,7 +396,7 @@ class WebEntry $template->assign("dynaformUid", $dynaFormUid); $template->assign("taskUid", $taskUid); $template->assign("wsUser", $usrUsername); - $template->assign("wsPass", "md5:" . $usrPassword); + $template->assign("wsPass", Bootstrap::getPasswordHashType() . ':' . $usrPassword); $template->assign("wsRoundRobin", $wsRoundRobin); if ($webEntryInputDocumentAccess == 0) {