FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Message_Model Class Reference
Inheritance diagram for Message_Model:
ORM

Public Member Functions

 count_all_redirections ($filter_sql= '')
 Counts all activated redirections from junction table messages_ip_addresses.
 get_all_redirections ($limit_from=0, $limit_results=20, $order_by= 'ip_address', $order_by_direction= 'ASC', $filter_sql= '')
 Gets all activated redirections from junction table messages_ip_addresses.
 count_all_messages ($filter_sql= '')
 Counts all messages.
 get_all_messages ($limit_from=0, $limit_results=20, $order_by= 'id', $order_by_direction= 'asc', $filter_sql= '')
 Gets all redirection messages.
 activate_test_connection_end_message ($user_id)
 Deny ip addresses with expired test connections.
 activate_unallowed_connecting_place_message ($user_id)
 Activates notifications for ip addresses with unallowed connecting place.
 deactivate_message ($message_id)
 Deactivates all redirections of given message.
 get_message_by_type ($type)
 Returns message by given type.
 get_message_id_by_type ($type)
 Returns id of message by given type.

Static Public Member Functions

static get_types ()
 Returns all message's types.
static get_self_cancel_messages ($translate=TRUE)
 Gets set of self cancel messages.
static is_self_cancable ($type)
 Check if message may be self cancable.
static is_white_list_ignorable ($type)
 Check if message may ignore the white list.
static is_special_message ($type)
 Check if message is special message.
static has_redirection_content ($type)
 Check if message contains redirection content.
static has_email_content ($type)
 Check if message contains email content.
static has_sms_content ($type)
 Check if message contains sms content.
static can_be_activate_directly ($type)
 Check if message can be activated directly.
static can_be_activate_automatically ($type)
 Check if message can be activated manually.
static activate_special_notice ($type, $member_id, $user_id, $email, $sms, $comment=NULL)
 Activates notice messages (only e-mail and sometimes also SMS) for accept payment notice, approoving/refusing of application for membership to a single member.
static activate_redirection (Message_Model $message, $ips, $user_id=NULL, $comment=NULL)
 Activate redirection for given IPs.
static send_emails (Message_Model $message, $contacts, $comment=NULL)
 Send emails with redirection message to given contacts.
static send_email (Message_Model $message, $email, $object=NULL, $push=FALSE)
 Generic function to send e-mail.
static send_sms_messages (Message_Model $message, $contacts, $user_id=NULL, $comment=NULL)
 Send SMS messages with redirection message to given contacts.

Public Attributes

const USER_MESSAGE = 0
 user message, can be added and deleted by user
const CONTACT_INFORMATION = 1
 not exactly message, it is content of side panel, should be used for information for all redirections
const CANCEL_MESSAGE = 2
 content of page shown after canceling redirection
const UNKNOWN_DEVICE_MESSAGE = 3
 content of page with text for unknown device
const INTERRUPTED_MEMBERSHIP_MESSAGE = 4
 content of page for interrupted member, this redirection can be set in system
const DEBTOR_MESSAGE = 5
 content of page for debtor, this redirection can be set in system
const PAYMENT_NOTICE_MESSAGE = 6
 content of page for payment notice, this redirection can be set in system and can be canceled by user
const UNALLOWED_CONNECTING_PLACE_MESSAGE = 7
 content of page for unallowed connecting place, depends on allowed subnets
const RECEIVED_PAYMENT_NOTICE_MESSAGE = 8
 content of page for received payment notice
const APPLICANT_APPROVE_MEMBERSHIP = 9
 content of page for approved application for membership
const APPLICANT_REFUSE_MEMBERSHIP = 10
 content of page for refused application for membership
const CONNECTION_REQUEST_APPROVE = 11
 content of page for approved request for connection
const CONNECTION_REQUEST_REFUSE = 12
 content of page for refused request for connection
const CONNECTION_REQUEST_INFO = 13
 content of page for information about request for connection
const MONITORING_HOST_DOWN = 14
 content of page for information about host down in monitoring
const MONITORING_HOST_UP = 15
 content of page for information about host up in monitoring
const CONNECTION_TEST_EXPIRED = 16
 content of page for information about connection test expiration
const INTERRUPTED_MEMBERSHIP_BEGIN_NOTIFY_MESSAGE = 17
 notification e-mail message that is sended to a interupted member at the start of his interuption
const INTERRUPTED_MEMBERSHIP_END_NOTIFY_MESSAGE = 18
 notification e-mail message that is sended to a interupted member at the end of his interuption
const FORMER_MEMBER_MESSAGE = 19
 content of page for information about former membership e-mail content of this message is send to the former member at the day when the end membership begins
const SELF_CANCEL_DISABLED = 0
 self cancel disabled, remote computer cannot cancel this message
const SELF_CANCEL_MEMBER = 1
 self cancel enabled, every member's IP address will have cancelled given redirection
const SELF_CANCEL_IP = 2
 self cancel enabled, redirection is canceled only for current remote computer

Member Function Documentation

static Message_Model::activate_redirection ( Message_Model  $message,
  $ips,
  $user_id = NULL,
  $comment = NULL 
)
static

Activate redirection for given IPs.

Parameters
Message_Model$messageMessage to redirect
Mysql_Result$ipsIPs to redirect
mixed$user_idID of who added redirection or NULL
string$commentComment
Returns
integer Number of redirected IPs
Exceptions
ExceptionOn error
static Message_Model::activate_special_notice (   $type,
  $member_id,
  $user_id,
  $email,
  $sms,
  $comment = NULL 
)
static

