FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Controller Class Reference

Main controller creates menu, handles changes in svn repository (database upgrade), ... More...

Inheritance diagram for Controller:
Accounts_Controller Acl_Controller Address_points_Controller Allowed_subnets_Controller Allowed_subnets_counts_Controller Approval_template_items_Controller Approval_templates_Controller Approval_types_Controller Aro_groups_Controller Bank_accounts_auto_down_settings_Controller Bank_accounts_Controller Bank_statements_Controller Bank_transfers_Controller Clouds_Controller Comments_Controller Connection_Requests_Controller Contacts_Controller Device_active_links_Controller Device_admins_Controller Device_engineers_Controller Device_logs_Controller Device_templates_Controller Devices_Controller Email_Controller Email_queues_Controller Enum_types_Controller Errors_Controller Export_Controller Fees_Controller Filter_queries_Controller Forgotten_password_Controller Ifaces_Controller Import_Controller Installation_Controller Invoice_items_Controller Invoices_Controller Ip_addresses_Controller Js_Controller Json_Controller Languages_Controller Links_Controller Log_queues_Controller Login_Controller Login_logs_Controller Logs_Controller Mail_messages_Controller Members_Controller Members_fees_Controller Members_whitelists_Controller Membership_interrupts_Controller Membership_transfers_Controller Messages_auto_settings_Controller Messages_Controller Monitoring_Controller Notifications_Controller Phone_invoices_Controller Phone_operators_Controller Private_phone_contacts_Controller Redirect_Controller Registration_Controller Requests_Controller Scheduler_Controller Search_Controller Settings_Controller Setup_config_Controller Sms_Controller Speed_classes_Controller Stats_Controller Streets_Controller Subnets_Controller Tools_Controller Towns_Controller Traffic_Controller Transfers_Controller Translations_Controller Unit_tester_Controller User_favourite_pages_Controller Users_Controller Users_keys_Controller Variable_Symbols_Controller Vlans_Controller VoIP_calls_Controller VoIP_Controller Votes_Controller Web_interface_Controller Work_reports_Controller Works_Controller

Public Member Functions

 __construct ()
 Contruct of controller, creates singleton or return it.
 is_user_in_group ($aro_group_id, $aro_id)
 Checks if user is in ARO group.
 acl_check_view ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may view all $axo_value object in $axo_section else return false.
 acl_check_edit ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may edit all $axo_value object in $axo_section else return false.
 acl_check_new ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may add all $axo_value object in $axo_section else return false.
 acl_check_delete ($axo_section, $axo_value, $member_id=NULL, $force_own=FALSE)
 Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may delete all $axo_value object in $axo_section else return false.
 build_menu ()
 Build menu.
 url ()
 Return URL for controller and method.
 redirect ($uri=NULL, $id=NULL, $glue= '/')
 Redirects to uri according to attribute noredirect.

Static Public Member Functions

static & instance ()
 Singleton instance of Controller.
static error ($message_type, $content=NULL)
 Function shows error of given message number.
static warning ($message_type, $content=NULL)
 Function shows warning of given message number.

Public Attributes

const ICON_ERROR = 1
const ICON_GOOD = 2
const ICON_HELP = 3
const ICON_INFO = 4
const ICON_WARNING = 5
 $arr
 $settings = NULL
 $popup = 0
 $dialog = 0
 $noredirect = FALSE
 $user_has_voip = 0
 $ip_address_span = ''
 $unread_user_mails = 0
 $count_of_unclosed_logged_errors = 0
 $devices_down_count = 0
 $user_favourites_pages = NULL
 $axo_doc_access = FALSE

Protected Member Functions

 is_preprocesor_enabled ()
 This methods defines whether the preprocessor of MY_Controller is loaded or not.

Protected Attributes

 $member_id
 $user_id
 $member_account_id = 1
 $session

Detailed Description

Main controller creates menu, handles changes in svn repository (database upgrade), ...

