Overview

Packages

  • Admin
  • Archive
  • Common
  • DB
  • Express
  • Form
  • Layout
  • Mailer
  • None
  • OpenHomeoDB
  • PDF
    • MC
  • Process
  • Rep
  • RevRep
  • SaveReps
  • Search
  • Session
  • SymRem
  • TreeView
  • UserDB

Classes

  • UserDB
  • Overview
  • Package
  • Class
  • Tree

Class UserDB

The Database class is meant to simplify the task of accessing information from the website's database.

DbPlugin
Extended by DB
Extended by OpenHomeoDB
Extended by UserDB
Package: UserDB
Category: Login
Copyright: 2007-2014 Henri Schumacher
License: GNU Affero General Public License v3
Author: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
Author: Henri Schumacher <henri.hulski@gazeta.pl>
Located at include/classes/login/database.php
Methods summary
public
# get_num_visitors( )

Only query database to find out number of members when getNumMembers() is called for the first time, until then, default value set.

Only query database to find out number of members when getNumMembers() is called for the first time, until then, default value set.

public integer
# confirmUserPass( string $username, string $password )

confirmUserPass - Checks whether or not the given username is in the database, if so it checks if the given password is the same password in the database for that user. If the user doesn't exist or if the passwords don't match up, it returns an error code (1 or 2). On success it returns 0.

confirmUserPass - Checks whether or not the given username is in the database, if so it checks if the given password is the same password in the database for that user. If the user doesn't exist or if the passwords don't match up, it returns an error code (1 or 2). On success it returns 0.

Parameters

$username
string
$username username
$password
string
$password password

Returns

integer
0 | 1 | 2
public integer
# confirmUserID( string $username, string $userid )

confirmUserID - Checks whether or not the given username is in the database, if so it checks if the given userid is the same userid in the database for that user. If the user doesn't exist or if the userids don't match up, it returns an error code (1 or 2). On success it returns 0.

confirmUserID - Checks whether or not the given username is in the database, if so it checks if the given userid is the same userid in the database for that user. If the user doesn't exist or if the userids don't match up, it returns an error code (1 or 2). On success it returns 0.

Parameters

$username
string
$username username
$userid
string
$userid user-ID

Returns

integer
0 | 1 | 2
public boolean
# usernameTaken( string $username )

usernameTaken - Returns true if the username has been taken by another user, false otherwise.

usernameTaken - Returns true if the username has been taken by another user, false otherwise.

Parameters

$username
string
$username username

Returns

boolean
public boolean
# usernameBanned( string $username )

usernameBanned - Returns true if the username has been banned by the administrator.

usernameBanned - Returns true if the username has been banned by the administrator.

Parameters

$username
string
$username username

Returns

boolean
public boolean
# addNewUser( string $username, string $password, string $email )

addNewUser - Inserts the given (username, password, email) info into the database. Appropriate user level is set. Returns true on success, false otherwise.

addNewUser - Inserts the given (username, password, email) info into the database. Appropriate user level is set. Returns true on success, false otherwise.

Parameters

$username
string
$username username
$password
string
$password password
$email
string
$email e-mail

Returns

boolean
true on success
public boolean
# updateUserField( string $username, string $field, string $value )

updateUserField - Updates a field, specified by the field parameter, in the user's row of the database.

updateUserField - Updates a field, specified by the field parameter, in the user's row of the database.

Parameters

$username
string
$username username
$field
string
$field form field
$value
string
$value field value

Returns

boolean
true on success
public boolean
# getUserInfo( string $username, string $column )

getUserInfo - Returns the result array from a database query asking for all information stored regarding the given username. If query fails, NULL is returned.

getUserInfo - Returns the result array from a database query asking for all information stored regarding the given username. If query fails, NULL is returned.

Parameters

$username
string
$username username
$column
string
$column column(s) of user table to query - comma seperated

Returns

boolean
true on success
public integer
# getNumMembers( )

getNumMembers - Returns the number of signed-up users of the website, banned members not included. The first time the function is called on page load, the database is queried, on subsequent calls, the stored result is returned. This is to improve efficiency, effectively not querying the database when no call is made.

getNumMembers - Returns the number of signed-up users of the website, banned members not included. The first time the function is called on page load, the database is queried, on subsequent calls, the stored result is returned. This is to improve efficiency, effectively not querying the database when no call is made.

Returns

integer
private integer
# calcNumActiveUsers( )

calcNumActiveUsers - Finds out how many active users are viewing site and sets class variable accordingly.

calcNumActiveUsers - Finds out how many active users are viewing site and sets class variable accordingly.

Returns

integer
private integer
# calcNumActiveGuests( )

calcNumActiveGuests - Finds out how many active guests are viewing site and sets class variable accordingly.

calcNumActiveGuests - Finds out how many active guests are viewing site and sets class variable accordingly.

Returns

integer
public
# addActiveUser( string $username )

addActiveUser - Updates username's last activity in the database, and also adds him to the table of active users, or updates timestamp if already there.

addActiveUser - Updates username's last activity in the database, and also adds him to the table of active users, or updates timestamp if already there.

Parameters

$username
string
$username username
public
# addActiveGuest( string $ip )

addActiveGuest - Adds guest to active guests table

addActiveGuest - Adds guest to active guests table

Parameters

$ip
string
$ip IP-address
public
# removeActiveUser( string $username )

removeActiveUser - removes user with given username from active_users table

removeActiveUser - removes user with given username from active_users table

Parameters

$username
string
$username username
public
# removeActiveGuest( string $ip )

removeActiveGuest - removes guest with given IP from active_guests table

removeActiveGuest - removes guest with given IP from active_guests table

Parameters

$ip
string
$ip IP-address
public
# removeInactiveUsers( )

removeInctiveUsers - removes users after inactivity of USER_TIMEOUT from active_users table

removeInctiveUsers - removes users after inactivity of USER_TIMEOUT from active_users table

public
# removeInactiveGuests( )

removeInactiveGuest - removes guests after inactivity of GUEST_TIMEOUT from active_guests table

removeInactiveGuest - removes guests after inactivity of GUEST_TIMEOUT from active_guests table

Methods inherited from OpenHomeoDB
add_missing_parents(), archive_table_row(), create_custom_symptom_table(), create_custom_table(), exist_symptom_translation(), extract_src_no(), get_custom_src(), get_custom_symptom_lang(), get_custom_table(), get_lang_only_symptom_table(), get_source_id(), get_source_nr(), get_sym_base_table(), get_sym_langs(), get_symptomname(), is_custom_table(), is_sym_lang(), is_translated(), restore_table_row(), update_custom_symptom_table(), update_lang_symptom_tables(), update_symptom_tables(), update_symptom_tree()
Methods inherited from DB
db_fetch_assoc(), db_fetch_row(), get_primary_key(), reset_result(), send_query_limit(), table_exists()
Properties summary
public integer $num_active_users
#

Number of active users viewing site

Number of active users viewing site

public integer $num_active_guests
#

Number of active guests viewing site

Number of active guests viewing site

public integer $num_members
#

Number of signed-up users

Number of signed-up users

OpenHomeopath PHP code documentation API documentation generated by ApiGen 2.8.0