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

Class: User

Source Location: /lib/class/user.class.php

Class Overview

database_object
   |
   --User

User Class


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 27]
User Class

This class handles all of the user related functions includingn the creationg and deletion of the user objects from the database by defualt you constrcut it with a user_id from user.id




[ Top ]


Class Variables

$access =

[line 33]



Tags:

access:  public

Type:   mixed


[ Top ]

$create_date =

[line 37]



Tags:

access:  public

Type:   mixed


[ Top ]

$disabled =

[line 34]



Tags:

access:  public

Type:   mixed


[ Top ]

$email =

[line 35]



Tags:

access:  public

Type:   mixed


[ Top ]

$fullname =

[line 32]



Tags:

access:  public

Type:   mixed


[ Top ]

$id =

[line 30]



Tags:

access:  public

Type:   mixed


[ Top ]

$last_seen =

[line 36]



Tags:

access:  public

Type:   mixed


[ Top ]

$prefs = array()

[line 41]



Tags:

access:  public

Type:   mixed


[ Top ]

$username =

[line 31]



Tags:

access:  public

Type:   mixed


[ Top ]

$validation =

[line 38]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


static method check_username [line 1061]

static void check_username( $username)

check_username

This checks to make sure the username passed doesn't already exist in this instance of ampache




Tags:

access:  public


Parameters:

   $username  

[ Top ]

static method create [line 611]

static void create( $username, $fullname, $email, $password, $access)

create

inserts a new user into ampache




Tags:

access:  public


Parameters:

   $username  
   $fullname  
   $email  
   $password  
   $access  

[ Top ]

static method fix_preferences [line 776]

static void fix_preferences( $user_id)

fix_preferences

This is the new fix_preferences function, it does the following Remove Duplicates from user, add in missing If -1 is passed it also removes duplicates from the `preferences` table.




Tags:

access:  public


Parameters:

   $user_id  

[ Top ]

static method get_from_username [line 117]

static void get_from_username( $username)

get_from_username

This returns a built user from a username. This is a static function so it doesn't require an instance




Tags:

access:  public


Parameters:

   $username  

[ Top ]

static method get_validation [line 958]

static void get_validation( $username)

get_user_validation if user exists before activation can be done.



Tags:

access:  public


Parameters:

   $username  

[ Top ]

static method rebuild_all_preferences [line 1080]

static void rebuild_all_preferences( )

rebuild_all_preferences

This rebuilds the user preferences for all installed users, called by the plugin functions




Tags:

access:  public


[ Top ]

constructor __construct [line 48]

User __construct( [ $user_id = 0])

Constructor

This function is the constructor object for the user class, it currently takes a username




Tags:

access:  public


Parameters:

   $user_id  

[ Top ]

method activate_user [line 1028]

void activate_user( $username)



Tags:

access:  public


Parameters:

   $username  

[ Top ]

method delete [line 871]

void delete( )

delete

deletes this user and everything assoicated with it. This will affect ratings and tottal stats




Tags:

access:  public


[ Top ]

method delete_stats [line 859]

void delete_stats( )



[ Top ]

method disable [line 472]

void disable( )

disable

This disables the current user




Tags:

access:  public


[ Top ]

method enable [line 495]

void enable( )

enable

this enables the current user




Tags:

access:  public


[ Top ]

method format [line 660]

void format( )

format

This function sets up the extra variables we need when we are displaying a user for an admin, these should not be normally called when creating a user object




Tags:

access:  public


[ Top ]

method format_favorites [line 711]

void format_favorites( $items)

format_favorites

takes an array of objects and formats them corrrectly and returns a simply array with just <a href values




Tags:

access:  public


Parameters:

   $items  

[ Top ]

method format_recommendations [line 739]

void format_recommendations( $items, $type)

format_recommendations

This takes an array of [object_id] = ratings and displays them in a semi-pretty format




Parameters:

   $items  
   $type  

[ Top ]

method get_catalogs [line 135]

void get_catalogs( )

get_catalogs

This returns the catalogs as an array of ids that this user is allowed to access




Tags:

access:  public


[ Top ]

method get_favorites [line 220]

void get_favorites( $type)

get_favorites

returns an array of your $type favorites




Parameters:

   $type  

