Difference between revisions of "User new"

From Catglobe Wiki
Jump to: navigation, search
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{HelpFiles}}  
 
{{HelpFiles}}  
  
==== User_new ====
+
==== User_new ====
  
 
Create a new user object  
 
Create a new user object  
Line 8: Line 8:
  
 
User_new(''username, password, userTemplateResourceId'')  
 
User_new(''username, password, userTemplateResourceId'')  
 +
 +
or
 +
 +
array User_new(''userTemplateResourceId[, userNameMask]'')
  
 
'''Arguments'''  
 
'''Arguments'''  
Line 14: 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
 +
*''userNameMask'': is a ''string ''expression. It is name which user want to include (optional)
  
 
'''Return value'''  
 
'''Return value'''  
  
 
An ''array'', it is a user object which contains the following items  
 
An ''array'', it is a user object which contains the following items  
<table width="875" cellspacing="0" cellpadding="2" border="1" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic">
 
<tbody><tr valign="top" align="left">
 
<td width="292" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Index</strong></p>
 
</td>
 
<td width="116" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Data type</strong></p>
 
</td>
 
<td width="467" bgcolor="#C0C0C0" style="border:1px solid #010101;"><p class="bodytext"><strong class="specialbold">Value</strong></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_RESOURCE_ID</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">number</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Resource id</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_NAME</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Username</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_TEMPLATE_RESOURCE_ID</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">number</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">User template's resource id</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_PASSWORD</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Password</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_TIME_REGISTRATION</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">bool</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">If time registration is allowed</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_MAN_HOURS</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">number</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Number of budget hours</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_CALCULATED_MAN_HOURS</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">bool</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">If number of budget hours is calculated on Team tab's settings</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_PHONE_NUMBER</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">array</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Phone number list</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_ACCESS_EXPIRATION</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">aray</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Expiration date</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_PROTECTED_UNTIL</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">array</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Protection deadline</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_LANGUAGE</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Language's ISO code</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_CULTURE</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Culture's ISO code</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_EMAIL</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Email address</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_FIRST_NAME</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">First name</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_MIDDLE_NAME</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Middle name</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_LAST_NAME</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Last name</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_CURRENCY</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Currency</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_DISCOUNT</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Discount</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_POINT_BALANCE</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">number</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Point balance (read-only)</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_TIMEZONE</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">number</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Timezone</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_ADDRESS</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Address</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_CITY</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">City</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_ZIPCODE</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Zip code</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_REGION</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Region</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_COUNTRY</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Country's ISO code</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_POSTBOX</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Postbox</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_WEBSITE</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">string</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">Website</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_DELETED</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">bool</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">If the user is deleted</span></p>
 
</td>
 
</tr>
 
<tr valign="top" align="left">
 
<td width="292" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">USER_DISABLED</span></p>
 
</td>
 
<td width="116" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">bool</span></p>
 
</td>
 
<td width="467" style="border:1px solid #010101;"><p class="bodytext"><span class="normalise">If the user is disabled</span></p>
 
</td>
 
</tr>
 
  
</tbody></table>
+
{| class="tableintopic" style="border: 1px solid rgb(1, 1, 1); border-collapse: collapse;" width="875" cellspacing="0" cellpadding="2" border="1"
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" bgcolor="#c0c0c0" |
 +
'''Index'''
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" bgcolor="#c0c0c0" |
 +
'''Data type'''
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" bgcolor="#c0c0c0" |
 +
'''Value'''
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_RESOURCE_ID</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">number</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Resource id</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_NAME</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Username</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_TEMPLATE_RESOURCE_ID</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">number</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">User template's resource id</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_PASSWORD</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Password. when get password, will return empty string</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_TIME_REGISTRATION</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">bool</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">If time registration is allowed</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_MAN_HOURS</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">number</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Number of budget hours</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_CALCULATED_MAN_HOURS</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">bool</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">If number of budget hours is calculated on Team tab's settings</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_PHONE_NUMBER</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">array</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Phone number list</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_ACCESS_EXPIRATION</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">aray</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Expiration date</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_PROTECTED_UNTIL</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">array</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Protection deadline</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_LANGUAGE</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">[[IsoCodeLanguage|Language's ISO code]]</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_CULTURE</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">[[IsoCodeLanguage|Culture's ISO code]]</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_EMAIL</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Email address</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_FIRST_NAME</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">First name</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_MIDDLE_NAME</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Middle name</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_LAST_NAME</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Last name</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_CURRENCY</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Currency</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_DISCOUNT</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Discount</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_POINT_BALANCE</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">number</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Point balance (read-only)</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_TIMEZONE</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">number</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">[[GetTimezone|Timezone]]</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_ADDRESS</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Address</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_CITY</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">City</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_ZIPCODE</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Zip code</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_REGION</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Region</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_COUNTRY</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">[[Iso codes|Country's ISO code]]</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_POSTBOX</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Postbox</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_WEBSITE</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">string</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">Website</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_DELETED</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">bool</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<span class="normalise">If the user is deleted</span>
 +
 
 +
|- valign="top" align="left"
 +
| style="border: 1px solid rgb(1, 1, 1);" width="292" |
 +
<span class="normalise">USER_DISABLED</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="116" |
 +
<span class="normalise">bool</span>
 +
 
 +
| style="border: 1px solid rgb(1, 1, 1);" width="467" |
 +
<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
 +
|}
 +
 
 +
'''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'''  
 
'''Availability'''  
  
Version 5.6 __NOTOC__ 
+
Version 5.6  
 +
 
 +
__FORCETOC__
  
 
[[Category:User_Functions]]
 
[[Category:User_Functions]]

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