Register

integer uc_user_register(string username , string password , string email [, integer questionid , string answer])

function parameters
parameter meaning
string username User Name
string password Password
string email E-mail
integer questionid Security question index
string answer Security question answer
string regip Registration IP
return value
value meaning
integer > 0: return the user ID, that user registration is successful
-1: the user name is not legitimate
-2: contains words not allowed to register
-3: the user name already exists
-4: Email format is incorrect
-5: Email does not allow registration
-6: The Email is already registered

The interface function for the new user registration. User name, password, Email for a user UCenter basic data, after the submission of UCenter will be in accordance with the registered settings and word filtering rules for testing the user name and Email in the format is correct legally, if the correct return registration user ID, otherwise it returns the corresponding error message.
Register Example (PHP)

User Login

array uc_user_login(string username , string password [, bool isuid , bool checkques , integer questionid , string answer])

Function parameters
parameter meaning
string username User name / User ID
string password Password
bool isuid The use of user ID login
1: Use the user ID for login
2: Use E-mail for login
0: (default value) use the username
bool checkques Whether to Verify sequrity questions
1: authentication security questions
0: (default value) did not verify the security question
integer questionid Security questions index
string answer Security question answer
Return value
value meaning
array integer [0] > 0: return the user ID, that user logs on successfully
-1: the user does not exist, or deleted
-2: password wrong
-3: security question wrong
string [1] User Name
string [2] Password
string [3] Email
bool [4] user name allready exists

The interface functions for the user's login authentication, user name and password are correct returns the user UCenter basic data, otherwise it returns the corresponding error message. If the application is an upgrade over, and there are users currently logged on user and the same name, then the returned array [4] will return a value.
Login example (PHP)

Access to user data

array uc_get_user(string username [, bool isuid])

Function parameters
parameter meaning
string username User Name
bool isuid Whether to use the user ID
1: use the user ID
0: (default value) using the User Name
Return value
value meaning
array integer [0] User ID
string [1] User Name
string [2] Email

This interface function is used to obtain from UCenter the user basic data. If the user does not exist, the return value is integer value 0.
Access to user data sample (PHP)

Update user information

integer uc_user_edit(string username , string oldpw , string newpw , string email [, bool ignoreoldpw, integer questionid , string answer])

Function parameters
parameter meaning
string username User Name
string oldpw Old Password
string newpw new password, empty if not changed
string email Email, empty if not changed
bool ignoreoldpw It ignores the old password
1: ignore, change the data and do NOT verify the password
0: (default value) do not ignore, for change the data need to verify your password
integer questionid Security questions index
string answer Security question answer
Return value
value meaning
integer 1: updated successfully
0: did not made any changes
-1: the old password is incorrect
-4: Email format is incorrect
-5: Email does not allowed for registration
-6: The Email is already registered
-7: ddid not made any changes
-8: The user is protected, do not have permission to change

This interface function is used to update user information. Update the information required to verify the user's original password is correct, unless specified ignoreoldpw 1. If you only modify the Email does not modify the code that allows newpw empty; the same token, if only to modify the password does not modify the Email, allow email is empty.
update user information example (PHP)

Remove users

integer uc_user_delete(string/array username)

Function parameters
parameter meaning
string/array username User Name
Return value
value meaning
integer 1: success
0: fail

Remove user avatar

integer uc_user_deleteavatar(string/array username)

Function parameters
parameter meaning
string/array username User Name

Synchronization login

string uc_user_synlogin(integer uid)

Function parameters
parameter meaning
integer uid User ID
Return value
value meaning
string HTML code synchronous login

If the current application set UCenter allow synchronization login, then this interface function will notify the other set the synchronization log on the application log, to return to the HTML output in the page to complete the notification of the other applications. HTML output contains the implementation of remote scripting javascript, please allow this script to run the page to jump after the operation is completed, it may cause can not be successful synchronization log. We should also ensure the correct and effective synchronization log, please ensure that other applications of the Cookie Domain and Cookie Path set correctly.
synchronization log example (PHP)

Synchronization logout

string uc_user_synlogout()

return value
value meaning
string HTML code synchronization exit

If the current application set UCenter allow synchronization login, then this interface function will notify the other set synchronization logout on the application logout, to return to the HTML output can be completed in the page to inform other applications. HTML output contains the implementation of remote scripting javascript, please allow this script to run the page to jump after the operation is completed, it may cause no synchronization exit logout. While simultaneously out of the registry to ensure correct and effective, please ensure that other applications of the Cookie Domain and Cookie Path set correctly.

Check Email Address

integer uc_user_checkemail(string email)

Function parameters
parameter meaning
string email Email
Return value
value meaning
integer 1: success
-4: Email format is incorrect
-5: Email does not allowed for registration
-6: The Email is already registered

This interface function is used to check the legitimacy of user input Email.
Check Email example (PHP)

Check the user name

integer uc_user_checkname(string username)

Function parameters
parameter meaning
string username User Name
Return value
value meaning
integer 1: user name is ok
-1: the user name is not legitimate
-2: user name contains words that not allowed for registration
-3: the user name already exists

This function is used to check user input interface, the user name of legitimacy.
Check the user name sample (PHP)

Add to protected users

integer uc_user_addprotected(string/array username , string admin)

Function parameters
parameter meaning
string/array username protect the user name
string admin Administrator
Return value
value meaning
integer 1: success
-1: fail

The interface functions is used for adding protected users.

Delete from protected users

integer uc_user_deleteprotected(string/array username)

Function parameters
parameter meaning
string/array username protected user name
Return value
value meaning
integer 1: success
-1: fail

This function is used to remove the protected user.

Get a list of protected user names

integer uc_user_getprotected()

Return value
value meaning
array Protected user data

The interface function is used to get a list of protected users.

Merge user. Set the same user name into UCenter

integer uc_user_merge(string/ oldusername , string newusername, integer uid, string password, string email)

Function parameters
parameter meaning
string oldusername old user name
string newusername new user name
integer uid User ID
string password Password
string email E-mail
return value
value meaning
integer > 0: return the user ID, that user registration is successful
-1: User name is not valid
-2: Contains words not allowed for registration
-3: user name already exists

The interface to the user function is used to duplicate names into UCenter.
Handling the same name of user and merged user
If your application when integrated into UCenter contains the old user data, we suggest that you can take the following example of the way to your users into UCenter.
User merge example (PHP)
The basic process is this way: First, get the current UCenter the largest user ID value. Then, read the application its own user table, reading the user name is repeated in UCenter. If repeated, the same name of the user name saved to UCenter the mergemembers table, do not merge the user. If you do not duplicate, according to the user to merge into the normal way. When the user inserted into mergemembers form, the user logged in the application when signed return array [4] the value will return 1 ( see above on uc_user_login() function Description ). When logged back to Chong Ming state after the application of the proposed interpretation of your user name change after the legality of the treatment, call the interface function.
the same name as the user into UCenter example (PHP)

Remove duplicate user name records

uc_user_merge_remove(string username)

Function parameters
parameter meaning
string username User Name

This interface function is used to remove duplicate names in the specified user record record, if the application has been processed the same name as the user, can perform this interface function.

access to specified applications with specified users integration

integer uc_user_getcredit(integer appid, integer uid, integer credit)

Function parameters
parameter meaning
integer appid Application ID
integer uid User ID
integer credit Number of points
Return value
value meaning
integer Summ of points

This interface function is used to specify the application of the specified user access points.