Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/inri/public_html/daCode-HEAD/daCode/src/phplib/users.php3
daCode -

User

User

Class to manage users

 

private class User

Class to manage users

daCode http://www.dacode.org/
src/phplib/users.php3
$Id: users.php3,v 1.301 2002/05/13 21:34:03 jbcombes Exp $

Depends: Config Db Html

AuthorsLaurent Desarmes <laurent@linuxfr.org>, Fabien Penso <penso@linuxfr.org>

 

Public Method Summary

void

User()

Class constructor
string

identity()

Display user information based on his parameter
mixed

get_infologin(string $login)

Get the user_id from users table
mixed

get_info([ integer $id ])

Get informations about a user
int

get_xp(int $id)

Get the user's experience
string

get_lastconnected([ integer $nb ])

Get last people connected (authentified people)
string

get_sessions(string $id)

Returns the sessions of a user
string

makerand([ integer $nb ])

Returns a random string
string

makepasswd([ integer $nb ])

Returns a random password
string

logintext()

Text displayed in authentication box
string

loginbox()

Sidebox to display when a user is logged succesfully.
integer

do_login(array $row)

Function used to log in
mixed

do_delete_sessions(array $row)

Delete a number of sessions

Private Method Summary

integer

ident(string $login, string $passwd)

Test if ident is right
mixed

newaccount(string $form)

Create a new account
string

show_forget()

Show form for people who forgot their password
mixed

send_password([ string $login, string $email ])

Send password to a user
string

get_sig(integer $id)

Get signature
string

print_setting()

Print table for settings
mixed

do_change_password(array $row)

Change password into DB
mixed

do_change_setting(array $row)

Change settigs into DB
string

show_email_form([ mixed $tempo_id ])

Get form to valid a change of user's email
string

show_email_valid(array $row)

Validate the change of a user's email
string

create_account_text()

Text to read before creating an account.
string

create_account([ mixed $table ])

Form to fill to create an account
string

lastseen_show(integer $timestamp)

This function show NEW if the lastseen is older than comments timestamp
void

show_userboxes([ string $boxes ])

This function show the user boxes

Private Field Summary

object Db

$db

Database abstraction layer
object Session

$session

Sessions handling instance
object Html

$html

HTML rendering package
object Ldap

$ldap

LDAP access package
integer

$user_id

Id of tohe current user
string

$fname

First name of user
string

$lname

Last name of user
string

$login

Login of user
string

$email

Email of current user
integer

$level

Credentials
integer

$param

Preferences
string

$timestamp

Dunno
string

$last

Lest visit (timestamp)
boolean

$checked

1 if logged
integer

$sig_id

ID of user's signature
string

$homesite

User's homesite
string

$signature

User's sig
boolean

$hide_sig

Whether the user wants to hide other's sigs
boolean

$skip_referer

Whether the user refuses check on HTTP_REFERER (unsafe!)
string

$password

Pasword the user has typed
mixed

$status

Unused??????? FIXME:
integer

$score

Score threshold
array

$supp_info

Array of supplementary infos
integer

$news_id

Id of current news FIXME:
string

$lastseen

Last time we've seen the user (timestamp)
boolean

$user_boxes

Whether user has chosen his boxes

Public Method Details

User

public void User( )

  Class constructor

Returns void


identity

public string identity( )

  Display user information based on his parameter

Returns string

login or first name / last name


get_infologin

public mixed get_infologin( string $login )

  Get the user_id from users table

Parameter
string $login
the login of the user
Returns mixed

Error message or HTML about the user


get_info

public mixed get_info( [ integer $id ] )

  Get informations about a user

Parameter
integer $id = >>0<<
the user_id of the user
Returns mixed

Error message or HTML if ok


get_xp

public int get_xp( int $id )

  Get the user's experience

Parameter
int $id
user_id of the user
Returns int

XP of the user


get_lastconnected

public string get_lastconnected( [ integer $nb ] )

  Get last people connected (authentified people)

Parameter
integer $nb = >>10<<
of last users connected
Returns string

html to be displayed


get_sessions

public string get_sessions( string $id )

  Returns the sessions of a user

Parameter
string $id
the session id
Returns string

the HTML to be displayed


makerand

public string makerand( [ integer $nb ] )

  Returns a random string

Parameter
integer $nb = >>8<<
the number of characters
Returns string

the random string


makepasswd

public string makepasswd( [ integer $nb ] )

  Returns a random password