Activates notice messages (only e-mail and sometimes also SMS) for accept payment notice, approoving/refusing of application for membership to a single member.

Author
Ondřej Fibich
Parameters
integer$type8 => payment, 9 => application approve, 10 => application refuse
integer$member_idMember ID
integer$user_idWho redirects
integer$emailE-mail state
integer$smsSMS state
string$commentComment for member
Returns
boolean Notification made?
Message_Model::activate_test_connection_end_message (   $user_id)

Deny ip addresses with expired test connections.

See Also
Scheduler_Controller::update_applicant_connection_test
Author
Ondrej Fibich
Parameters
integer$user_idWho redirects
Message_Model::activate_unallowed_connecting_place_message (   $user_id)

Activates notifications for ip addresses with unallowed connecting place.

Author
Michal Kliment
Parameters
integer$user_idWho redirects
Returns
integer Number of ip addresses activated
static Message_Model::can_be_activate_automatically (   $type)
static

Check if message can be activated manually.

Parameters
integer$typeMessage type
Returns
boolean
static Message_Model::can_be_activate_directly (   $type)
static

Check if message can be activated directly.

Author
Ondřej Fibich
Parameters
integer$typeType of message
Returns
boolean
Message_Model::count_all_messages (   $filter_sql = '')

Counts all messages.

Returns
integer
Message_Model::count_all_redirections (   $filter_sql = '')

Counts all activated redirections from junction table messages_ip_addresses.

Author
Jiri Svitak, Ondrej Fibich
Returns
integer
Message_Model::deactivate_message (   $message_id)

Deactivates all redirections of given message.

Author
Jiri Svitak
Parameters
integer$message_id
Returns
integer Count of deactivated IPs
Message_Model::get_all_messages (   $limit_from = 0,
  $limit_results = 20,
  $order_by = 'id',
  $order_by_direction = 'asc',
  $filter_sql = '' 
)

Gets all redirection messages.

Author
Jiri Svitak
Parameters
integer$limit_from
integer$limit_results
string$order_by
string$order_by_direction
array$filter_values
Returns
Mysql_Result
Message_Model::get_all_redirections (   $limit_from = 0,
  $limit_results = 20,
  $order_by = 'ip_address',
  $order_by_direction = 'ASC',
  $filter_sql = '' 
)

Gets all activated redirections from junction table messages_ip_addresses.

Returns
Mysql_Result
Message_Model::get_message_by_type (   $type)

Returns message by given type.

Parameters
integer$type
Returns
Message_Model
Message_Model::get_message_id_by_type (   $type)

Returns id of message by given type.

Author
Michal Kliment
Parameters
integer$type
Returns
integer
static Message_Model::get_self_cancel_messages (   $translate = TRUE)
static

Gets set of self cancel messages.

Author
Ondřej Fibich
Parameters
bool$translateTranslate messages
Returns
array
static Message_Model::get_types ( )
static

Returns all message's types.

Author
Michal Kliment
Returns
type
static Message_Model::has_email_content (   $type)
static

Check if message contains email content.

Author
Ondřej Fibich
Parameters
integer$typeType of message
Returns
boolean
static Message_Model::has_redirection_content (   $type)
static

Check if message contains redirection content.

Author
Ondřej Fibich
Parameters
integer$typeType of message
Returns
boolean
static Message_Model::has_sms_content (   $type)
static

Check if message contains sms content.

Author
Ondřej Fibich
Parameters
integer$typeType of message
Returns
boolean
static Message_Model::is_self_cancable (   $type)
static

Check if message may be self cancable.

Author
Ondřej Fibich
Parameters
integer$typeType of message
Returns
boolean
static Message_Model::is_special_message (   $type)
static

Check if message is special message.

Author
Ondřej Fibich
Parameters
integer$typeType of message
Returns
boolean
static Message_Model::is_white_list_ignorable (   $type)
static

Check if message may ignore the white list.

Author
Ondřej Fibich
Parameters
integer$typeType of message
Returns
boolean
static Message_Model::send_email ( Message_Model  $message,
  $email,
  $object = NULL,
  $push = FALSE 
)
static

Generic function to send e-mail.

Author
Michal Kliment klime.nosp@m.nt@f.nosp@m.reene.nosp@m.tis..nosp@m.org
Parameters
Message_Model$messageMessage which will be send
string$emailE-mail address where send e-mail
mixed$objectGeneric object to autofill message variables
boolean$pushWhether message will be push on top of queue
Exceptions
Exception
static Message_Model::send_emails ( Message_Model  $message,
  $contacts,
  $comment = NULL 
)
static

Send emails with redirection message to given contacts.

Parameters
Message_Model$messageMessage to send
Mysql_Result$contactsContacts to send
string$commentComment
Returns
integer Number of sended emails
Exceptions
ExceptionOn error
static Message_Model::send_sms_messages ( Message_Model  $message,
  $contacts,
  $user_id = NULL,
  $comment = NULL 
)
static

Send SMS messages with redirection message to given contacts.

Parameters
Message_Model$messageMessage to send
Mysql_Result$contactsContacts to send
mixed$user_idID of who added redirection or NULL
string$commentComment
Returns
integer Number of sended SMS
Exceptions
ExceptionOn error

The documentation for this class was generated from the following file: