|
/**
* Class for accessing registred user information from xml node.
*/
function UserInfo(xmlNode) {
this.xmlNode = xmlNode;
this.getFirstName = UserInfo_getFirstName;
this.setFirstName = UserInfo_setFirstName;
this.getLastName = UserInfo_getLastName;
this.setLastName = UserInfo_setLastName;
this.checkPassword = UserInfo_checkPassword;
this.setPassword = UserInfo_setPassword;
this.setEmail = UserInfo_setEmail;
this.getEmail = UserInfo_getEmail;
// Reuse same functions from Session class
this.setAttribte = Session_setAttribte;
this.getAttribte = Session_getAttribte;
// Reuse same functions from RoomInfo class
this.getUserID = RoomInfo_getRoomID;
this.getUserNick = RoomInfo_getRoomName;
this.setUserNick = RoomInfo_setRoomName;
}
/**
* Retrieving the first name.
*/
function UserInfo_getFirstName() {
return this.getAttribte("FIRSTNAME");
}
/**
* Association new first name.
*/
function UserInfo_setFirstName(firstName) {
this.setAttribte("FIRSTNAME", firstName);
}
/**
* Retrieving the last name.
*/
function UserInfo_getLastName() {
return this.getAttribte("LASTNAME");
}
/**
* Association new last name.
*/
function UserInfo_setLastName(lastName) {
this.setAttribte("LASTNAME", lastName);
}
/**
* Checking for password with owned one.
*/
function UserInfo_checkPassword(password) {
var realPassword = this.getAttribte("PASSWORD");
return (realPassword == password);
}
/**
* Association new password.
*/
function UserInfo_setPassword(password) {
this.setAttribte("PASSWORD", password);
}
/**
* Associates new email.
*/
function UserInfo_setEmail(email) {
this.setAttribte("EMAIL", email);
}
/**
* Retrieving email.
*/
function UserInfo_getEmail() {
return this.getAttribte("EMAIL");
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here