Parameter
integer $nb = >>8<<
the number of characters
Returns string

the random password


logintext

public string logintext( )

  Text displayed in authentication box

Returns string

html to be displayed


loginbox

public string loginbox( )

  Sidebox to display when a user is logged succesfully.

Returns string

html to be displayed


do_login

public integer do_login( array $row )

  Function used to log in

Parameter
array $row
fields : login, passwd, time
Returns integer

1 if success, -1 else


do_delete_sessions

public mixed do_delete_sessions( array $row )

  Delete a number of sessions

Parameter
array $row
all the sessions
Returns mixed

exit if successfull, string (error message) if not.


Private Method Details

ident

private integer ident( string $login, string $passwd )

  Test if ident is right

Parameter
string $login
string $passwd
Returns integer

1 if success, 0 else


newaccount

private mixed newaccount( string $form )

  Create a new account

Parameter
string $form
Returns mixed

html to display or -1 if error


show_forget

private string show_forget( )

  Show form for people who forgot their password

Returns string

html simplebox to display


send_password

private mixed send_password( [ string $login, string $email ] )

  Send password to a user

Parameter
string $login = >>""<<
string $email = >>""<<
Returns mixed

html to display or -1 if error


get_sig

private string get_sig( integer $id )

  Get signature

Parameter
integer $id
id
Returns string

signature of the user


print_setting

private string print_setting( )

  Print table for settings

Returns string

html to display


do_change_password

private mixed do_change_password( array $row )

  Change password into DB

Parameter
array $row
oldpasswd, newpasswd, newpasswd2
Returns mixed

exit if successfull, string (error message) if not.


do_change_setting

private mixed do_change_setting( array $row )

  Change settigs into DB

Parameter
array $row
with settings
Returns mixed

exit if successfull, string (error message) if not.


show_email_form

private string show_email_form( [ mixed $tempo_id ] )

  Get form to valid a change of user's email

Parameter
mixed $tempo_id = >>""<<
user's id or empty string
Returns string

form if success, else error message.


show_email_valid

private string show_email_valid( array $row )

  Validate the change of a user's email

Parameter
array $row
users'id, password
Returns string

success or error message.


create_account_text

private string create_account_text( )

  Text to read before creating an account.

Returns string

the message to read.


create_account

private string create_account( [ mixed $table ] )

  Form to fill to create an account

Parameter
mixed $table = >>""<<
information to create account or empty string
Returns string

the form.


lastseen_show

private string lastseen_show( integer $timestamp )

  This function show NEW if the lastseen is older than comments timestamp

Parameter
integer $timestamp
Returns string

html of the NEW symbol


show_userboxes

private void show_userboxes( [ string $boxes ] )

  This function show the user boxes

Parameter
string $boxes = >>""<<
of boxes separated with ":"
Returns void


Private Field Details

$db

private object Db $db

>><<

Database abstraction layer


$session

private object Session $session

>><<

Sessions handling instance


$html

private object Html $html

>><<

HTML rendering package


$ldap

private object Ldap $ldap

>><<

LDAP access package


$user_id

private integer $user_id

>><<

Id of tohe current user


$fname

private string $fname

>><<

First name of user


$lname

private string $lname

>><<

Last name of user


$login

private string $login

>><<

Login of user


$email

private string $email

>><<

Email of current user


$level

private integer $level

>><<

Credentials


$param

private integer $param

>><<

Preferences


$timestamp

private string $timestamp

>><<

Dunno


$last

private string $last

>><<

Lest visit (timestamp)


$checked

private boolean $checked

>><<

1 if logged


$sig_id

private integer $sig_id

>><<

ID of user's signature


$homesite

private string $homesite

>><<

User's homesite


$signature

private string $signature

>><<

User's sig


$hide_sig

private boolean $hide_sig

>><<

Whether the user wants to hide other's sigs


$skip_referer

private boolean $skip_referer

>><<

Whether the user refuses check on HTTP_REFERER (unsafe!)


$password

private string $password

>><<

Pasword the user has typed


$status

private mixed $status

>><<

Unused??????? FIXME:


$score

private integer $score

>><<

Score threshold


$supp_info

private array $supp_info

>><<

Array of supplementary infos


$news_id

private integer $news_id

>><<

Id of current news FIXME:


$lastseen

private string $lastseen

>><<

Last time we've seen the user (timestamp)


$user_boxes

private boolean $user_boxes

>><<

Whether user has chosen his boxes



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta