| | |
| | | ///////////////////////////////////////////////////////////////////////// |
| | | |
| | | module.exports = { |
| | | getUser, |
| | | |
| | | importIliasUser, |
| | | |
| | | |
| | | deleteUser, |
| | | deleteAllUsers, |
| | |
| | | |
| | | ///////////////////////////////////////////////////////////////////////// |
| | | |
| | | /////// GET USER //////////////////////////////////////////////////////////////// |
| | | async function getUser (usr_id) { |
| | | const sp = new URLSearchParams({ |
| | | command: "getUser", |
| | | usr_id, |
| | | token: iliastoken, |
| | | }) |
| | | let url2 = `${url}?${sp.toString()}` |
| | | const res = await fetch(url2, {method: "GET"}) |
| | | return await res.json() // |
| | | } |
| | | |
| | | /////// USER IMPORT //////////////////////////////////////////////////////////////// |
| | | |
| | | /** |
| | | * Format in POPCORN für SOAP; ausprobieren ob das hier auch funktioniert, v.a. die user-defined-fields |
| | | * { |
| | | * Action: "Insert", |
| | | * login: formatSapNr(dbMa.sapNr), |
| | | * password: passGen(12), |
| | | * firstname: dbMa.vorname, |
| | | * lastname: dbMa.nachname, |
| | | * email: email, |
| | | * gender: mapSex[dbMa.geschlecht], |
| | | * // GS-1894: Azubis wird der Ausbildungsberuf auch als Abteilung angezeigt |
| | | * department: getDepartment(dbMa), |
| | | * institution: dbMa.markt.markt, |
| | | * roleIdGlobal: 4, |
| | | * userDefinedField: [ |
| | | * { |
| | | * name: "Markt", |
| | | * value: dbMa.markt.markt, |
| | | * }, |
| | | * { |
| | | * name: "Marktnummer", |
| | | * value: dbMa.markt.nr, |
| | | * }, |
| | | * { |
| | | * name: "Personalnummer", |
| | | * value: formatSapNr(dbMa.sapNr), |
| | | * }, |
| | | * ], |
| | | * } |
| | | * const user = { |
| | | * login: "123456789", |
| | | * passwd: "123456789", |
| | | * passwd_type: "plain", |
| | | * firstname: "Adolfo", |
| | | * lastname: "de la Cruz", |
| | | * email: "alex@gorillaeis.com", |
| | | * gender: "m", |
| | | * department: "Bananenpflücker", |
| | | * institution: "Globus Budapest", |
| | | * role: 4, // assigned global role id |
| | | * udf: { |
| | | * "Markt": "Markt UDF 2", |
| | | * "Marktnummer": "Marktnummer UDF 2", |
| | | * "Personalnummer": "Personal UDF 2", |
| | | * }, |
| | | * } |
| | | * @param user |
| | | * @returns {Promise<any>} |
| | | */ |