Revize 2092
Přidáno uživatelem David Raška před více než 11 roky(ů)
freenetis/branches/1.1/application/controllers/acl.php | ||
---|---|---|
$page_word = 'page', $page = 1)
|
||
{
|
||
// check access
|
||
if (!$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
if (!$this->acl_check_view('Acl_Controller', 'acl'))
|
||
Controller::Error(ACCESS);
|
||
|
||
// gets new selector
|
||
... | ... | |
'filter' => $filter_form
|
||
));
|
||
|
||
if ($this->acl_check_new('Settings_Controller', 'access_rights'))
|
||
if ($this->acl_check_new('Acl_Controller', 'acl'))
|
||
{
|
||
$grid->add_new_button('acl/add', __('Add new rule'));
|
||
}
|
||
... | ... | |
->icon_action('show')
|
||
->url('acl/show');
|
||
|
||
if ($this->acl_check_edit('Settings_Controller', 'access_rights'))
|
||
if ($this->acl_check_edit('Acl_Controller', 'acl'))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('edit')
|
||
->url('acl/edit');
|
||
}
|
||
|
||
if ($this->acl_check_delete('Settings_Controller', 'access_rights'))
|
||
if ($this->acl_check_delete('Acl_Controller', 'acl'))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('delete')
|
||
... | ... | |
|
||
$grid->datasource($rules);
|
||
|
||
$submenu = array();
|
||
$submenu[] = html::anchor('acl/show_all', __('Access control rules'));
|
||
$submenu[] = html::anchor('aro_groups/show_all', __('Access control groups of users'));
|
||
if ($this->acl_check_view('Aro_groups_Controller', 'aro_group'))
|
||
{
|
||
$submenu = array();
|
||
$submenu[] = html::anchor('acl/show_all', __('Access control rules'));
|
||
$submenu[] = html::anchor('aro_groups/show_all', __('Access control groups of users'));
|
||
}
|
||
else
|
||
{
|
||
$submenu = NULL;
|
||
}
|
||
|
||
$view = new View('main');
|
||
$view->breadcrumbs = __('Access control rules');
|
||
... | ... | |
public function show ($acl_id = NULL)
|
||
{
|
||
// check access
|
||
if (!$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
if (!$this->acl_check_view('Acl_Controller', 'acl'))
|
||
Controller::Error(ACCESS);
|
||
|
||
// bad parameter
|
||
... | ... | |
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('acl/show_all', 'Access control rules',
|
||
$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
$this->acl_check_view('Acl_Controller', 'acl'))
|
||
->text('ID '.$acl->id);
|
||
|
||
$view = new View('main');
|
||
... | ... | |
public function add ()
|
||
{
|
||
// check access
|
||
if (!$this->acl_check_new('Settings_Controller', 'access_rights'))
|
||
if (!$this->acl_check_new('Acl_Controller', 'acl'))
|
||
Controller::Error(ACCESS);
|
||
|
||
$form = new Forge(url::base(TRUE).url::current(TRUE));
|
||
... | ... | |
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('acl/show_all', 'Access control rules',
|
||
$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
$this->acl_check_view('Acl_Controller', 'acl'))
|
||
->text('Add new rule');
|
||
|
||
$view = new View('main');
|
||
... | ... | |
public function edit ($acl_id = NULL)
|
||
{
|
||
// check access
|
||
if (!$this->acl_check_edit('Settings_Controller', 'access_rights'))
|
||
if (!$this->acl_check_edit('Acl_Controller', 'acl'))
|
||
Controller::Error(ACCESS);
|
||
|
||
// bad parameter
|
||
... | ... | |
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('acl/show_all', 'Access control rules',
|
||
$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
$this->acl_check_view('Acl_Controller', 'acl'))
|
||
->link('acl/show/'.$acl->id, 'ID '.$acl->id,
|
||
$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
$this->acl_check_view('Acl_Controller', 'acl'))
|
||
->text('Edit');
|
||
|
||
$view = new View('main');
|
||
... | ... | |
public function delete ($acl_id = NULL)
|
||
{
|
||
// check access
|
||
if (!$this->acl_check_delete('Settings_Controller', 'access_rights'))
|
||
if (!$this->acl_check_delete('Acl_Controller', 'acl'))
|
||
Controller::Error(ACCESS);
|
||
|
||
// bad parameter
|
freenetis/branches/1.1/application/controllers/aro_groups.php | ||
---|---|---|
public function show_all()
|
||
{
|
||
// check access
|
||
if (!$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
if (!$this->acl_check_view('Aro_groups_Controller', 'aro_group'))
|
||
{
|
||
Controller::Error(ACCESS);
|
||
}
|
||
... | ... | |
. '</td><td style="width:30px; text-align: center" >'
|
||
. $count . '</td><td>'
|
||
. __('Show')
|
||
.'</td><td>' . __('Edit')
|
||
. '</td><td>' . __('Delete')
|
||
. '</td></tr>';
|
||
.'</td>';
|
||
|
||
if ($this->acl_check_edit('Aro_groups_Controller', 'aro_group'))
|
||
{
|
||
$rows[$i + 1] .= '<td>' . __('Edit') . '</td>';
|
||
}
|
||
|
||
if ($this->acl_check_delete('Aro_groups_Controller', 'aro_group'))
|
||
{
|
||
$rows[$i + 1] .= '<td>' . __('Delete') . '</td>';
|
||
}
|
||
|
||
$rows[$i + 1] .= '</tr>';
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
. '</td><td style="width:30px; text-align: center" >'
|
||
. $count . '</td><td>'
|
||
. html::anchor('aro_groups/show/'.$group->id, __('Show'))
|
||
.'</td><td>' . html::anchor(url_lang::base()
|
||
.'</td>';
|
||
|
||
if ($this->acl_check_edit('Aro_groups_Controller', 'aro_group'))
|
||
{
|
||
$rows[$i + 1] .= '<td>' . html::anchor(url_lang::base()
|
||
. 'aro_groups/edit/' . $group->id, __('Edit'))
|
||
. '</td><td>';
|
||
. '</td>';
|
||
}
|
||
|
||
if (!$aro_group_model->count_childrens($group->id) &&
|
||
$aro_group_model->is_deletable($group->id))
|
||
if ($this->acl_check_delete('Aro_groups_Controller', 'aro_group'))
|
||
{
|
||
$rows[$i + 1] .= html::anchor(url_lang::base()
|
||
. 'aro_groups/delete/' . $group->id, __('Delete'),
|
||
array('class' => 'delete_link'));
|
||
$rows[$i + 1] .= '<td>';
|
||
|
||
if (!$aro_group_model->count_childrens($group->id) &&
|
||
$aro_group_model->is_deletable($group->id))
|
||
{
|
||
$rows[$i + 1] .= html::anchor(url_lang::base()
|
||
. 'aro_groups/delete/' . $group->id, __('Delete'),
|
||
array('class' => 'delete_link'));
|
||
}
|
||
else
|
||
$rows[$i + 1] .= __('Delete');
|
||
|
||
$rows[$i + 1] .= '</td>';
|
||
}
|
||
else
|
||
$rows[$i + 1] .= __('Delete');
|
||
|
||
$rows[$i + 1] .= '</td></tr>';
|
||
$rows[$i + 1] .= '</tr>';
|
||
}
|
||
|
||
$groups->next();
|
||
... | ... | |
$breadcrumbs = breadcrumbs::add()
|
||
->text('Access control groups of users');
|
||
|
||
$submenu = array();
|
||
$submenu['acl/show_all'] = __('Access control rules');
|
||
$submenu['aro_groups/show_all'] = __('Access control groups of users');
|
||
if ($this->acl_check_view('Acl_Controller', 'acl'))
|
||
{
|
||
$submenu = array();
|
||
$submenu['acl/show_all'] = __('Access control rules');
|
||
$submenu['aro_groups/show_all'] = __('Access control groups of users');
|
||
}
|
||
else
|
||
{
|
||
$submenu = NULL;
|
||
}
|
||
|
||
//vykresleni
|
||
$view = new View('main');
|
||
... | ... | |
public function show ($group_id = NULL)
|
||
{
|
||
// access check
|
||
if (!$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
if (!$this->acl_check_view('Aro_groups_Controller', 'aro_group'))
|
||
Controller::Error(ACCESS);
|
||
|
||
// bad parameter
|
||
... | ... | |
|
||
$actions = $acl_grid->grouped_action_field();
|
||
|
||
$actions->add_action('id')
|
||
->icon_action('show')
|
||
->url('acl/show');
|
||
if ($this->acl_check_view('Acl_Controller', 'acl'))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('show')
|
||
->url('acl/show');
|
||
}
|
||
|
||
if ($this->acl_check_edit('Settings_Controller', 'access_rights'))
|
||
if ($this->acl_check_edit('Acl_Controller', 'acl'))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('edit')
|
||
->url('acl/edit');
|
||
}
|
||
|
||
if ($this->acl_check_delete('Settings_Controller', 'access_rights'))
|
||
if ($this->acl_check_delete('Acl_Controller', 'acl'))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('delete')
|
||
... | ... | |
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('aro_groups/show_all', 'Access control groups of users',
|
||
$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
$this->acl_check_view('Aro_groups_Controller', 'aro_group'))
|
||
->disable_translation()
|
||
->text($aro_group->name.' ('.$aro_group->id.')');
|
||
|
||
... | ... | |
public function add()
|
||
{
|
||
// check access
|
||
if (!$this->acl_check_new('Settings_Controller', 'access_rights'))
|
||
if (!$this->acl_check_new('Aro_groups_Controller', 'aro_group'))
|
||
Controller::Error(ACCESS);
|
||
|
||
$aro_group_model = new Aro_group_Model();
|
||
... | ... | |
|
||
$aro_group = new Aro_group_Model($form_data['parent_id']);
|
||
|
||
try
|
||
if ($aro_group->id)
|
||
{
|
||
$aro_group->transaction_start();
|
||
|
||
if ($aro_group->id)
|
||
try
|
||
{
|
||
$aro_group->transaction_start();
|
||
|
||
$rgt = $aro_group->rgt;
|
||
|
||
|
||
$aro_group->increase($rgt);
|
||
|
||
|
||
$aro_group->clear();
|
||
$aro_group->parent_id = $form_data['parent_id'];
|
||
$aro_group->lft = $rgt;
|
||
$aro_group->rgt = $rgt+1;
|
||
$aro_group->name = $form_data['name'];
|
||
$aro_group->value = url::title($form_data['name'], '_');
|
||
|
||
|
||
$aro_group->save_throwable();
|
||
$aro_group->transaction_commit();
|
||
|
||
status::success('Group has been successfully added.');
|
||
}
|
||
catch (Exception $e)
|
||
{
|
||
$aro_group->transaction_rollback();
|
||
Log::add_exception($e);
|
||
status::error('Error - cannot add new group.', $e);
|
||
}
|
||
}
|
||
catch (Exception $e)
|
||
{
|
||
$aro_group->transaction_rollback();
|
||
Log::add_exception($e);
|
||
status::error('Error - cannot add new group.', $e);
|
||
}
|
||
|
||
url::redirect('aro_groups/show_all');
|
||
}
|
||
|
||
... | ... | |
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('aro_groups/show_all', 'Access control groups of users',
|
||
$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
$this->acl_check_view('Aro_groups_Controller', 'aro_group'))
|
||
->text($headline);
|
||
|
||
$view = new View('main');
|
||
... | ... | |
public function edit ($group_id = NULL)
|
||
{
|
||
// access check
|
||
if (!$this->acl_check_edit('Settings_Controller', 'access_rights'))
|
||
if (!$this->acl_check_edit('Aro_groups_Controller', 'aro_group'))
|
||
Controller::Error(ACCESS);
|
||
|
||
// bad parameter
|
||
... | ... | |
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('aro_groups/show_all', 'Access control groups of users',
|
||
$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
$this->acl_check_view('Aro_groups_Controller', 'aro_group'))
|
||
->disable_translation()
|
||
->link('aro_groups/show/'.$aro_group->id, $aro_group->name.' ('.$aro_group->id.')',
|
||
$this->acl_check_view('Settings_Controller', 'access_rights'))
|
||
$this->acl_check_view('Aro_groups_Controller', 'aro_group'))
|
||
->enable_translation()
|
||
->text('Edit');
|
||
|
||
... | ... | |
public function delete ($group_id = NULL)
|
||
{
|
||
// access check
|
||
if (!$this->acl_check_delete('Settings_Controller', 'access_rights'))
|
||
if (!$this->acl_check_delete('Aro_groups_Controller', 'aro_group'))
|
||
Controller::Error(ACCESS);
|
||
|
||
// bad parameter
|
freenetis/branches/1.1/application/controllers/contacts.php | ||
---|---|---|
// phone and emails can be deleted only if there is another contacts
|
||
// each user has to have one phone and one email
|
||
// this rule can be obtain if user who make this action has admin rules
|
||
if (!$this->acl_check_delete('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_delete('Users_Controller', 'additional_contacts_admin_delete'))
|
||
{
|
||
if ($contact_model->type == Contact_Model::TYPE_EMAIL ||
|
||
$contact_model->type == Contact_Model::TYPE_PHONE)
|
freenetis/branches/1.1/application/controllers/device_templates.php | ||
---|---|---|
public function show_all()
|
||
{
|
||
// access check
|
||
if (!$this->acl_check_view('Devices_Controller', 'devices'))
|
||
if (!$this->acl_check_view('Device_templates_Controller', 'device_template'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
'use_selector' => false
|
||
));
|
||
|
||
if ($this->acl_check_new('Devices_Controller', 'devices'))
|
||
if ($this->acl_check_new('Device_templates_Controller', 'device_template'))
|
||
{
|
||
$grid->add_new_button('device_templates/add', 'Add new template');
|
||
$grid->add_new_button('device_templates/import_from_file', 'Import device templates');
|
||
$grid->add_new_button('device_templates/export_to_json', 'Export device templates');
|
||
}
|
||
|
||
$grid->add_new_button('device_templates/export_to_json', 'Export device templates');
|
||
|
||
$grid->field('id')
|
||
->label('ID');
|
||
... | ... | |
->icon_action('show')
|
||
->url('device_templates/show');
|
||
|
||
if ($this->acl_check_edit('Devices_Controller', 'devices'))
|
||
if ($this->acl_check_edit('Device_templates_Controller', 'device_template'))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('edit')
|
||
->url('device_templates/edit');
|
||
}
|
||
|
||
if ($this->acl_check_delete('Devices_Controller', 'devices'))
|
||
if ($this->acl_check_delete('Device_templates_Controller', 'device_template'))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('delete')
|
||
... | ... | |
}
|
||
|
||
// check acess
|
||
if (!$this->acl_check_view('Devices_Controller', 'devices'))
|
||
if (!$this->acl_check_view('Device_templates_Controller', 'device_template'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
// bread crumbs
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('device_templates/show_all', 'Devices templates',
|
||
$this->acl_check_view('Devices_Controller', 'devices'))
|
||
$this->acl_check_view('Device_templates_Controller', 'device_template'))
|
||
->disable_translation()
|
||
->text($headline)
|
||
->html();
|
||
... | ... | |
public function add($enum_type_id = NULL)
|
||
{
|
||
// check access
|
||
if (!$this->acl_check_new('Devices_Controller', 'devices'))
|
||
if (!$this->acl_check_new('Device_templates_Controller', 'device_template'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
// bread crumbs
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('device_templates/show_all', 'Device templates',
|
||
$this->acl_check_view('Devices_Controller', 'devices'))
|
||
$this->acl_check_view('Device_templates_Controller', 'device_template'))
|
||
->disable_translation()
|
||
->text($headline)
|
||
->html();
|
||
... | ... | |
}
|
||
|
||
// check access
|
||
if (!$this->acl_check_delete('Devices_Controller', 'devices'))
|
||
if (!$this->acl_check_edit('Device_templates_Controller', 'device_template'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
// bread crumbs
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('device_templates/show_all', 'Device templates',
|
||
$this->acl_check_view('Devices_Controller', 'devices'))
|
||
$this->acl_check_view('Device_templates_Controller', 'device_template'))
|
||
->disable_translation()
|
||
->link('device_templates/show/' . $device_templates_id,
|
||
$device_template_model->name . ' (' . $device_templates_id . ')',
|
||
$this->acl_check_view('Devices_Controller', 'devices'))
|
||
$this->acl_check_view('Device_templates_Controller', 'device_template'))
|
||
->text($headline)
|
||
->html();
|
||
|
||
... | ... | |
}
|
||
|
||
// check access
|
||
if (!$this->acl_check_delete('Devices_Controller', 'devices'))
|
||
if (!$this->acl_check_delete('Device_templates_Controller', 'device_template'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
public function import_from_file()
|
||
{
|
||
// check acess
|
||
if (!$this->acl_check_view('Devices_Controller', 'devices'))
|
||
if (!$this->acl_check_new('Device_templates_Controller', 'device_template'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
// bread crumbs
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('device_templates/show_all', 'Device templates',
|
||
$this->acl_check_view('Devices_Controller', 'devices'))
|
||
$this->acl_check_view('Device_templates_Controller', 'device_template'))
|
||
->disable_translation()
|
||
->text($headline)
|
||
->html();
|
||
... | ... | |
// bread crumbs
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('device_templates/show_all', 'Device templates',
|
||
$this->acl_check_view('Devices_Controller', 'devices'))
|
||
$this->acl_check_view('Device_templates_Controller', 'device_template'))
|
||
->link('device_templates/import_from_file', 'Upload device templates',
|
||
$this->acl_check_view('Devices_Controller', 'devices'))
|
||
$this->acl_check_view('Device_templates_Controller', 'device_template'))
|
||
->text('Import results')
|
||
->html();
|
||
}
|
||
... | ... | |
public function export_to_json()
|
||
{
|
||
// check acess
|
||
if (!$this->acl_check_view('Devices_Controller', 'devices'))
|
||
if (!$this->acl_check_view('Device_templates_Controller', 'device_template'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
freenetis/branches/1.1/application/controllers/email.php | ||
---|---|---|
{
|
||
parent::__construct();
|
||
|
||
if (!Settings::get('email_enabled'))
|
||
if (!module::e('email'))
|
||
Controller::error (ACCESS);
|
||
}
|
||
|
||
... | ... | |
public function show($email_id = null)
|
||
{
|
||
// access
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Email_queues_Controller', 'email_queue'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
freenetis/branches/1.1/application/controllers/email_queues.php | ||
---|---|---|
$order_by_direction = 'DESC', $page_word = null, $page = 1)
|
||
{
|
||
// access check
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Email_queues_Controller', 'email_queue'))
|
||
Controller::error(ACCESS);
|
||
|
||
// filter form
|
||
... | ... | |
'email_queues/show_all_sent', __('Show all sent e-mails')
|
||
);
|
||
|
||
if ($this->acl_check_delete('Settings_Controller', 'system'))
|
||
if ($this->acl_check_delete('Email_queues_Controller', 'email_queue'))
|
||
{
|
||
$grid->add_new_button(
|
||
'email_queues/delete_unsent', __('Delete all unsended e-mails')
|
||
... | ... | |
->icon_action('show')
|
||
->url('email/show');
|
||
|
||
$actions->add_action()
|
||
->icon_action('mail_send')
|
||
->label('Send again')
|
||
->url('email_queues/send');
|
||
if ($this->acl_check_delete('Settings_Controller', 'system'))
|
||
if ($this->acl_check_new('Email_queues_Controller', 'email_queue'))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('mail_send')
|
||
->label('Send again')
|
||
->url('email_queues/send');
|
||
}
|
||
|
||
if ($this->acl_check_delete('Email_queues_Controller', 'email_queue'))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('delete')
|
||
->url('email_queues/delete')
|
||
->class('delete_link');
|
||
... | ... | |
$order_by_direction = 'DESC', $page_word = null, $page = 1)
|
||
{
|
||
// access check
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Email_queues_Controller', 'email_queue'))
|
||
Controller::error(ACCESS);
|
||
|
||
// filter form
|
||
... | ... | |
'email_queues/show_all_unsent', __('Show all unsent e-mails')
|
||
);
|
||
|
||
if (!$hide_grid && $this->acl_check_delete('Settings_Controller', 'system'))
|
||
if (!$hide_grid && $this->acl_check_delete('Email_queues_Controller', 'email_queue'))
|
||
{
|
||
$grid->add_new_button(
|
||
'email_queues/delete_sent' . server::query_string(),
|
||
... | ... | |
->icon_action('show')
|
||
->url('email/show');
|
||
|
||
$actions->add_action()
|
||
->icon_action('mail_send')
|
||
->label('Send again')
|
||
->url('email_queues/send');
|
||
if ($this->acl_check_new('Email_queues_Controller', 'email_queue'))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('mail_send')
|
||
->label('Send again')
|
||
->url('email_queues/send');
|
||
}
|
||
|
||
if (!$hide_grid)
|
||
{
|
||
... | ... | |
public function send($email_queue_id = NULL)
|
||
{
|
||
// access check
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_new('Email_queues_Controller', 'email_queue'))
|
||
Controller::error(ACCESS);
|
||
|
||
// bad parameter
|
||
... | ... | |
public function delete($email_queue_id = NULL)
|
||
{
|
||
// access check
|
||
if (!$this->acl_check_delete('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_delete('Email_queues_Controller', 'email_queue'))
|
||
Controller::error(ACCESS);
|
||
|
||
// bad parameter
|
||
... | ... | |
public function delete_unsent()
|
||
{
|
||
// access
|
||
if (!$this->acl_check_delete('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_delete('Email_queues_Controller', 'email_queue'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
public function delete_sent()
|
||
{
|
||
// access
|
||
if (!$this->acl_check_delete('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_delete('Email_queues_Controller', 'email_queue'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
freenetis/branches/1.1/application/controllers/enum_types.php | ||
---|---|---|
$limit_results = 200, $order_by = 'id', $order_by_direction = 'ASC')
|
||
{
|
||
// check if logged user have access right to view all translations
|
||
if (!$this->acl_check_view('Settings_Controller', 'enum_types'))
|
||
if (!$this->acl_check_view('Enum_types_Controller', 'enum_types'))
|
||
Controller::Error(ACCESS);
|
||
|
||
// to-do - pagination
|
||
... | ... | |
|
||
// add button for new translation
|
||
// check if logged user have access right to add new translation
|
||
if ($this->acl_check_new('Settings_Controller', 'enum_types'))
|
||
if ($this->acl_check_new('Enum_types_Controller', 'enum_types'))
|
||
{
|
||
$grid->add_new_button('enum_types/add', __('Add new enum type'));
|
||
}
|
||
... | ... | |
$actions = $grid->grouped_action_field();
|
||
|
||
// check if logged user have access right to edit this enum types
|
||
if ($this->acl_check_edit('Settings_Controller', 'enum_types'))
|
||
if ($this->acl_check_edit('Enum_types_Controller', 'enum_types'))
|
||
{
|
||
$actions->add_conditional_action()
|
||
->condition('is_not_readonly')
|
||
... | ... | |
}
|
||
|
||
// check if logged user have access right to delete this enum_types
|
||
if ($this->acl_check_delete('Settings_Controller', 'enum_types'))
|
||
if ($this->acl_check_delete('Enum_types_Controller', 'enum_types'))
|
||
{
|
||
$actions->add_conditional_action()
|
||
->condition('is_not_readonly')
|
||
... | ... | |
public function add()
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_new('Settings_Controller', 'enum_types'))
|
||
if (!$this->acl_check_new('Enum_types_Controller', 'enum_types'))
|
||
Controller::error(ACCESS);
|
||
|
||
$arr_type_names = array
|
||
... | ... | |
// breadcrumbs
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('enum_types/show_all', 'Enumerations',
|
||
$this->acl_check_view('Settings_Controller', 'enum_types'))
|
||
$this->acl_check_view('Enum_types_Controller', 'enum_types'))
|
||
->text('Add new enum type');
|
||
|
||
// view for adding translation
|
||
... | ... | |
if ($enum_type_id)
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_edit('Settings_Controller', 'enum_types'))
|
||
if (!$this->acl_check_edit('Enum_types_Controller', 'enum_types'))
|
||
Controller::error(ACCESS);
|
||
|
||
$enum_type = new Enum_type_Model($enum_type_id);
|
||
... | ... | |
// breadcrumbs
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('enum_types/show_all', 'Enumerations',
|
||
$this->acl_check_view('Settings_Controller', 'enum_types'))
|
||
$this->acl_check_view('Enum_types_Controller', 'enum_types'))
|
||
->text($enum_type->value . ' (' . $enum_type_id . ')')
|
||
->text('Edit translation');
|
||
|
||
... | ... | |
if ($enum_type_id)
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_delete('Settings_Controller', 'enum_types'))
|
||
if (!$this->acl_check_delete('Enum_types_Controller', 'enum_types'))
|
||
Controller::error(ACCESS);
|
||
|
||
$enum_type = new Enum_type_Model($enum_type_id);
|
freenetis/branches/1.1/application/controllers/export.php | ||
---|---|---|
// export emails
|
||
case 'email_queue_sent':
|
||
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Email_queues_Controller', 'email_queue'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
// auto export for all tables
|
||
default:
|
||
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Export_Controller', 'all_tables'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
freenetis/branches/1.1/application/controllers/fees.php | ||
---|---|---|
$limit_results = 200, $order_by = 'id', $order_by_direction = 'ASC')
|
||
{
|
||
// check if logged user have access right to view all fees
|
||
if (!$this->acl_check_view('Settings_Controller', 'fees'))
|
||
if (!$this->acl_check_view('Fees_Controller', 'fees'))
|
||
Controller::Error(ACCESS);
|
||
|
||
// to-do - pagination
|
||
... | ... | |
|
||
// add button for new translation
|
||
// check if logged user have access right to add new translation
|
||
if ($this->acl_check_new('Settings_Controller', 'fees'))
|
||
if ($this->acl_check_new('Fees_Controller', 'fees'))
|
||
{
|
||
$grid->add_new_button('fees/add', __('Add new fee'));
|
||
}
|
||
... | ... | |
$actions = $grid->grouped_action_field();
|
||
|
||
// check if logged user have access right to edit this enum types
|
||
if ($this->acl_check_edit('Settings_Controller', 'fees'))
|
||
if ($this->acl_check_edit('Fees_Controller', 'fees'))
|
||
{
|
||
$actions->add_conditional_action()
|
||
->icon_action('edit')
|
||
... | ... | |
}
|
||
|
||
// check if logged user have access right to delete this enum_types
|
||
if ($this->acl_check_delete('Settings_Controller', 'fees'))
|
||
if ($this->acl_check_delete('Fees_Controller', 'fees'))
|
||
{
|
||
$actions->add_conditional_action()
|
||
->icon_action('delete')
|
||
... | ... | |
public function add($fee_type_id = NULL)
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_new('Settings_Controller', 'fees'))
|
||
if (!$this->acl_check_new('Fees_Controller', 'fees'))
|
||
Controller::error(ACCESS);
|
||
|
||
if ($fee_type_id && is_numeric($fee_type_id))
|
||
... | ... | |
// bread crumbs
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('fees/show_all', 'Fees',
|
||
$this->acl_check_view('Settings_Controller', 'fees'))
|
||
$this->acl_check_view('Fees_Controller', 'fees'))
|
||
->text('Add new fee');
|
||
|
||
// view for adding translation
|
||
... | ... | |
Controller::warning(PARAMETER);
|
||
|
||
// access control
|
||
if (!$this->acl_check_edit('Settings_Controller', 'fees'))
|
||
if (!$this->acl_check_edit('Fees_Controller', 'fees'))
|
||
Controller::error(ACCESS);
|
||
|
||
$fee = new Fee_Model($fee_id);
|
||
... | ... | |
// bread crumbs
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('fees/show_all', 'Fees',
|
||
$this->acl_check_view('Settings_Controller', 'fees'))
|
||
$this->acl_check_view('Fees_Controller', 'fees'))
|
||
->text($fee->name . ' (' . $fee->id . ')')
|
||
->text('Edit fee');
|
||
|
||
... | ... | |
Controller::warning(PARAMETER);
|
||
|
||
// access control
|
||
if (!$this->acl_check_delete('Settings_Controller', 'fees'))
|
||
if (!$this->acl_check_delete('Fees_Controller', 'fees'))
|
||
Controller::error(ACCESS);
|
||
|
||
$fee = new Fee_Model($fee_id);
|
freenetis/branches/1.1/application/controllers/filter_queries.php | ||
---|---|---|
$limit_results = 100, $order_by = 'id',
|
||
$order_by_direction = 'ASC', $page_word = 'page', $page = 1)
|
||
{
|
||
if (!$this->acl_check_view('Filter_queries_Controller', 'filter_queries'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
|
||
$filter_query_model = new Filter_query_Model();
|
||
|
||
$filter_queries = $filter_query_model->get_all_queries();
|
||
... | ... | |
$grid->order_callback_field('default')
|
||
->callback(
|
||
'callback::enabled_field',
|
||
'filter_queries/set_default/'
|
||
$this->acl_check_edit('Filter_queries_Controller', 'filter_queries') ?
|
||
'filter_queries/set_default/' : NULL
|
||
)->class('center');
|
||
|
||
$actions = $grid->grouped_action_field();
|
||
|
||
$actions->add_action('id')
|
||
->icon_action('delete')
|
||
->url('filter_queries/delete')
|
||
->label('Delete')
|
||
->class('delete_link');
|
||
if ($this->acl_check_delete('Filter_queries_Controller', 'filter_queries'))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('delete')
|
||
->url('filter_queries/delete')
|
||
->label('Delete')
|
||
->class('delete_link');
|
||
}
|
||
|
||
$grid->datasource($filter_queries);
|
||
|
||
... | ... | |
if (!$filter_query_id || !is_numeric($filter_query_id))
|
||
Controller::warning (PARAMETER);
|
||
|
||
if (!$this->acl_check_edit('Filter_queries_Controller', 'filter_queries'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
|
||
$filter_query = new Filter_query_Model($filter_query_id);
|
||
|
||
// record doesn't exis
|
||
... | ... | |
*/
|
||
public function delete($filter_query_id = NULL)
|
||
{
|
||
if (!$this->acl_check_delete('Filter_queries_Controller', 'filter_queries'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
|
||
// bad paremeter
|
||
if (!$filter_query_id || !is_numeric($filter_query_id))
|
||
Controller::warning (PARAMETER);
|
freenetis/branches/1.1/application/controllers/json.php | ||
---|---|---|
public function get_fees_by_type()
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_view('Settings_Controller', 'fees'))
|
||
if (!$this->acl_check_view('Fees_Controller', 'fees'))
|
||
Controller::Error(ACCESS);
|
||
|
||
$id = (int) $this->input->get('id');
|
freenetis/branches/1.1/application/controllers/log_queues.php | ||
---|---|---|
'comments_threads/add/log_queue/'.$lq_model->id;
|
||
|
||
$comments_grid->add_new_button(
|
||
$url, 'Add comment to connection request',
|
||
$url, 'Add comment',
|
||
array('class' => 'popup_link')
|
||
);
|
||
}
|
freenetis/branches/1.1/application/controllers/membership_interrupts.php | ||
---|---|---|
$page_word = null, $page = 1)
|
||
{
|
||
// access rights
|
||
if (!$this->acl_check_view('Members_Controller', 'members'))
|
||
if (!$this->acl_check_view('Members_Controller', 'membership_interrupts'))
|
||
Controller::error(ACCESS);
|
||
|
||
$filter_form = new Filter_form('mi');
|
||
... | ... | |
'ID ' . $membership_interrupt->member->id . ' - ' .
|
||
$membership_interrupt->member->name,
|
||
$this->acl_check_view(
|
||
'Members_Controller', 'members',
|
||
'Members_Controller', 'membership_interrupts',
|
||
$membership_interrupt->member->id
|
||
)
|
||
)
|
||
->enable_translation()
|
||
->link('membership_interrupts/show_all', 'Membership interrupts',
|
||
$this->acl_check_view('Members_Controller', 'members'))
|
||
$this->acl_check_view('Members_Controller', 'membership_interrupts'))
|
||
->disable_translation()
|
||
->text($headline);
|
||
|
freenetis/branches/1.1/application/controllers/phone_operators.php | ||
---|---|---|
public function show_all()
|
||
{
|
||
// access check
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Phone_operators_Controller', 'phone_operators'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
'use_selector' => false
|
||
));
|
||
|
||
if ($this->acl_check_new('Settings_Controller', 'system'))
|
||
if ($this->acl_check_new('Phone_operators_Controller', 'phone_operators'))
|
||
{
|
||
$grid->add_new_button('phone_operators/add', __('Add new phone operator'));
|
||
}
|
||
... | ... | |
|
||
$actions = $grid->grouped_action_field();
|
||
|
||
if ($this->acl_check_edit('Settings_Controller', 'system'))
|
||
if ($this->acl_check_edit('Phone_operators_Controller', 'phone_operators'))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('edit')
|
||
->url('phone_operators/edit');
|
||
}
|
||
|
||
if ($this->acl_check_delete('Settings_Controller', 'system'))
|
||
if ($this->acl_check_delete('Phone_operators_Controller', 'phone_operators'))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('delete')
|
||
... | ... | |
public function add()
|
||
{
|
||
// check access
|
||
if (!$this->acl_check_new('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_new('Phone_operators_Controller', 'phone_operators'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
}
|
||
|
||
// check access
|
||
if (!$this->acl_check_delete('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_edit('Phone_operators_Controller', 'phone_operators'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
}
|
||
|
||
// check access
|
||
if (!$this->acl_check_delete('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_delete('Phone_operators_Controller', 'phone_operators'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
freenetis/branches/1.1/application/controllers/settings.php | ||
---|---|---|
parent::__construct();
|
||
|
||
$this->sections = array();
|
||
|
||
$this->sections['info'] = __('Info');
|
||
|
||
if ($this->acl_check_view('Settings_Controller', 'info'))
|
||
$this->sections['info'] = __('Info');
|
||
|
||
if ($this->acl_check_edit('Settings_Controller', 'system'))
|
||
{
|
||
if ($this->acl_check_edit('Settings_Controller', 'system_settings'))
|
||
$this->sections['system'] = __('System');
|
||
|
||
|
||
if ($this->acl_check_edit('Settings_Controller', 'users_settings'))
|
||
$this->sections['users'] = __('Users');
|
||
|
||
// are finance enabled
|
||
if (self::isModuleEnabled('finance'))
|
||
$this->sections['finance'] = __('Finance');
|
||
|
||
// is approval enabled
|
||
if (self::isModuleEnabled('approval'))
|
||
$this->sections['approval'] = __('Approval');
|
||
|
||
// are networks enabled
|
||
if (self::isModuleEnabled('networks'))
|
||
$this->sections['networks'] = __('Networks');
|
||
|
||
if (self::isModuleEnabled('email'))
|
||
$this->sections['email'] = __('Email');
|
||
|
||
// are SMS enabled
|
||
if (self::isModuleEnabled('sms'))
|
||
$this->sections['sms'] = __('SMS');
|
||
|
||
// is voip enabled
|
||
if (self::isModuleEnabled('voip'))
|
||
$this->sections['voip'] = __('VoIP');
|
||
// are finance enabled
|
||
if (self::isModuleEnabled('finance') &&
|
||
$this->acl_check_edit('Settings_Controller', 'finance_settings'))
|
||
$this->sections['finance'] = __('Finance');
|
||
|
||
// is notification enabled
|
||
if (self::isModuleEnabled('notification'))
|
||
$this->sections['notifications'] = __('Notifications');
|
||
// is approval enabled
|
||
if (self::isModuleEnabled('approval') &&
|
||
$this->acl_check_edit('Settings_Controller', 'approval_settings'))
|
||
$this->sections['approval'] = __('Approval');
|
||
|
||
// is QoS enabled
|
||
if (self::isModuleEnabled('qos'))
|
||
$this->sections['qos'] = __('QoS');
|
||
// are networks enabled
|
||
if (self::isModuleEnabled('networks') &&
|
||
$this->acl_check_edit('Settings_Controller', 'networks_settings'))
|
||
$this->sections['networks'] = __('Networks');
|
||
|
||
// is monitoring enabled
|
||
if (self::isModuleEnabled('monitoring'))
|
||
$this->sections['monitoring'] = __('Monitoring');
|
||
if (self::isModuleEnabled('email') &&
|
||
$this->acl_check_edit('Settings_Controller', 'email_settings'))
|
||
$this->sections['email'] = __('Email');
|
||
|
||
// is vtiger integration enabled
|
||
if (self::isModuleEnabled('vtiger'))
|
||
$this->sections['vtiger'] = __('Vtiger');
|
||
// are SMS enabled
|
||
if (self::isModuleEnabled('sms') &&
|
||
$this->acl_check_edit('Settings_Controller', 'sms_settings'))
|
||
$this->sections['sms'] = __('SMS');
|
||
|
||
// is voip enabled
|
||
if (self::isModuleEnabled('voip') &&
|
||
$this->acl_check_edit('Settings_Controller', 'voip_settings'))
|
||
$this->sections['voip'] = __('VoIP');
|
||
|
||
// is notification enabled
|
||
if (self::isModuleEnabled('notification') &&
|
||
$this->acl_check_edit('Settings_Controller', 'notification_settings'))
|
||
$this->sections['notifications'] = __('Notifications');
|
||
|
||
// is QoS enabled
|
||
if (self::isModuleEnabled('qos') &&
|
||
$this->acl_check_edit('Settings_Controller', 'qos_settings'))
|
||
$this->sections['qos'] = __('QoS');
|
||
|
||
// is monitoring enabled
|
||
if (self::isModuleEnabled('monitoring') &&
|
||
$this->acl_check_edit('Settings_Controller', 'monitoring_settings'))
|
||
$this->sections['monitoring'] = __('Monitoring');
|
||
|
||
// is vtiger integration enabled
|
||
if (self::isModuleEnabled('vtiger') &&
|
||
$this->acl_check_edit('Settings_Controller', 'vtiger_settings'))
|
||
$this->sections['vtiger'] = __('Vtiger');
|
||
|
||
if ($this->acl_check_edit('Settings_Controller', 'logging_settings'))
|
||
$this->sections['logging'] = __('Logging');
|
||
}
|
||
|
||
if (count($this->sections) <= 1)
|
||
$this->sections = NULL;
|
||
}
|
||
|
||
/**
|
||
... | ... | |
*/
|
||
public function index()
|
||
{
|
||
$this->info();
|
||
if ($this->acl_check_view('Settings_Controller', 'info'))
|
||
$this->info();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'system_settings'))
|
||
$this->system();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'users_settings'))
|
||
$this->users();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'finance_settings'))
|
||
$this->finance();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'approval_settings'))
|
||
$this->approval();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'networks_settings'))
|
||
$this->networks();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'email_settings'))
|
||
$this->email();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'sms_settings'))
|
||
$this->sms();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'voip_settings'))
|
||
$this->voip();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'notification_settings'))
|
||
$this->notifications();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'qos_settings'))
|
||
$this->qos();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'monitoring_settings'))
|
||
$this->monitoring();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'vtiger_settings'))
|
||
$this->vtiger();
|
||
else if ($this->acl_check_edit('Settings_Controller', 'logging_settings'))
|
||
$this->logging();
|
||
else
|
||
Controller::error(ACCESS);
|
||
}
|
||
|
||
/**
|
||
... | ... | |
*/
|
||
public function info()
|
||
{
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Settings_Controller', 'info'))
|
||
Controller::error(ACCESS);
|
||
|
||
$data = array();
|
||
... | ... | |
public function system()
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_edit('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_edit('Settings_Controller', 'system_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
// creating of new forge
|
||
... | ... | |
public function users()
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_edit('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_edit('Settings_Controller', 'users_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
// creating of new forge
|
||
... | ... | |
public function finance()
|
||
{
|
||
// access control
|
||
if (!Settings::get('finance_enabled') ||
|
||
!$this->acl_check_edit('Settings_Controller', 'system'))
|
||
if (!module::e('finance') ||
|
||
!$this->acl_check_edit('Settings_Controller', 'finance_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
// creating of new forge
|
||
... | ... | |
public function qos()
|
||
{
|
||
// access control
|
||
if (!Settings::get('qos_enabled') || !$this->acl_check_edit('Settings_Controller', 'system'))
|
||
if (!module::e('qos') ||
|
||
!$this->acl_check_edit('Settings_Controller', 'qos_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
// creating of new forge
|
||
... | ... | |
public function email()
|
||
{
|
||
// access control
|
||
if (!Settings::get('email_enabled') ||
|
||
!$this->acl_check_edit('Settings_Controller', 'system'))
|
||
if (!module::e('email') ||
|
||
!$this->acl_check_edit('Settings_Controller', 'email_settings'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
public function approval()
|
||
{
|
||
// access control
|
||
if (!Settings::get('approval_enabled') || !$this->acl_check_edit('Settings_Controller', 'system'))
|
||
if (!module::e('approval') ||
|
||
!$this->acl_check_edit('Settings_Controller', 'approval_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
$approval_templates = ORM::factory('approval_template')->select_list('id', 'name');
|
||
... | ... | |
public function networks()
|
||
{
|
||
// access control
|
||
if (!Settings::get('networks_enabled') || !$this->acl_check_edit('Settings_Controller', 'system'))
|
||
if (!module::e('networks') ||
|
||
!$this->acl_check_edit('Settings_Controller', 'networks_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
// creating of new forge
|
||
... | ... | |
public function voip()
|
||
{
|
||
// access control
|
||
if (!Settings::get('voip_enabled') || !$this->acl_check_edit(get_class($this), 'system'))
|
||
if (!module::e('voip') ||
|
||
!$this->acl_check_edit(get_class($this), 'voip_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
// creating of new forge
|
||
... | ... | |
public function sms()
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_edit(get_class($this), 'system'))
|
||
if (!module::e('sms') ||
|
||
!$this->acl_check_edit(get_class($this), 'sms_settings'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
{
|
||
// access control
|
||
if (!self::isModuleEnabled('notification') ||
|
||
!$this->acl_check_edit('Messages_Controller', 'message'))
|
||
!$this->acl_check_edit('Settings_Controller', 'notification_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
// creating of new forge
|
||
... | ... | |
public function logging()
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_edit(get_class($this), 'system'))
|
||
if (!$this->acl_check_edit(get_class($this), 'logging_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
$user_model = new User_Model();
|
||
... | ... | |
public function monitoring()
|
||
{
|
||
// access control
|
||
if (!Settings::get('monitoring_enabled') || !$this->acl_check_edit('Settings_Controller', 'system'))
|
||
if (!module::e('monitoring') ||
|
||
!$this->acl_check_edit('Settings_Controller', 'monitoring_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
// creating of new forge
|
||
... | ... | |
public function vtiger()
|
||
{
|
||
// access control
|
||
if (!$this->acl_check_edit('Settings_Controller', 'system'))
|
||
if (!module::e('vtiger') ||
|
||
!$this->acl_check_edit('Settings_Controller', 'vtiger_settings'))
|
||
Controller::error(ACCESS);
|
||
|
||
$values_member = json_decode(Settings::get('vtiger_member_fields'), true);
|
freenetis/branches/1.1/application/controllers/sms.php | ||
---|---|---|
$order_by_direction = 'desc', $page_word = null, $page = 1)
|
||
{
|
||
// access
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Sms_Controller', 'sms'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
|
||
$grid->add_new_button('sms/show_unread', __('Show unread messages'));
|
||
|
||
if ($this->acl_check_delete('Settings_Controller', 'system'))
|
||
if ($this->acl_check_delete('Sms_Controller', 'sms'))
|
||
{
|
||
$grid->add_new_button('sms/delete_unsended', __('Delete unsended messages'));
|
||
}
|
||
|
||
if ($this->acl_check_new('Settings_Controller', 'system') &&
|
||
if ($this->acl_check_new('Sms_Controller', 'sms') &&
|
||
Sms::has_active_driver())
|
||
{
|
||
$grid->add_new_button('sms/send', __('Send message'));
|
||
... | ... | |
$order_by_direction = 'desc', $page_word = null, $page = 1)
|
||
{
|
||
// access
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Sms_Controller', 'sms'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
public function delete_unsended()
|
||
{
|
||
// access
|
||
if (!$this->acl_check_delete('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_delete('Sms_Controller', 'sms'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
public function show($sms_id = null)
|
||
{
|
||
// access
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Sms_Controller', 'sms'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
public function send($phone = null, $sms_id = null, $selected_subnet = null)
|
||
{
|
||
// access
|
||
if (!$this->acl_check_new('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_new('Sms_Controller', 'sms'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
freenetis/branches/1.1/application/controllers/speed_classes.php | ||
---|---|---|
public function show_all()
|
||
{
|
||
// access
|
||
if (!$this->acl_check_view('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_view('Speed_classes_Controller', 'speed_classes'))
|
||
self::error(ACCESS);
|
||
|
||
$speed_class_model = new Speed_class_Model();
|
||
... | ... | |
'use_selector' => false,
|
||
));
|
||
|
||
if ($this->acl_check_new('Settings_Controller', 'system'))
|
||
if ($this->acl_check_new('Speed_classes_Controller', 'speed_classes'))
|
||
{
|
||
$grid->add_new_button(
|
||
'speed_classes/add', 'Add new speed class',
|
||
... | ... | |
$grid->callback_field('regular_member_default')
|
||
->label('MD')
|
||
->help(help::hint(__('Default for member')))
|
||
->callback('callback::enabled_field', 'speed_classes/set_default/0/')
|
||
->class('center');
|
||
->callback(
|
||
'callback::enabled_field',
|
||
$this->acl_check_edit('Speed_classes_Controller', 'speed_classes') ?
|
||
'speed_classes/set_default/0/' : NULL
|
||
)->class('center');
|
||
|
||
$grid->callback_field('applicant_default')
|
||
->label('AD')
|
||
->help(help::hint(__('Default for membership applicant')))
|
||
->callback('callback::enabled_field', 'speed_classes/set_default/1/')
|
||
->class('center');
|
||
->callback(
|
||
'callback::enabled_field',
|
||
$this->acl_check_edit('Speed_classes_Controller', 'speed_classes') ?
|
||
'speed_classes/set_default/1/' : NULL
|
||
)->class('center');
|
||
|
||
$actions = $grid->grouped_action_field();
|
||
|
||
if ($this->acl_check_edit('Settings_Controller', 'system'))
|
||
if ($this->acl_check_edit('Speed_classes_Controller', 'speed_classes'))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('edit')
|
||
... | ... | |
->class('popup_link');
|
||
}
|
||
|
||
if ($this->acl_check_delete('Settings_Controller', 'system'))
|
||
if ($this->acl_check_delete('Speed_classes_Controller', 'speed_classes'))
|
||
{
|
||
$actions->add_action('id')
|
||
->icon_action('delete')
|
||
... | ... | |
public function add()
|
||
{
|
||
// access
|
||
if (!$this->acl_check_new('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_new('Speed_classes_Controller', 'speed_classes'))
|
||
self::error(ACCESS);
|
||
|
||
// form
|
||
... | ... | |
// breadcrumbs navigation
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('speed_classes/show_all', 'Speed classes',
|
||
$this->acl_check_view('Settings_Controller', 'system'))
|
||
$this->acl_check_view('Speed_classes_Controller', 'speed_classes'))
|
||
->disable_translation()
|
||
->text($headline);
|
||
|
||
... | ... | |
public function edit($speed_class_id = NULL)
|
||
{
|
||
// access
|
||
if (!$this->acl_check_edit('Settings_Controller', 'system'))
|
||
if (!$this->acl_check_edit('Speed_classes_Controller', 'speed_classes'))
|
||
self::error(ACCESS);
|
||
|
||
// bad paremeter
|
Také k dispozici: Unified diff
Nove:
- closes #691 - Samostatna prava pro jednotlive metody v Settings controlleru
- closes #693 - Samostatna prava pro dotazy filtru
- closes #694 - Samostatna prava pro telefonni operatory
- closes #695 - Samostatna prava pro tridy rychlosti
- closes #696 - Samostatna prava pro vycty
- closes #697 - Samostatna prava pro poplatky
- closes #698 - Samostatna prava pro prava
- closes #699 - Samostatna prava pro sablony zarizeni
- closes #700 - Samostatna prava pro frontu emailu
- closes #701 - Samostatna prava pro SMS
- closes #702 - Samostatna prava pro provoz
- closes #703 - Samostatna prava pro preruseni clenstvi