NAME

Yote::YoteRoot

DESCRIPTION

This is the first object and the root of the object graph. It stores user logins and stores the apps themselves.

PUBLIC API METHODS

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 )

cron

Returns the cron. Only a root login may call this.

disable_account( account_to_be_disabled, logged_in_account )

Marks the _is_disabled flag for the account to be disabled. Throws access exception unless the logged_in_account is a root one.

disable_login( login_to_be_disabled, logged_in_account )

Marks the _is_disabled flag for the login to be disabled. Throws access exception unless the logged_in_account is a root one.

enable_account( account_to_be_enabled, logged_in_account )

Removes the _is_disabled flag for the account to be enabled. Throws access exception unless the logged_in_account is a root one.

enable_login( login_to_be_enabled, logged_in_account )

Removes the _is_disabled flag for the login to be enabled. Throws access exception unless the logged_in_account is a root one.

fetch( id_list )

Returns the list of the objects to the client provided the client is authroized to receive them.

fetch_app_by_class( package_name )

Returns the app object singleton of the given package name.

fetch_root( package_name )

Returns the singleton root object. It creates it if it has not been created.

guest_token

Creates and returns a guest token, associating it with the calling IP address.

login( { h: handle, p : password } )

Attempts to log the account in with the given credentials. Returns a data structre with the login token and the login object.

logout

Invalidates the tokens of the currently logged in user.

make_root

Takes a login as an argument and makes it root. Throws access error if the callee is not root.

new_obj( optional_data_hash )

Returns a new yote object, initialized with the optional has reference.

new_root_obj( optional_data_hash )

Returns a new root yote object, initialized with the optional has reference.

new_user_obj( optional_data_hash )

Returns a new user yote object, initialized with the optional has reference.

init - takes a hash of args, passing them to a new Yote::SQLite object and starting it up.
purge_app

This method may only be invoked by a login with the root bit set. This clears out the app entirely.

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.

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_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.

remove_root( login )

Removes the root bit from the login.

PRIVATE DATA FIELDS

_apps

Hash of classname to app singleton.

_emails

Hash of email to login object.

_handles

Hash of handle to login object.

_crond

A singleton instance of the Cron.

_application_lib_directories

A list of directories that Yote will use to look for perl packages.

__ALLOWS

A hash of recipient ids to a hash of objects ids whos clients are allowed to access this object.

__ALLOWS_REV

A hash of object ids to a hash of recipient ibds whos clients are allowed to access this object.

__DIRTY

A hash of recipient ids to a hash of objects ids that need refreshing for that recipient.

_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) 2012 Eric Wolf

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