BE CAREFUL HERE, CATCH EVERY EXCEPTION, OTHERWISE FREENETIS WITH JUST SMALL ERROR BECOMES COMPLETELY UNUSABLE

Constructor & Destructor Documentation

Controller::__construct ( )

Member Function Documentation

Controller::acl_check_delete (   $axo_section,
  $axo_value,
  $member_id = NULL,
  $force_own = FALSE 
)

Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may delete all $axo_value object in $axo_section else return false.

Parameters
$axo_sectionGroup of objects to edit
$axo_valueObject to delete
$member_idOptional variable, id of other member who is being showed by logged member
boolean$force_ownForce to use own rules for not logged user Used at: Phone_invoices_Controller::user_field()
Returns
boolean Returns true if member has enough access rights
Controller::acl_check_edit (   $axo_section,
  $axo_value,
  $member_id = NULL,
  $force_own = FALSE 
)

Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may edit all $axo_value object in $axo_section else return false.

Parameters
$axo_sectionGroup of objects to edit
$axo_valueObject to edit
$member_idOptional variable, id of other member who is being showed by logged member
boolean$force_ownForce to use own rules for not logged user Used at: Phone_invoices_Controller::user_field()
Returns
boolean Returns true if member has enough access rights
Controller::acl_check_new (   $axo_section,
  $axo_value,
  $member_id = NULL,
  $force_own = FALSE 
)

Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may add all $axo_value object in $axo_section else return false.

Parameters
$axo_sectionGroup of objects to edit
$axo_valueObject to add
$member_idOptional variable, id of other member who is being showed by logged member
boolean$force_ownForce to use own rules for not logged user Used at: Phone_invoices_Controller::user_field()
Returns
boolean Returns true if member has enough access rights
Controller::acl_check_view (   $axo_section,
  $axo_value,
  $member_id = NULL,
  $force_own = FALSE 
)

Fuction checks access rights Return true if currently logged user (stored in $_SESSION['user_id']) may view own $axo_value object in $axo_section (and in variable $member_id is his own id of member) or if currently logged user may view all $axo_value object in $axo_section else return false.

Parameters
$axo_sectionGroup of objects to view
$axo_valueObject to view
$member_idOptional variable, id of other member who is being showed by logged member
boolean$force_ownForce to use own rules for not logged user Used at: Phone_invoices_Controller::user_field()
Returns
boolean returns true if member has enough access rights
Controller::build_menu ( )

Build menu.

Author
Michal Kliment
Returns
Menu_builder
Exceptions
Exception
Todo:
Add own AXO
Todo:
Add own AXO
Todo:
Add own AXO
static Controller::error (   $message_type,
  $content = NULL 
)
static

Function shows error of given message number.

Parameters
integer$message_type
string$content
static& Controller::instance ( )
static

Singleton instance of Controller.

Author
Michal Kliment
Returns
Controller object
Controller::is_preprocesor_enabled ( )
protected

This methods defines whether the preprocessor of MY_Controller is loaded or not.

By default preprocessor is loaded, for changing of this state this method should be overriden in child class. (#328)

Author
Ondřej Fibich
Returns
boolean Is preprocessor loaded?

Reimplemented in Js_Controller, Json_Controller, and Web_interface_Controller.

Controller::is_user_in_group (   $aro_group_id,
  $aro_id 
)

Checks if user is in ARO group.

Author
Ondřej Fibich
Parameters
integer$group_idARO group ID
integer$aro_idUser ID
Returns
boolean true if exists false otherwise
Controller::redirect (   $uri = NULL,
  $id = NULL,
  $glue = '/' 
)

Redirects to uri according to attribute noredirect.

Author
Michal Kliment
Parameters
string$uri
integer$id[optional]
string$glue[optional]
Controller::url ( )

Return URL for controller and method.

Author
Michal Kliment
Parameters
string$method
string$controller
Returns
string
static Controller::warning (   $message_type,
  $content = NULL 
)
static

Function shows warning of given message number.

Parameters
integer$message_type
string$content

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