Class PortableNotespace

Description

Located in /portablenotespace.lib.php (line 31)


	
			
Variable Summary
Method Summary
bool __construct (string $location)
bool add_note (string $note, string $contents, string $user, [string $notegroup = 'default'])
bool add_user (string $user, string $pass, [string $group = 'users'])
bool assign_group (string $user, [string $group = 'users'])
void ban_ip (string $ip)
bool ban_user (string $user)
void ban_useragent (string $agent)
void clear_ipbanlist ([ $resetval = array()])
void clear_useragentlist ([Array(string) $resetval = array()])
void clear_userbanlist ([Array(string) $resetval = array()])
bool deassign_group (string $user)
bool delete_note (string $note, string $user, string $ngp)
void delete_theme ( $path)
bool delete_user (string $user)
bool edit_note (string $note, string $contents, string $user, string $ngp)
string get_admin_group ()
Array(string) get_all_ban_lists ()
Array(string) get_banlist ()
string get_desc ()
Array(string) get_ip_ban_list ()
string get_mod_group ()
string get_sitename ()
string get_theme ()
Array(string) get_ua_ban_list ()
Array(string) get_user_ban_list ()
string get_user_group ()
Array(string) list_groups (string $user)
Array(string) list_notes (string $user, string $group)
Array(string) list_users ()
bool publish_note (string $note, string $group, string $user, [string $wfile = 'webpub.htm'])
string set_desc (string $d)
void set_mod_group (string $modgroup)
string set_sitename (string $sn)
void set_theme (string $t)
void set_user_group (string $usrgroup)
bool theme_exists (string $theme)
bool unban_ip (string $ip, [bool $force = false])
bool unban_user (string $user, [bool $force = false])
bool unban_useragent (string $agent, [bool $force = false])
bool user_exists (string $user)
Variables
pns_db $db (line 39)

The database

An instance of pns_db

int $error (line 53)

The current error code

  • 0 - Success
  • 1 - NoSuchUser
  • 2 - FileNotFound
  • 3 - NoteAlreadyExists
  • 4 - UserAlreadyExists
  • 5 - NoSuchBanEntry
  • 6 - ThemeAddError

Methods
Constructor __construct (line 66)

Initialize the PortableNotespace

Initializes the PortableNotespace.

  • return: Returns false on failure, true on success
bool __construct (string $location)
  • string $location: The location to the database
add_note (line 115)

Adds a note to the notegroup that you specify

Adds a note to the notegroup that was specified. If the note already exists, it will return with an error.

  • return: Returns true on success, false on failure
bool add_note (string $note, string $contents, string $user, [string $notegroup = 'default'])
  • string $note: The note's title (must be unique)
  • string $contents: The note's contents
  • string $user: The user to add the note to
  • string $notegroup: The notegroup to add the note to
add_user (line 335)

Adds a new user

Adds a new user to the database

  • return: Returns false on failure, true on success
bool add_user (string $user, string $pass, [string $group = 'users'])
  • string $user: The username of the new user
  • string $pass: The password (non-hashed) of the new user
  • string $group: The group name of the new user. Default is users
assign_group (line 374)

Assigns a user to a group

Assigns a user to the specified group (users).

  • return: Returns false on failure, true on success
bool assign_group (string $user, [string $group = 'users'])
  • string $user: The user to assign
  • string $group: The group to assign the user to (by default users)
ban_ip (line 461)

Ban an IP

Bans an IP into the IP ban list to be used.

void ban_ip (string $ip)
  • string $ip: The IP to ban
ban_user (line 499)

Bans an user

Bans an user into the banlist.

  • return: Returns true on success, false on failure
bool ban_user (string $user)
  • string $user: The user to ban
ban_useragent (line 480)

Ban an user agent

Bans an user agent into the UserAgent ban list.

void ban_useragent (string $agent)
  • string $agent: The useragent to ban
clear_ipbanlist (line 713)

Clears the banlist (IP)

Clears the IP banlist by resetting it.

void clear_ipbanlist ([ $resetval = array()])
  • $resetval
clear_useragentlist (line 727)

Clears the banlist (UserAgent)

Clears the user agent banlist by resetting it.

void clear_useragentlist ([Array(string) $resetval = array()])
  • Array(string) $resetval: Custom default to set.
clear_userbanlist (line 741)

Clears the banlist (User)

Clears the user banlist by resetting it.

void clear_userbanlist ([Array(string) $resetval = array()])
  • Array(string) $resetval: Custom default to set.
deassign_group (line 401)

Deassigns the group

Deassigns(resets) the group of the specified user.

  • return: Returns true on success, false on failure.
bool deassign_group (string $user)
  • string $user: The user
delete_note (line 176)

Deletes a note

Deletes the specified note in the specified group

  • return: Returns false on failure, true on success
bool delete_note (string $note, string $user, string $ngp)
  • string $note
  • string $user
  • string $ngp
delete_theme (line 1022)
void delete_theme ( $path)
  • $path
delete_user (line 436)

Deletes a user

Deletes a user from the database.

  • return: Returns false on failure, true on failure
bool delete_user (string $user)
  • string $user: The user to delete
edit_note (line 148)

Edits a note

