Added support for a different unique field of Member to be used in developer config

This commit is contained in:
Stephan Bauer 2016-02-10 00:04:12 +01:00
parent a050d926de
commit 59ca054ba6

View File

@ -54,7 +54,8 @@ class BetterNavigator extends DataExtension {
// Is the logged in member nominated as a developer?
$member = Member::currentUser();
$devs = Config::inst()->get('BetterNavigator', 'developers');
$isDeveloper = $member && is_array($devs) ? in_array($member->Email, $devs) : false;
$identifierField = Member::config()->unique_identifier_field;
$isDeveloper = $member && is_array($devs) ? in_array($member->{$identifierField}, $devs) : false;
// Add other data for template
$backURL = '?BackURL=' . urlencode($this->owner->Link());