mng.SetUserAttributes

This job sets the properties of a user.

1. Input Parameters

Name Type Required Description

Flags

INT

Yes

Currently not supported — pass 0.

UserInfo

BASE64

Yes

Properties in XML format (see below).

HasEncoding

BOOL

Yes

UserInfo contains encoding (e.g., UTF-8).

2. UserInfo Structure

<AdmInfo>
  <Users>
    <User account_type="0" benutzer="Test" loginName="Test" flags="1"
          geaendert="1" id="67" langid="0" locked="0" logincount="0"
          logintime="0" name="Peter Muster"
          osguid="EF989801BA8847199335DD4FDEF30BC5"
          passwort="BF754341546553351243620206006521266514574240603407"
          profil="66" server_id="3" supervisor="0"/>
  </Users>
</AdmInfo>
Attribute Type Description

account_type

INT

Login type: 0 = user login; 1 = application server; 2 = ANONYMOUS; 3 = application server (e.g., Java server)

bemerkung

STRING

Comment from user configuration

benutzer

STRING

Username

changepwd

INT

1 = user must change the password at the next login, otherwise 0. For an account marked this way, krn.CheckUserAccount reports PwdExpires = 0.

loginName

STRING

Login name

flags

INT

0 = normal user; 1 = server or ANONYMOUS

geaendert

INT

0 = profile not changed; 1 = profile was changed. For accounts with their own profile (profil = 0), 1 must be set — see Notes on Writing

id

INT

ID of the user

langid

INT

ID of the used language (empty = German)

locked

INT

0 = not locked; 1 = locked by an administrator; 2 = locked by failed logins (see Lockout Behaviour). The value is written on every call — see the warning under Notes on Writing

logincount

INT

Number of consecutive failed login attempts — not of successful logins. A successful login resets the value to 0; once the threshold is reached it does not grow further.

loginstation

STRING

Name of the last login station

logintime

INT

Login timestamp

name

STRING

Full name of the user

osemail

STRING

User’s email

osguid

STRING

GUID of the user

passwort

STRING

Encrypted password of the user

profil

INT

-1 = no profile; 0 = user profile; >0 = ID of assigned profile. Assigning copies no settings; that only happens when the profile is distributed in the enaio administrator (see profile distribution).

server_id

INT

ID of the server

station

STRING

Name of the user’s workstation

supervisor

INT

-1 = supervisor, otherwise 0

validfrom

INT

User account valid from (timestamp)

validto

INT

User account valid to (timestamp)

3. Return Value

(INT): 0 = Job successful, otherwise error code.

4. Notes on Writing

The job has no parameters for individual attributes — every property is passed through UserInfo. The usual approach is therefore read, modify, write back: fetch the complete UserInfo of the account with mng.GetUserAttributes, change the attribute in question and write the whole thing back.

For accounts with their own profile (profil = 0), geaendert="1" must be set while doing so, even when nothing about the profile changes. The server reads the combination profil="0" and geaendert="0" as "drop the profile" and cancels the entire job with -1040906168, changing nothing.

Since locked is written on every call, any unrelated change — to the remark, say — replaces the marker locked = 2 of an account locked by failed logins with 0, without unlocking it. Such a lock is released only by logincount="0" (see Lockout Behaviour); writing locked = 0 alone is not enough.

5. Required System Role

This job accesses the security system or user and group data and therefore requires the calling user to hold system role 4 (Administrator: Configure security system — configure the rights system). If this role is missing, the call is rejected with the error code -1040906164; the associated error text reads:

User {username} does not have permission to configure the security system. Please contact your administrator.

The system roles assigned to the calling user can be determined with mng.GetUserRoles; an overview of all roles is available under System Roles. See also Error Codes.