Difference between revisions of "User new"

From Catglobe Wiki
Jump to: navigation, search
(Tag: visualeditor)
 
(3 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
or
 
or
  
array User_new(''userTemplateResourceId[, userNameMass]'')
+
array User_new(''userTemplateResourceId[, userNameMask]'')
  
 
'''Arguments'''  
 
'''Arguments'''  
Line 18: Line 18:
 
*''password'': is a ''string ''expression. It is the user's password, it must follow the common format for passwords  
 
*''password'': is a ''string ''expression. It is the user's password, it must follow the common format for passwords  
 
*''userTemplateResourceId'': is a ''number ''expression. It is the user template's resource id
 
*''userTemplateResourceId'': is a ''number ''expression. It is the user template's resource id
*''userNameMass'': is a ''string ''expression. It is name which user want to include (optional)
+
*''userNameMask'': is a ''string ''expression. It is name which user want to include (optional)
  
 
'''Return value'''  
 
'''Return value'''  
Line 143: Line 143:
  
 
| style="border: 1px solid rgb(1, 1, 1);" width="467" |  
 
| style="border: 1px solid rgb(1, 1, 1);" width="467" |  
<span class="normalise">Language's ISO code</span>
+
<span class="normalise">[[IsoCodeLanguage|Language's ISO code]]</span>
  
 
|- valign="top" align="left"
 
|- valign="top" align="left"
Line 153: Line 153:
  
 
| style="border: 1px solid rgb(1, 1, 1);" width="467" |  
 
| style="border: 1px solid rgb(1, 1, 1);" width="467" |  
<span class="normalise">Culture's ISO code</span>
+
<span class="normalise">[[IsoCodeLanguage|Culture's ISO code]]</span>
  
 
|- valign="top" align="left"
 
|- valign="top" align="left"
Line 233: Line 233:
  
 
| style="border: 1px solid rgb(1, 1, 1);" width="467" |  
 
| style="border: 1px solid rgb(1, 1, 1);" width="467" |  
<span class="normalise">Timezone</span>
+
<span class="normalise">[[GetTimezone|Timezone]]</span>
  
 
|- valign="top" align="left"
 
|- valign="top" align="left"
Line 283: Line 283:
  
 
| style="border: 1px solid rgb(1, 1, 1);" width="467" |  
 
| style="border: 1px solid rgb(1, 1, 1);" width="467" |  
<span class="normalise">Country's ISO code</span>
+
<span class="normalise">[[Iso codes|Country's ISO code]]</span>
  
 
|- valign="top" align="left"
 
|- valign="top" align="left"
Line 324: Line 324:
 
| style="border: 1px solid rgb(1, 1, 1);" width="467" |  
 
| style="border: 1px solid rgb(1, 1, 1);" width="467" |  
 
<span class="normalise">If the user is disabled</span>
 
<span class="normalise">If the user is disabled</span>
 
+
|-
 +
|USER_PARENT_RESOURCE_ID
 +
|number
 +
|Set/Get parent resource Id of the user
 +
|-
 +
|USER_MASK
 +
|string
 +
|Get mask of the user (the user created by ''userNameMask'')
 +
|-
 +
|USER_RESOURCE_GUID
 +
|string
 +
|Get GUID of the user
 
|}
 
|}
  
Line 337: Line 348:
 
//Output : {5,0,phonghh1111,15070738,123456,False,0,False,{},{1,1,1,0,0,0,0,1,0},{1,1,1,0,0,0,0,1,0},en-US,en-GB,,,,,,,0,0,,,,,,,,False,False,}
 
//Output : {5,0,phonghh1111,15070738,123456,False,0,False,{},{1,1,1,0,0,0,0,1,0},{1,1,1,0,0,0,0,1,0},en-US,en-GB,,,,,,,0,0,,,,,,,,False,False,}
  
* Example for User_new(''userTemplateResourceId[, userNameMass]'')
+
* Example for User_new(''userTemplateResourceId[, userNameMask]'')
  
 
''number userTemplateResourceId=33673945;''
 
''number userTemplateResourceId=33673945;''
  
''string userNameMass="ABC_{0}_XYZ";''
+
''string userNameMask="ABC_{0}_XYZ";''
  
''array user= User_new(userTemplateResourceId,userNameMass);''
+
''array user= User_new(userTemplateResourceId,userNameMask);''
  
 
''User_save(user);''
 
''User_save(user);''

Latest revision as of 03:50, 23 February 2022



Contents

User_new

Create a new user object

Syntax

User_new(username, password, userTemplateResourceId)

or

array User_new(userTemplateResourceId[, userNameMask])

Arguments

  • username: is a string expression. It is the user's username, it must follow the common format of usernames
  • password: is a string expression. It is the user's password, it must follow the common format for passwords
  • userTemplateResourceId: is a number expression. It is the user template's resource id
  • userNameMask: is a string expression. It is name which user want to include (optional)

Return value

An array, it is a user object which contains the following items

Index

Data type

Value

USER_RESOURCE_ID

number

Resource id

USER_NAME

string

Username

USER_TEMPLATE_RESOURCE_ID

number

User template's resource id

USER_PASSWORD

string

Password. when get password, will return empty string

USER_TIME_REGISTRATION

bool

If time registration is allowed

USER_MAN_HOURS

number

Number of budget hours

USER_CALCULATED_MAN_HOURS

bool

If number of budget hours is calculated on Team tab's settings

USER_PHONE_NUMBER

array

Phone number list

USER_ACCESS_EXPIRATION

aray

Expiration date

USER_PROTECTED_UNTIL

array

Protection deadline

USER_LANGUAGE

string

Language's ISO code

USER_CULTURE

string

Culture's ISO code

USER_EMAIL

string

Email address

USER_FIRST_NAME

string

First name

USER_MIDDLE_NAME

string

Middle name

USER_LAST_NAME

string

Last name

USER_CURRENCY

string

Currency

USER_DISCOUNT

string

Discount

USER_POINT_BALANCE

number

Point balance (read-only)

USER_TIMEZONE

number

Timezone

USER_ADDRESS

string

Address

USER_CITY

string

City

USER_ZIPCODE

string

Zip code

USER_REGION

string

Region

USER_COUNTRY

string

Country's ISO code

USER_POSTBOX

string

Postbox

USER_WEBSITE

string

Website

USER_DELETED

bool

If the user is deleted

USER_DISABLED

bool

If the user is disabled

USER_PARENT_RESOURCE_ID number Set/Get parent resource Id of the user
USER_MASK string Get mask of the user (the user created by userNameMask)
USER_RESOURCE_GUID string Get GUID of the user

Example

  • Example for User_new(username, password, userTemplateResourceId)

array userinfo = User_new("phonghh1111","123456",15070738);

print(userinfo);

//Output : {5,0,phonghh1111,15070738,123456,False,0,False,{},{1,1,1,0,0,0,0,1,0},{1,1,1,0,0,0,0,1,0},en-US,en-GB,,,,,,,0,0,,,,,,,,False,False,}

  • Example for User_new(userTemplateResourceId[, userNameMask])

number userTemplateResourceId=33673945;

string userNameMask="ABC_{0}_XYZ";

array user= User_new(userTemplateResourceId,userNameMask);

User_save(user);

print(user);

// Output:

{5,37284223,ABC_38394667_XYZ,33673945,Al8fqEs1,False,0,False,{},{1,1,1,0,0,0,0,1,0},{1,1,1,0,0,0,0,1,0},en-GB,en-GB,,,,,DKK,,0,0,,,,,,,,False,False,ABC_{0}_XYZ,104371}


Availability

Version 5.6