NAME

Yote::AppRoot - Application Server Base Objects

DESCRIPTION

This is the root class for all Yote Apps. Extend it to create an App Object.

Each Web Application has a single container object as the entry point to that object which is an instance of the Yote::AppRoot class. A Yote::AppRoot extends Yote::Obj and provides some class methods and the following stub methods.

PUBLIC API METHODS

account

Return the account that the user has with this app.

do_404
check_guest_token
create_login( args )

Create a login with the given client supplied args : h => handle, e => email, p => password. This checks to make sure handle and email address are not already taken. This is invoked by the javascript call $.yote.create_login( handle, password, email )

fetch
fetch_page
make_root
new_obj
new_root_obj
new_template
new_user_obj
precache

Meant to be overridden. Returns all data to the client or html page that the app in order to not need lazy loading.

recover_password( { e : email, u : a_url_the_person_requested_recovery, t : reset_url_for_system } )

Causes an email with a recovery link sent to the email in question, if it is associated with an account.

Returns the currently logged in account using this app.

recovery_reset_password( { p : newpassword, p2 : newpasswordverify, t : recovery_token } )

Resets the password ( kepts hashed in the database ) for the account that the recovery token belongs to. Returns the url_the_person_requested_recovery that was given in the recover_password call.

remove_account( { h : handle, e : email, p : password } )
remove_login( { h : handle, e : email, p : password } )

Purges the login account from the system if its credentials are verified. It moves the account to a special removed logins hidden field under the yote root.

token_login()

Returns a token that is used by the client and server to sync up data for the case of a user not being logged in.

validate( rand_token )

Validates and returns the login specified by the random token.

OVERRIDABLE METHODS

_init_account( $acct )

This is called whenever a new account is created for this app. This can be overridden to perform any initialzation on the account.

_new_account()

This returns a new Yote::Account object to be used with this app. May be overridden to return a subclass of Yote::Account.

PUBLIC DATA FIELDS

requires_validation

When true, an account will not work until validation of the login is achieved, through email or other means.

PRIVATE DATA FIELDS

_account_roots

This is a hash of login ID to account.

AUTHOR

Eric Wolf coyocanid@gmail.com http://madyote.com

LICENSE AND COPYRIGHT

Copyright (C) 2011 Eric Wolf

This module is free software; it can be used under the same terms as perl itself.