* Fix issue #1122 - Local user login fails with Multi/Single LDAP enabled
Code was not consistent with how it was generating the password hashes and comparing them. To fix this, added compat_password_xxx functions that check for the availability of the newer password_xxx functions and if not present revert back to the md5 version.
Changes made are:
auth_changepassword.php:
* Break out of switch when error message set
* Reduce duplication of code when checking passwords
* Use local variables rather than constantly pulling in request ones
* Use new compat_password_xxx functions
auth_login.php:
* Added some debug logging to identify login issues
* Allow local login even if using ldap
* Use new compat_password_xxx functions
* Remove password from SQL search as hash can change and we don't know what it would have been at the time it was set
user_admin.php
* Use new compat_password_xxx functions
lib\auth.php:
* Added compat_password_verify, compat_password_hash and compat_password_rehash to check for PHP 5.7+ compatible functions other use MD5
* Reduced SQL query to just required user in secpass_login_process()
* Fixed password check in secpass_check_history()
* Fixed return value check of secpass_check_pass() in secpass_login_process()
* Use new compat_password_xxx functions
* Update CHANGELOG
* Fixup for Issue #1122, corrects some minor issues
* Merge branch 'Issue-1122' of https://github.com/netniV/cacti into Issue-1122
Update log message to be warning notj ust a normal message
* Fix issue of local auth bypas
* Update CHANGELOG
Fix up CHANGELOG issues
* Update auth.php
Fix up formatting issues
This occurred due to the optimizations in pull request #1101. The
$sql_user must, in it's entirety, be enclosed in parenthesis.
Otherwise, expand host functionality breaks.
I've also added the site_id in this commit to reduce the effort in
attempting to maintain both the feature branch and the develop branch.
It's not used, but returned.
Cleanup includes some misqueues in the pull request as well as some
other miscelaneous changes associated with how we have landed on
formatting.
Chagne include:
* No soft tabs on initial tabbing
* ON clause of JOIN should be capitalized and on separate line
* AND/OR should be capitalized in SQL Queries
* Formatting of db_..() functions calls
* Use of sizeof() instead of isset() for array checks
* i18n of Secpass check return values
* Remove trailing whitespace from lines
- ToDo: Remove more having in place of WHERE clauses
auth.php:
- get_auth_realms() small refactor
- is_graph_allowed() unused variable $graph and unnecessary if-statement
- auth_check_perms() one count of $objects instead of multiple
- is_device_allowed()unused variable $host and unnecessary if-statement
- is_graph_template_allowed()unused variable $template and unnecessary if-statement
- is_view_allowed() unnecessary if-statement
html_tree.php:
- 2x query refactor for use of index reference instead use of function
- deleted unused select statement
html_utility.php:
- isset_request_var() unnecessary if-statement
Restricted user does not see graphs in tree view. Also caught some
issues in the Tree Permissions section of both user and User Group's,
and additional Tree permissions when reproducing the users environment.