The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
account.php File Reference

Somme account related functions. More...

Functions

 get_account_by_id ($account_id)
 
 check_account_email ($email)
 
 check_account_password ($password)
 
 check_account_invite ($invite_code)
 
 check_account_admin ($arr)
 
 account_total ()
 
 account_store_lowlevel ($arr)
 
 create_account ($arr)
 
 verify_email_address ($arr)
 
 send_reg_approval_email ($arr)
 
 send_register_success_email ($email, $password)
 
 account_allow ($hash)
 Allows a user registration. More...
 
 account_deny ($hash)
 Denies an account registration. More...
 
 account_approve ($hash)
 
 downgrade_accounts ()
 Checks for accounts that have past their expiration date. More...
 
 service_class_allows ($uid, $property, $usage=false)
 Check service_class restrictions. More...
 
 account_service_class_allows ($aid, $property, $usage=false)
 Check service class restrictions by account. More...
 
 service_class_fetch ($uid, $property)
 Queries a service class value for a channel and property. More...
 
 account_service_class_fetch ($aid, $property)
 Queries a service class value for an account and property. More...
 
 upgrade_link ($bbcode=false)
 
 upgrade_message ($bbcode=false)
 
 upgrade_bool_message ($bbcode=false)
 
 get_account_techlevel ($account_id=0)
 

Detailed Description

Somme account related functions.

Function Documentation

account_allow (   $hash)

Allows a user registration.

Parameters
string$hash
Returns
array|boolean

Referenced by Zotlabs\Module\Regmod\get(), and Zotlabs\Module\Admin\Accounts\post().

account_approve (   $hash)
account_deny (   $hash)

Denies an account registration.

This does not have to go through user_remove() and save the nickname permanently against re-registration, as the person was not yet allowed to have friends on this system

Parameters
string$hash
Returns
boolean

Referenced by Zotlabs\Module\Regver\get(), Zotlabs\Module\Regmod\get(), and Zotlabs\Module\Admin\Accounts\post().

account_service_class_allows (   $aid,
  $property,
  $usage = false 
)

Check service class restrictions by account.

If there are no service_classes defined, everything is allowed. If $usage is supplied, we check against a maximum count and return true if the current usage is less than the subscriber plan allows. Otherwise we return boolean true or false if the property is allowed (or not) in this subscriber plan. An unset property for this service plan means the property is allowed, so it is only necessary to provide negative properties for each plan, or what the subscriber is not allowed to do.

Like service_class_allows() but queries directly by account rather than channel.

See Also
service_class_allows() if you have a channel_id instead of an account_id
account_service_class_fetch()
Parameters
int$aidThe account_id to check
string$propertyThe service class property to check for
int | boolean$usage(optional) The value to check against
Returns
boolean

Referenced by identity_check_service_class().

account_service_class_fetch (   $aid,
  $property 
)

Queries a service class value for an account and property.

Like service_class_fetch() but queries by account rather than channel.

See Also
service_class_fetch() if you have channel_id.
account_service_class_allows()
Parameters
int$aidThe account_id to query
string$propertyThe service property name to check for
Returns
boolean|int

Referenced by account_service_class_allows(), Zotlabs\Module\Manage\get(), Zotlabs\Module\New_channel\get(), Zotlabs\Module\Import\import_account(), and process_channel_sync_delivery().

account_store_lowlevel (   $arr)

Referenced by create_account().

account_total ( )

Referenced by create_account(), and zot_site_info().

check_account_admin (   $arr)

Referenced by create_account().

check_account_email (   $email)
check_account_invite (   $invite_code)
check_account_password (   $password)
create_account (   $arr)
downgrade_accounts ( )

Checks for accounts that have past their expiration date.

If the account has a service class which is not the site default, the service class is reset to the site default and expiration reset to never. If the account has no service class it is expired and subsequently disabled. called from include/poller.php as a scheduled task.

Reclaiming resources which are no longer within the service class limits is not the job of this function, but this can be implemented by plugin if desired. Default behaviour is to stop allowing additional resources to be consumed.

Referenced by Zotlabs\Daemon\Cron_daily\run().

get_account_by_id (   $account_id)

Referenced by get_account_techlevel().

send_reg_approval_email (   $arr)
send_register_success_email (   $email,
  $password 
)
service_class_allows (   $uid,
  $property,
  $usage = false 
)

Check service_class restrictions.

If there are no service_classes defined, everything is allowed. If $usage is supplied, we check against a maximum count and return true if the current usage is less than the subscriber plan allows. Otherwise we return boolean true or false if the property is allowed (or not) in this subscriber plan. An unset property for this service plan means the property is allowed, so it is only necessary to provide negative properties for each plan, or what the subscriber is not allowed to do.

Like account_service_class_allows() but queries directly by account rather than channel. Service classes are set for accounts, so we look up the account for the channel and fetch the service class restrictions of the account.

See Also
account_service_class_allows() if you have a channel_id already
service_class_fetch()
Parameters
int$uidThe channel_id to check
string$propertyThe service class property to check for
string | boolean$usage(optional) The value to check against
Returns
boolean

Referenced by Zotlabs\Module\Item\item_check_service_class(), and new_contact().

service_class_fetch (   $uid,
  $property 
)

Queries a service class value for a channel and property.

Service classes are set for accounts, so look up the account for this channel and fetch the service classe of the account.

If no service class is available it returns false and everything should be allowed.

See Also
account_service_class_fetch()
Parameters
int$uidThe channel_id to query
string$propertyThe service property name to check for
Returns
boolean|int
Todo:
Should we merge this with account_service_class_fetch()?

Referenced by attach_store(), Zotlabs\Lib\Chatroom\create(), Zotlabs\Lib\Chatroom\enter(), Zotlabs\Module\Photos\get(), Zotlabs\Module\Item\item_check_service_class(), photo_upload(), Zotlabs\Module\Settings\Tokens\post(), process_channel_sync_delivery(), Zotlabs\Daemon\Poller\run(), Zotlabs\Daemon\Expire\run(), service_class_allows(), and Zotlabs\Widget\Follow\widget().

upgrade_bool_message (   $bbcode = false)
upgrade_link (   $bbcode = false)
verify_email_address (   $arr)