Skip to content
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

Added ability to sepcifiy different values for ldap 'host' and 'name' #46

Merged
merged 1 commit into from
Sep 4, 2018
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,16 @@ See how to [set your own environment variables](#set-your-own-environment-variab

To convert yaml to python online: http://yaml-online-parser.appspot.com/

If you would like to skip the display name == hostname element of the above use the **PHPLDAPADMIN_LDAP_HOSTS_FRIENDLY** environmental variable. This then uses the top most name as the display name of the server. You will then need to add host to the yaml within the server section. Note this is a global setting, if you do it for one server, you must do it for all. eg
```yaml
- Primary:
- server:
- host: ldap-master.example.org
- Backup:
- server:
- host: 192.168.0.100
```

Apache :
- **PHPLDAPADMIN_SERVER_ADMIN**: Server admin email. Defaults to `webmaster@example.org`
- **PHPLDAPADMIN_SERVER_PATH**: Server path (usefull if behind a reverse proxy). Defaults to `/phpldapadmin`
Expand Down
4 changes: 3 additions & 1 deletion image/service/phpldapadmin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ if [ ! -e "/var/www/phpldapadmin/config/config.php" ]; then
hostname=$(complex-bash-env getRowKey "${!host}")
info=$(complex-bash-env getRowValueVarName "${!host}")

if [ "${PHPLDAPADMIN_LDAP_HOSTS_FRIENDLY,,}" != "true" ]; then
append_to_file "\$servers->setValue('server','host','$hostname');"
fi
append_to_file "\$servers->setValue('server','name','$hostname');"
append_to_file "\$servers->setValue('server','host','$hostname');"
host_info "" "$info"

else
Expand Down