Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

What can JSMA user do for me?

You could easily use the JSMA user to edit a user

...

The JSMA user provides the following methods:

user.flexAttributes

...

Returns an array of the flex attributes of a user

...

Code Block
languagejs
linenumberstrue
... 
user.flexAttributes()
...

user.get(key)

Returns the value of key as string.

...

Code Block
languagejs
linenumberstrue
... 
user.has(key)
...

Parameter key (required)

int user.id

Returns the id of the user

Example

Code Block
languagejs
linenumberstrue
... 
user.id
...

user.increment(key)

Increments the vale of a given key by one.

Example

Code Block
languagejs
linenumberstrue
... 
user.increment(key)
...

...

Returns the name of the user

Example

Code Block
languagejs
linenumberstrue
... 
user.name
...

...

Removes the given key from a user

Example

Code Block
languagejs
linenumberstrue
... 
user.remove(key)
...

...

Sets the value of a specified key for a given user.

Example

Code Block
languagejs
linenumberstrue
... 
var text = request.parameter("text");
  
user.set("smp.util.notes.text", text);
...

...

Sets the password for a user

Example

Code Block
languagejs
linenumberstrue
... 
user.setPassword(password)
...

...