Skip to content
Snippets Groups Projects
Commit df7a55da authored by bbrauns's avatar bbrauns
Browse files

refactor: spaces in string templates added

parent 666a4acf
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,7 @@ getDataToSyncUserData = function getDataToSyncUserData(ldapUser, user) { ...@@ -70,7 +70,7 @@ getDataToSyncUserData = function getDataToSyncUserData(ldapUser, user) {
switch (userField) { switch (userField) {
case 'email': case 'email':
if (!ldapUser.object.hasOwnProperty(ldapField)) { if (!ldapUser.object.hasOwnProperty(ldapField)) {
logger.debug(`user does not have attribute: ${ldapField}`); logger.debug(`user does not have attribute: ${ ldapField }`);
return; return;
} }
...@@ -90,7 +90,7 @@ getDataToSyncUserData = function getDataToSyncUserData(ldapUser, user) { ...@@ -90,7 +90,7 @@ getDataToSyncUserData = function getDataToSyncUserData(ldapUser, user) {
if (match == null) { if (match == null) {
if (!ldapUser.object.hasOwnProperty(ldapField)) { if (!ldapUser.object.hasOwnProperty(ldapField)) {
logger.debug(`user does not have attribute: ${ldapField}`); logger.debug(`user does not have attribute: ${ ldapField }`);
return; return;
} }
tmpLdapField = ldapUser.object[ldapField]; tmpLdapField = ldapUser.object[ldapField];
...@@ -101,12 +101,12 @@ getDataToSyncUserData = function getDataToSyncUserData(ldapUser, user) { ...@@ -101,12 +101,12 @@ getDataToSyncUserData = function getDataToSyncUserData(ldapUser, user) {
const tmplAttrName = match[1]; const tmplAttrName = match[1];
if (!ldapUser.object.hasOwnProperty(tmplAttrName)) { if (!ldapUser.object.hasOwnProperty(tmplAttrName)) {
logger.debug(`user does not have attribute: ${tmplAttrName}`); logger.debug(`user does not have attribute: ${ tmplAttrName }`);
return; return;
} }
const attrVal = ldapUser.object[tmplAttrName]; const attrVal = ldapUser.object[tmplAttrName];
logger.debug(`replacing template var: ${tmplVar} with value from ldap: ${attrVal}`); logger.debug(`replacing template var: ${ tmplVar } with value from ldap: ${ attrVal }`);
tmpLdapField = tmpLdapField.replace(tmplVar, attrVal); tmpLdapField = tmpLdapField.replace(tmplVar, attrVal);
match = templateRegex.exec(ldapField); match = templateRegex.exec(ldapField);
} }
...@@ -114,7 +114,7 @@ getDataToSyncUserData = function getDataToSyncUserData(ldapUser, user) { ...@@ -114,7 +114,7 @@ getDataToSyncUserData = function getDataToSyncUserData(ldapUser, user) {
if (user.name !== tmpLdapField) { if (user.name !== tmpLdapField) {
userData.name = tmpLdapField; userData.name = tmpLdapField;
logger.debug(`user.name changed to: ${tmpLdapField}`); logger.debug(`user.name changed to: ${ tmpLdapField }`);
} }
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment