8000 OHRM5X-1328: Allow empty passwords in installer by RajithaKumara · Pull Request #1268 · orangehrm/orangehrm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

OHRM5X-1328: Allow empty passwords in installer #1268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
docker exec os_dev_php80 bash -c "sed -i 's/adminPassword: Ohrm@1423/adminPassword: Admin@123/g' installer/cli_install_config.yaml"
docker exec os_dev_php80 bash -c "sed -i 's/adminEmployeeFirstName: OrangeHRM/adminEmployeeFirstName: Samantha/g' installer/cli_install_config.yaml"
docker exec os_dev_php80 bash -c "sed -i 's/adminEmployeeLastName: Admin/adminEmployeeLastName: Jayasinghe/g' installer/cli_install_config.yaml"
docker exec os_dev_php80 bash -c "sed -i 's/public const PRODUCT_MODE = self::MODE_PROD/public const PRODUCT_MODE = self::MODE_DEV/g' src/lib/config/Config.php"
docker exec os_dev_php80 bash -c 'chmod -R 777 src/log'
docker exec os_dev_php80 bash -c 'chmod -R 777 src/config'
docker exec os_dev_php80 bash -c 'php installer/cli_install.php'
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.TXT
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
New & Changed Features for OrangeHRM ver 5.0
New Feature
-----------
- Supports Admin, PIM, Leave, Time, Attendance and Maintenance modules.
- Technology stack upgrade (Symfony 5.x, Doctrine 2.x, Vue 3, REST APIs & SaaS)
- New UI/UX in compliance with the Orange e 8000 Xperience Design (OXD) Standards
- PHP 7.4 to 8.1 Support.
- Convenient web installer and upgrader to get started seamlessly
- Supported Environments
- PHP - 7.4 to 8.1
- MariaDB - 5.5 to 10.7
- MySQL - 5.5 to 5.7

Known Issues
------------
Following modules and add-ons are not supported in OrangeHRM Starter version 5.0

Modules
- Recruitment
- Performance
- Buzz
- Directory

Add-Ons
- LDAP
- Claim add-on
- Toggl add-on

Other features
- Corporate Branding
- Dashboard
- Marketplace
- Custom Language Packages
- Custom Date localizations (except YYYY-MM-DD)
- OrangeHRM Starter mobile app
- Social media authentication

New & Changed Features for OrangeHRM ver 5.0-beta
New Feature
-----------
Expand Down
4 changes: 3 additions & 1 deletion installer/Controller/Installer/Api/ConfigFileAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ protected function handlePost(Request $request): array
if (StateContainer::getInstance()->isSetDbInfo()) {
$dbInfo = StateContainer::getInstance()->getDbInfo();
$dbUser = $dbInfo[StateContainer::ORANGEHRM_DB_USER] ?? $dbInfo[StateContainer::DB_USER];
$dbPassword = $dbInfo[StateContainer::ORANGEHRM_DB_PASSWORD] ?? $dbInfo[StateContainer::DB_PASSWORD];
$dbPassword = isset($dbInfo[StateContainer::ORANGEHRM_DB_USER])
? $dbInfo[StateContainer::ORANGEHRM_DB_PASSWORD]
: $dbInfo[StateContainer::DB_PASSWORD];
StateContainer::getInstance()->storeDbInfo(
$dbInfo[StateContainer::DB_HOST],
$dbInfo[StateContainer::DB_PORT],
Expand Down
2 changes: 1 addition & 1 deletion installer/Controller/Installer/Api/DatabaseConfigAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected function handlePost(Request $request): array
'dbUser' => $dbUser,
'dbName' => $dbName,
'useSameDbUserForOrangeHRM' => $useSameDbUserForOrangeHRM,
'ohrmDbUser' => $ohrmDbUser,
'ohrmDbUser' => $useSameDbUserForOrangeHRM ? null : ($dbInfo[StateContainer::ORANGEHRM_DB_USER] ?? null),
],
'meta' => []
];
Expand Down
7 changes: 3 additions & 4 deletions installer/Util/AppSetupUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use OrangeHRM\Installer\Migration\V3_3_3\Migration;
use OrangeHRM\Installer\Util\SystemConfig\SystemConfiguration;
use OrangeHRM\Installer\Util\V1\AbstractMigration;
use Symfony\Component\Filesystem\Filesystem;

class AppSetupUtility
{
Expand Down Expand Up @@ -443,10 +444,8 @@ public function writeConfFile(): void
$dbInfo[StateContainer::DB_PASSWORD]
];