Edits the specified note in the specified notegroup.

  • return: Returns true on success, false on failure
bool edit_note (string $note, string $contents, string $user, string $ngp)
  • string $note: The note to edit
  • string $contents: The new/updated contents of the note
  • string $user: The user that the note belongs to
  • string $ngp: The notegroup that the note belongs to
get_admin_group (line 831)

Returns the administrator group

Returns the administrator group. By default the administrator group is "admin", but it may have been changed.

  • return: The administrator group name
string get_admin_group ()
get_all_ban_lists (line 793)

Get the ban list

Gets the complete banlist

  • return: The complete banlist
Array(string) get_all_ban_lists ()
get_banlist (line 816)

Alias of get_all_ban_lists

Shorter alias of get_all_ban_lists.

  • return: The complete banlist
Array(string) get_banlist ()
get_desc (line 959)

Gets the site description

Gets the global site description.

  • return: The site description
string get_desc ()
get_ip_ban_list (line 754)

Gets the banlist (IP)

Gets the IP ban list.

  • return: The IP banlist
Array(string) get_ip_ban_list ()
get_mod_group (line 846)

Returns the moderator group

Returns the moderator group. By default the moderator group's name is "mod", but it may have been changed with set_mod_group.

  • return: The moderator group's name
string get_mod_group ()
get_sitename (line 926)

Gets the sitename

Gets the global sitename.

  • return: The global sitename
string get_sitename ()
get_theme (line 988)

Gets the site theme

Gets the global site theme.

  • return: The site theme
string get_theme ()
get_ua_ban_list (line 767)

Gets the banlist (UserAgent)

Gets the UserAgent ban list.

  • return: The UserAgent banlist
Array(string) get_ua_ban_list ()
get_user_ban_list (line 780)

Gets the banlist (users)

Gets the user ban list.

  • return: The user banlist
Array(string) get_user_ban_list ()
get_user_group (line 861)

Returns the user group

Returns the user group. By default the user group's name is "users", but it may have been changed with set_user_group.

  • return: The user group's name
string get_user_group ()
list_groups (line 271)

Lists all the notegroups of a user

Lists all the notegroups that belong to the specified user.

  • return: Array of all the notegroups, or false on failure
Array(string) list_groups (string $user)
  • string $user: The user to list the notegroups for
list_notes (line 244)

Lists all notes in the specified notegroup

Lists all notes in the specified notegroup.

  • return: Returns array of notes, or false on failure.
Array(string) list_notes (string $user, string $group)
  • string $user: The user
  • string $group: The notegroup to list
list_users (line 301)

Lists all users

Lists all the users in the current database.

  • return: List of all users
Array(string) list_users ()
publish_note (line 203)

Publishes the specified note

Publishes the specified note into the specfied webpage.

  • return: Returns false on failure, true on success
bool publish_note (string $note, string $group, string $user, [string $wfile = 'webpub.htm'])
  • string $note: The note to publish
  • string $group: The group of the note
  • string $wfile: The webpage to publish into
  • string $user: The user that the note belongs to
set_desc (line 941)

Sets the global site description

Sets the new global site description.

  • return: The old description
string set_desc (string $d)
  • string $d: The new description
set_mod_group (line 877)

Sets the moderator group

Sets the moderator group. Beware that any existing moderators will lose their permissions.

void set_mod_group (string $modgroup)
  • string $modgroup: The new moderator group's name
set_sitename (line 909)

Sets the global sitename

Sets the global sitename.

  • return: The old sitename
string set_sitename (string $sn)
  • string $sn: The new sitename
set_theme (line 974)

Sets the site theme

Sets the global site theme.

void set_theme (string $t)
  • string $t: The new site theme
set_user_group (line 892)

Sets the users group

Sets the users group's name. Be sure to update any existing users' group.

void set_user_group (string $usrgroup)
  • string $usrgroup: The new usergroup's name
theme_exists (line 1006)

Checks if a theme exists

Checks to see if the specified theme exists.

  • return: Returns true if the theme exists, false if the theme does not exist.
bool theme_exists (string $theme)
  • string $theme
unban_ip (line 531)

Unban an IP

Unbans an IP address from the banlist.

  • return: Returns false on failure, true on success and force mode
bool unban_ip (string $ip, [bool $force = false])
  • string $ip: The IP to unban/unblock
  • bool $force: Force the block? (supresses all errors, not recommended)
unban_user (line 653)

Unban an user

Unbans an user from the ban list

  • return: Returns true on success and force mode, false on failure
bool unban_user (string $user, [bool $force = false])
  • string $user: The user to unban
  • bool $force: Cover up errors?
unban_useragent (line 592)

Unban an user agent

Unbans an user agent from the ban list

  • return: Returns true on success and force mode, false on failure
bool unban_useragent (string $agent, [bool $force = false])
  • string $agent: The user agent to unban
  • bool $force: Cover up errors?
user_exists (line 321)

Checks to see if a user exists

Checks to see if the user exists in the database.

  • return: Returns true if the user exists, false if the user does not exist
bool user_exists (string $user)
  • string $user: The user to check

Documentation generated on Fri, 15 Aug 2008 08:39:32 -0400 by phpDocumentor 1.4.1