[ Top ]

method get_ip_history [line 997]

void get_ip_history( [ $count = ''], [ $distinct = ''])

get_ip_history

This returns the ip_history from the last Config::get('user_ip_cardinality') days




Tags:

access:  public


Parameters:

   $count  
   $distinct  

[ Top ]

method get_preferences [line 163]

void get_preferences( [ $user_id = 0], [ $type = 0])

get_preferences

This is a little more complicate now that we've got many types of preferences This funtions pulls all of them an arranges them into a spiffy little array You can specify a type to limit it to a single type of preference []['title'] = ucased type name []['prefs'] = array(array('name','display','value')); []['admin'] = t/f value if this is an admin only section




Parameters:

   $user_id  
   $type  

[ Top ]

method get_recently_played [line 976]

void get_recently_played( $limit, [ $type = ''])

get_recently_played

This gets the recently played items for this user respecting the limit passed




Tags:

access:  public


Parameters:

   $limit  
   $type  

[ Top ]

method get_recommendations [line 272]

void get_recommendations( $type)

get_recommendations This returns recommended objects of $type. The recommendations are based on voodoo economics,the phase of the moon and my current BAL.



Parameters:

   $type  

[ Top ]

method has_access [line 360]

void has_access( $needed_level)

has_access

this function checkes to see if this user has access to the passed action (pass a level requirement)




Parameters:

   $needed_level  

[ Top ]

method insert_ip_history [line 577]

void insert_ip_history( )

insert_ip_history

This inserts a row into the IP History recording this user at this address at this time in this place, doing this thing.. you get the point




Tags:

access:  public


[ Top ]

method is_logged_in [line 338]

void is_logged_in( )

is_logged_in

checks to see if $this user is logged in returns their current IP if they are logged in




Tags:

access:  public


[ Top ]

method is_online [line 948]

void is_online( [ $delay = 1200])

is_online

delay how long since last_seen in seconds default of 20 min calcs difference between now and last_seen if less than delay, we consider them still online




Tags:

access:  public


Parameters:

   $delay  

[ Top ]

method is_xmlrpc [line 1042]

void is_xmlrpc( )



[ Top ]

method load_playlist [line 104]

void load_playlist( )

load_playlist

This is called once per page load it makes sure that this session has a tmp_playlist, creating it if it doesn't, then sets $this->playlist as a tmp_playlist object that can be fiddled with later on




Tags:

access:  public


[ Top ]

method set_preferences [line 202]

void set_preferences( )

set_preferences

sets the prefs for this specific user




Tags:

access:  public


[ Top ]

method update [line 376]

void update( $data)

update

This function is an all encompasing update function that calls the mini ones does all the error checking and all that good stuff




Tags:

access:  public


Parameters:

   $data  

[ Top ]

method update_access [line 508]

void update_access( $new_access)

update_access

updates their access level




Tags:

access:  public


Parameters:

   $new_access  

[ Top ]

method update_email [line 460]

void update_email( $new_email)

update_email

updates their email address




Tags:

access:  public


Parameters:

   $new_email  

[ Top ]

method update_fullname [line 448]

void update_fullname( $new_fullname)

update_fullname

updates their fullname




Tags:

access:  public


Parameters:

   $new_fullname  

[ Top ]

method update_last_seen [line 527]

void update_last_seen( )



[ Top ]

method update_password [line 641]

void update_password( $new_password)

update_password

updates a users password




Tags:

access:  public


Parameters:

   $new_password  

[ Top ]

method update_stats [line 538]

void update_stats( $song_id)

update_user_stats

updates the playcount mojo for this specific user




Tags:

access:  public


Parameters:

   $song_id  

[ Top ]

method update_username [line 418]

void update_username( $new_username)

update_username

updates their username




Tags:

access:  public


Parameters:

   $new_username  

[ Top ]

method update_validation [line 433]

void update_validation( $new_validation)

update_validation

This is used by the registration mumbojumbo Use this function to update the validation key NOTE: crap this doesn't have update_item the humanity of it all




Tags:

access:  public


Parameters:

   $new_validation  

[ Top ]


Documentation generated on Thu, 12 Feb 2009 08:00:11 +0900 by phpDocumentor 1.4.2