"Cannot Access Protected Property" Error Thrown
Closed this issue · 2 comments
tohuw commented
Since activating the plugin, I get an error everywhere in the admin interface:
2017/09/30 12:51:55 [error] 6114#6114: *460 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Cannot access protected property YOURLS\Database\YDB::$option in /path/to/yourls/user/plugins/yourls-ldap-plugin/plugin.php:74
Stack trace:
#0 /path/to/yourls/includes/functions-plugins.php(150): ldapauth_is_valid_user(true)
#1 /path/to/yourls/includes/functions-auth.php(71): yourls_apply_filter('is_valid_user', true)
#2 /path/to/yourls/user/plugins/dont-track-admins/plugin.php(46): yourls_is_valid_user()
#3 /path/to/yourls/includes/functions-plugins.php(152): dgw_dont_track_admins_init(Array)
#4 /path/to/yourls/includes/functions-plugins.php(191): yourls_apply_filter('plugins_loaded', Array)
#5 /path/to/yourls/includes/load-yourls.php(191): yourls_do_action('plugins_loaded')
#6 /path/to/yourls/admin/index.php(3): require_once('/path/to/yourls...')
#7 {main}
thrown in /path/to/yourls/user/plugins/yourls-ldap-plugin/plugin.php on line 74" while reading response header from upstream, client: 162.158.79.71, server: tohuw.me, request: "GET /admin/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "my-yourls.tld"
Relevant section of config.php
:
define( 'LDAPAUTH_HOST', 'ldap://localhost' );
define( 'LDAPAUTH_PORT', '389' );
define( 'LDAPAUTH_BASE', 'ou=myou,dc=my-ldap,dc=tld' );
define( 'LDAPAUTH_USERNAME_FIELD', 'uid');
Any ideas?
chilledornaments commented
Getting the same error. Website throws a 500 error when trying to activate the plugin. Apache logs show the same error as above. No PHP error logs.
Nearly identical config.php settings. The only difference is my LDAP points to a domain controller on our corporate network.
k3a commented
It should be fixed in the current master branch. Can you please test and report back?
I don't use Yourls anymore so I can't easily test but those are minor changes.
(also sorry for responding so late, I wasn't getting Github notifications)