file_put_contents(
Config::get(Config::CONF_FILE_PATH),
str_replace($search, $replace, $template)
);
$fs = new Filesystem();
$fs->dumpFile(Config::get(Config::CONF_FILE_PATH), str_replace($search, $replace, $template));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions installer/Util/StateContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ public function storeDbInfo(
$this->clearDbInfo();
$this->getSession()->set(self::DB_NAME, $dbName);
$this->getSession()->set(self::DB_USER, $dbUserCredential->getUsername());
$this->getSession()->set(self::DB_PASSWORD, $dbUserCredential->getPassword());
$this->getSession()->set(self::DB_PASSWORD, $dbUserCredential->getPassword() ?? '');
$this->getSession()->set(self::DB_HOST, $dbHost);
$this->getSession()->set(self::DB_PORT, $dbPort);
if ($ohrmDbUserCredential instanceof UserCredential) {
$this->getSession()->set(self::ORANGEHRM_DB_USER, $ohrmDbUserCredential->getUsername());
$this->getSession()->set(self::ORANGEHRM_DB_PASSWORD, $ohrmDbUserCredential->getPassword());
$this->getSession()->set(self::ORANGEHRM_DB_PASSWORD, $ohrmDbUserCredential->getPassword() ?? '');
}
$this->getSession()->set(self::IS_SET_DB_INFO, true);
}
Expand Down
2 changes: 1 addition & 1 deletion installer/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "vue-cli-service lint --max-warnings=0 --mode production"
},
"dependencies": {
"@ohrm/oxd": "1.0.5-alpha.8",
"@ohrm/oxd": "1.0.5",
"axios": "^0.26.1",
"core-js": "^3.8.3",
"vue": "^3.2.13"
Expand Down
8 changes: 4 additions & 4 deletions installer/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1040,10 +1040,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@ohrm/oxd@1.0.5-alpha.8":
version "1.0.5-alpha.8"
resolved "https://registry.yarnpkg.com/@ohrm/oxd/-/oxd-1.0.5-alpha.8.tgz#4c129ffef9733e4031cf5e8c7e5350c59d41b1b0"
integrity sha512-oaiMC2FglKQSg4avfSePfxMNH4HZOkSc/cXQsVqBsWV2X+zvsL1XdZhBIFHtgA+eByB8iT04yGiyrX3HRA6Lng==
"@ohrm/oxd@1.0.5":
version "1.0.5"
resolved "https://registry.yarnpkg.com/@ohrm/oxd/-/oxd-1.0.5.tgz#20d39e49d72c4ad2be19618b7a53beee0c7280fc"
integrity sha512-SWnkNI+aH3yI/KziGD/bgHvoJUbS17EpLOXqf1svG9s2WbETYKp5iwqcQXYBUIR2Iuwk1oMKxcRw5xTCoAlRVg==
dependencies:
"@revolist/vue3-datagrid" "^3.0.96"
bootstrap-icons "^1.3.0"
Expand Down
2 changes: 1 addition & 1 deletion src/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "vue-cli-service lint --max-warnings=0 --mode production"
},
"dependencies": {
"@ohrm/oxd": "1.0.5-alpha.8",
"@ohrm/oxd": "1.0.5",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"date-fns": "^2.22.1",
Expand Down
10 changes: 5 additions & 5 deletions src/client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1596,9 +1596,9 @@ __metadata:
languageName: node
linkType: hard

"@ohrm/oxd@npm:1.0.5-alpha.8":
version: 1.0.5-alpha.8
resolution: "@ohrm/oxd@npm:1.0.5-alpha.8"
"@ohrm/oxd@npm:1.0.5":
version: 1.0.5
resolution: "@ohrm/oxd@npm:1.0.5"
dependencies:
"@revolist/vue3-datagrid": ^3.0.96
bootstrap-icons: ^1.3.0
Expand All @@ -1607,7 +1607,7 @@ __metadata:
mitt: ^2.1.0
nanoid: ^3.2.0
vue: ^3.2.2
checksum: cb8cf9e2e564c4e7351f742671d51c5b7cf5fcfe23a3115ed689ee1cf8b7c7a22c9e2e10525b1eabce59c1ca8c9b1d2b3fbf42498dff4b66bf6448e758594aee
checksum: 7cc82a2dc47606725826612fc4965da01db4c507a92187c901f22e782f2b27964c13df82448aea537cf6b33b1ba5f97041c5b95470bd2adb93d1a38a8bbe2d27
languageName: node
linkType: hard

Expand Down Expand Up @@ -10496,7 +10496,7 @@ fsevents@~2.3.2:
version: 0.0.0-use.local
resolution: "orangehrm@workspace:."
dependencies:
"@ohrm/oxd": 1.0.5-alpha.8
"@ohrm/oxd": 1.0.5
"@types/jest": ^24.0.19
"@typescript-eslint/eslint-plugin": ^2.33.0
"@typescript-eslint/parser": ^2.33.0
Expand Down
2 changes: 1 addition & 1 deletion src/lib/config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Config

public const PRODUCT_NAME = 'OrangeHRM OS';
public const PRODUCT_VERSION = '5.0';
public const PRODUCT_MODE = self::MODE_DEV;
public const PRODUCT_MODE = self::MODE_PROD;
public const REGISTRATION_URL = 'https://ospenguin.orangehrm.com';

public const MAX_SESSION_IDLE_TIME = 1800;
Expand Down
0