Class Phone2Dev

Description

Phone2Dev Class

  • author: Stanislav Miroshnikov

Located in /phone2dev.php (line 18)


	
			
Variable Summary
mixed $objDB
Method Summary
integer|-1 authPhonePin (strPhone $strPhone, strPin $strPin)
an authUserPass (strUsername $strUsername, strPassword $strPassword)
void dbConnect ()
void dbDisconnect ()
void executeCommand (int_commandId $intCommandId, int_deviceId $intDeviceId, intUserId $intUserId)
array getCommands (intMenuId $intMenuId, intUserId $intUserId)
void getMainMenuId (mixed $intUserId)
array getSubMenus (intMenuId $intMenuId, intUserId $intUserId)
integer getUserId (strUsername $strUsername)
an getUserIdByPhone (strPhone $strPhone)
true phoneExists (strPhone $strPhone)
void registerUser (strLastName $strLastName, strFirstName $strFirstName, strUsername $strUsername, strPassword $strPassword, strPhone $strPhone, strPin $strPin, strServer $strServer, strAddress $strAddress)
true|false userExists (strUsername $strUsername)
Variables
mixed $objDB (line 22)

DB handle

Methods
authPhonePin (line 53)

Authenticates using a phone number and pin

  • return: containing the userId if user was authenticated correctly, else returns -1
integer|-1 authPhonePin (strPhone $strPhone, strPin $strPin)
  • strPhone $strPhone: user's phone number
  • strPin $strPin: user's pin number
authUserPass (line 91)

Authenticates using a username and password

  • return: integer containing the user's id if user was authenticated correctly, else returns -1
an authUserPass (strUsername $strUsername, strPassword $strPassword)
  • strUsername $strUsername: user's username
  • strPassword $strPassword: user's password
dbConnect (line 27)

Connects the class instance to the database

void dbConnect ()
dbDisconnect (line 42)

Diconnects the class instance from the database

void dbDisconnect ()
executeCommand (line 429)

Executes the user command

void executeCommand (int_commandId $intCommandId, int_deviceId $intDeviceId, intUserId $intUserId)
  • int_commandId $intCommandId
  • int_deviceId $intDeviceId
  • intUserId $intUserId: valid if of a user
getCommands (line 391)

Returns commands of the given menu

  • return: commandId as keys and an associate array of command information as value
  • todo: return commands array with menu order as a key so it can be combined and sorted with the sub menu array
array getCommands (intMenuId $intMenuId, intUserId $intUserId)
  • intMenuId $intMenuId: valid id of a menu
  • intUserId $intUserId: valid if of a user
getMainMenuId (line 319)
void getMainMenuId (mixed $intUserId)
getSubMenus (line 357)

Returns sub menus of the given menu

  • return: sub menu id's as keys and menu names as values
  • todo: return sub menu array with menu order as a key so it can be combined and sorted with the command array
array getSubMenus (intMenuId $intMenuId, intUserId $intUserId)
  • intMenuId $intMenuId: valid id of a menu
  • intUserId $intUserId: valid if of a user
getUserId (line 255)

Retrieves the userId for the user

  • return: containing the userId
integer getUserId (strUsername $strUsername)
  • strUsername $strUsername: a valid username contained in the database
getUserIdByPhone (line 289)

Retrieves the userId for the user

  • return: integer containing the userId
an getUserIdByPhone (strPhone $strPhone)
  • strPhone $strPhone: a valid phone number in the database
phoneExists (line 153)

Checks where the telephone exists

  • return: if username exists, else false
true phoneExists (strPhone $strPhone)
  • strPhone $strPhone: user's phone
registerUser (line 185)

Inserts the registration information into the database

void registerUser (strLastName $strLastName, strFirstName $strFirstName, strUsername $strUsername, strPassword $strPassword, strPhone $strPhone, strPin $strPin, strServer $strServer, strAddress $strAddress)
  • strLastName $strLastName: validated last name
  • strFirstName $strFirstName: validated first name
  • strUsername $strUsername: validated username
  • strPassword $strPassword: validated password
  • strPhone $strPhone: validated phone
  • strPin $strPin: validated pin
  • strServer $strServer: validated sip server
  • strAddress $strAddress: validated sip address
userExists (line 127)

Checks where the username exists in the database

  • return: if the username exists
true|false userExists (strUsername $strUsername)
  • strUsername $strUsername: user's username

Documentation generated on Tue, 4 Jan 2005 20:26:07 -0500 by phpDocumentor 1.3.0RC3