„LnxUser PHP Class Reference” változatai közötti eltérés
Innen: IT documentation
| (14 közbenső módosítás ugyanattól a szerkesztőtől nincs mutatva) | |||
| 2. sor: | 2. sor: | ||
Linux user and group management in PHP. | Linux user and group management in PHP. | ||
Basically this library a php interface of useradd, groupadd, usermod, groupmod, userdel, groupdel | Basically this library a php interface of useradd, groupadd, usermod, groupmod, userdel, groupdel linux commands. You can manage easily the linux users and groups with this library from a php apllication. | ||
== Requirements == | == Requirements == | ||
| 9. sor: | 9. sor: | ||
* The running user of php environment must has '''root privileges''' for manage the users and groups. | * The running user of php environment must has '''root privileges''' for manage the users and groups. | ||
* Must enable the '''shell_exec''' function. | * Must enable the '''shell_exec''' function. | ||
* Tested on Ubuntu with '''PHP 7.0 - 8.1''' versions. | * Tested on Ubuntu with '''PHP 7.0 - 8.1''' versions. | ||
| 29. sor: | 28. sor: | ||
!Note | !Note | ||
|- | |- | ||
| | |DES | ||
|''' | |'''LNX_PH_DES''' (string) | ||
| | |Standard Data Encryption Standard based hash | ||
| | | | ||
|- | |- | ||
| | |BCRYPT_A | ||
|'''LNX_PH_BLOWFISH_A''' (string) | |||
|Blowfish block cipher based hash | |||
| | |||
|- | |||
|BCRYPT_B | |||
|'''LNX_PH_BLOWFISH_B''' (string) | |||
|Blowfish block cipher based hash | |||
| | |||
|- | |||
|BCRYPT_X | |||
|'''LNX_PH_BLOWFISH_X''' (string) | |||
|Blowfish block cipher based hash | |||
| | |||
|- | |||
|BCRYPT_Y | |||
|'''LNX_PH_BLOWFISH_Y''' (string) | |||
|Blowfish block cipher based hash | |||
| | |||
|- | |||
|SHA256 | |||
|'''LNX_PH_SHA256''' (string) | |'''LNX_PH_SHA256''' (string) | ||
| | |Secure Hash Algorithm 256 based hash | ||
| | | | ||
|- | |- | ||
| | |SHA512 | ||
|'''LNX_PH_SHA512''' (string) | |'''LNX_PH_SHA512''' (string) | ||
| | |Secure Hash Algorithm 512 based hash | ||
|} | |} | ||
| 59. sor: | 78. sor: | ||
* [[lnxUser::isMember]] | * [[lnxUser::isMember]] | ||
* [[lnxUser::getPassHash]] | * [[lnxUser::getPassHash]] | ||
* [[lnxUser::setDefaultPasswordHash]] | |||
* [[lnxUser::getDefaultPasswordHash]] | |||
* [[lnxUser::getDefaultPasswordSalt]] | |||
* [[lnxUser::getDefaultPasswordRound]] | |||
* [[lnxUser::chkHash]] | |||
* [[lnxUser::chkSalt]] | |||
* [[lnxUser::chkRound]] | |||
==Changelog== | |||
{| class="wikitable" | |||
!Version<br>(lnxUser) | |||
!Description | |||
|- | |||
|1.2 | |||
|add: DES, BLOWFISH password hash method handle<br>add: salt, round handle in password hash | |||
|- | |||
|1.1 | |||
|add: use systemlog at user auth<br>remove: mkpassword dependency<br>add: default hash handle | |||
|- | |||
|1.00 | |||
|available | |||
|} | |||
== Source == | |||
https://github.com/moszat/lnxUser | |||
[[Kategória:LnxUser]] | [[Kategória:LnxUser]] | ||
A lap jelenlegi, 2021. szeptember 24., 18:31-kori változata
Introduction
Linux user and group management in PHP.
Basically this library a php interface of useradd, groupadd, usermod, groupmod, userdel, groupdel linux commands. You can manage easily the linux users and groups with this library from a php apllication.
Requirements
- Of course this library can work just linux environment.
- The running user of php environment must has root privileges for manage the users and groups.
- Must enable the shell_exec function.
- Tested on Ubuntu with PHP 7.0 - 8.1 versions.
Features
- Create a linux user or a group.
- Get all information about a linux user or a group.
- Set all attributes of a linux user or a group.
- Delete a linux user or a group.
- Examine if exists a linux user or a group.
- Authenticate a linux user.
- Generate password hash.
Constants
| Value | Constant | Description | Note |
|---|---|---|---|
| DES | LNX_PH_DES (string) | Standard Data Encryption Standard based hash | |
| BCRYPT_A | LNX_PH_BLOWFISH_A (string) | Blowfish block cipher based hash | |
| BCRYPT_B | LNX_PH_BLOWFISH_B (string) | Blowfish block cipher based hash | |
| BCRYPT_X | LNX_PH_BLOWFISH_X (string) | Blowfish block cipher based hash | |
| BCRYPT_Y | LNX_PH_BLOWFISH_Y (string) | Blowfish block cipher based hash | |
| SHA256 | LNX_PH_SHA256 (string) | Secure Hash Algorithm 256 based hash | |
| SHA512 | LNX_PH_SHA512 (string) | Secure Hash Algorithm 512 based hash |
Methods
- lnxUser::existsUser
- lnxUser::existsGroup
- lnxUser::getUser
- lnxUser::getGroup
- lnxUser::addUser
- lnxUser::addGroup
- lnxUser::modifyUser
- lnxUser::modifyGroup
- lnxUser::deleteUser
- lnxUser::deleteGroup
- lnxUser::authUser
- lnxUser::isMember
- lnxUser::getPassHash
- lnxUser::setDefaultPasswordHash
- lnxUser::getDefaultPasswordHash
- lnxUser::getDefaultPasswordSalt
- lnxUser::getDefaultPasswordRound
- lnxUser::chkHash
- lnxUser::chkSalt
- lnxUser::chkRound
Changelog
| Version (lnxUser) |
Description |
|---|---|
| 1.2 | add: DES, BLOWFISH password hash method handle add: salt, round handle in password hash |
| 1.1 | add: use systemlog at user auth remove: mkpassword dependency add: default hash handle |
| 1.00 | available |