PureUserAdmin
[ class tree: PureUserAdmin ] [ index: PureUserAdmin ] [ all elements ]

Class: pureuseradmin

Source Location: /pureuserclass.php

Class Overview


Manage virtual users for PureFTPd.


Author(s):

Version:

  • 0.2.0

Copyright:

  • Copyright 2004, Michiel van Baak

Variables

Constants

Methods



Class Details

[line 14]
Manage virtual users for PureFTPd.

This class provides every function you need to manage virtual users. It can handle users stored in a MySQL or PostgreSQL database.




Tags:

copyright:  Copyright 2004, Michiel van Baak
author:  Michiel van Baak <mvanbaak@users.sourceforge.net>
link:  Project home.
license:  GPL
version:  0.2.0


[ Top ]


Class Variables

$gids = array()

[line 34]

This variable is filled in the constructor.



Tags:

var:  gids on the system.
access:  public

Type:   array


[ Top ]

$settings = array()

[line 22]

This variable is filled in the constructor. It can be changed with a public function.



Tags:

var:  all settings needed
access:  public

Type:   array


[ Top ]

$uids = array()

[line 28]

This variable is filled in the constructor.



Tags:

var:  uids on the system.
access:  public

Type:   array


[ Top ]



Class Methods


constructor __construct [line 153]

pureuseradmin __construct( )

Class constructor

This function is called as soon as an instance of the class is created. It will init the settings, connect to the database and load the uids and gids on the system.

  1. $instance = new pureuseradmin();




Tags:

access:  protected


[ Top ]

method changeSetting [line 198]

void changeSetting( string $setting, string $value)

Overwrite a predefined setting,

  1. $instance->changeSetting("setting", "value");




Tags:

access:  public


Parameters:

string   $setting   The setting to overwrite.
string   $value   The new value.

[ Top ]

method check_access [line 310]

array check_access( string $homedir, int $uid, int $gid)

Check what type of access the user has.

  1. $permission = $instance->check_access("/home/test",1001,1001);




Tags:

return:  owner,group,world octal permission and read and write flag.
access:  public


Parameters:

string   $homedir   The home directory of the user processed.
int   $uid   The main userid of the user.
int   $gid   The main groupid of the user.

[ Top ]

method db_init [line 65]

void db_init( )

Database connection

Make connection to the database server, select the right database and include the file with database specific functions.

  1. self::dbinit();




Tags:

access:  private


[ Top ]

method delete_user [line 265]

boolean delete_user( array $userinfo)

Delete a user from the database.

  1. $result = $instance->delete_user($userinfo);




Tags:

return:  true when success, false on error.
access:  public


Parameters:

array   $userinfo  

[ Top ]

method get_all_users [line 291]

array get_all_users( )

Get all users from the database, in alphabetic order.

  1. $userlist = $instance->get_all_users();




Tags:

return:  All users with all info that is in the database.
access:  public


[ Top ]

method get_user [line 278]

array get_user( array $userinfo)

Get a user from the database.

  1. $userlist = $instance->get_user($userinfo);




Tags:

return:  A user with all info that is in the database.
access:  public


Parameters:

array   $userinfo  

[ Top ]

method load_gids [line 135]

array load_gids( )

Load all the gids and groupnames on the system.

  1. self::load_gids();




Tags:

return:  gids as key and groupnames as value.
access:  private


[ Top ]

method load_sql [line 85]

void load_sql( string $sql_type)

PHP database support

Check wether the needed database module is loaded as php module. If not, try to load it now.

  1. self::load_sql($sql_type);




Tags:

access:  private


Parameters:

string   $sql_type   database server type. "mysql" or "postgres"

[ Top ]

method load_uids [line 119]

array load_uids( )

Load all the uids and usernames on the system.

  1. self::load_uids();




Tags:

return:  uids as key and usernames as value.
access:  private


[ Top ]

method mkpass [line 43]

string mkpass( string $passwd)

Generate a password statement for the database query.

  1. $pass = self::mkpass("password");




Tags:

return:  The string to use in the sql statement.
access:  private


Parameters:

string   $passwd   The password to insert into the database.

[ Top ]

method save_user [line 209]

boolean save_user( array $userinfo)

Save a user in the database.

  1. $result = $instance->save_user($userinfo);




Tags:

return:  true when success, false on error.
access:  public


Parameters:

array   $userinfo  

[ Top ]


Class Constants

DEBUG =  0

[line 16]


[ Top ]



Documentation generated on Sun, 3 Oct 2004 21:52:31 +0200 by phpDocumentor 1.3.0RC3