Revize 2083
Přidáno uživatelem David Raška před asi 11 roky(ů)
freenetis/branches/1.1/application/controllers/members.php | ||
---|---|---|
)
|
||
);
|
||
|
||
if (module::e('notification'))
|
||
if (module::e('notification') &&
|
||
$this->acl_check_new('Notifications_Controller', 'members'))
|
||
{
|
||
$grid->add_new_button(
|
||
'notifications/members/' . server::query_string(),
|
||
... | ... | |
'query_string' => $this->input->get(),
|
||
));
|
||
|
||
if ($this->acl_check_new('Messages_Controller', 'member') &&
|
||
if ($this->acl_check_new('Redirect_Controller', 'redirect') &&
|
||
$total_ips < 1000) // limited count
|
||
{
|
||
$redir_grid->add_new_button(
|
||
... | ... | |
->callback('callback::redirection_preview_field');
|
||
}
|
||
|
||
if ($this->acl_check_delete('Messages_Controller', 'ip_address'))
|
||
if ($this->acl_check_delete('Redirect_Controller', 'redirect'))
|
||
{
|
||
$redir_grid->callback_field('redirection')
|
||
->label(__('Canceling of message for redirection'))
|
||
... | ... | |
|
||
}
|
||
|
||
if (module::e('notification') &&
|
||
$this->acl_check_new('Messages_Controller', 'member'))
|
||
if (module::e('notification'))
|
||
{
|
||
$member_links[] = html::anchor(
|
||
'notifications/member/'.$member->id, __('Notifications'),
|
||
array('title' => __('Set notification to member'))
|
||
);
|
||
if ($this->acl_check_new('Notifications_Controller', 'member'))
|
||
{
|
||
$member_links[] = html::anchor(
|
||
'notifications/member/'.$member->id, __('Notifications'),
|
||
array('title' => __('Set notification to member'))
|
||
);
|
||
}
|
||
|
||
$member_links[] = html::anchor(
|
||
'members_whitelists/show_by_member/'.$member->id, __('Whitelists')
|
||
);
|
||
if ($this->acl_check_view('Members_whitelists_Controller', 'whitelist'))
|
||
{
|
||
$member_links[] = html::anchor(
|
||
'members_whitelists/show_by_member/'.$member->id, __('Whitelists')
|
||
);
|
||
}
|
||
}
|
||
|
||
// export contacts
|
freenetis/branches/1.1/application/controllers/members_whitelists.php | ||
---|---|---|
$page_word = null, $page = 1)
|
||
{
|
||
// access rights
|
||
if (!$this->acl_check_view('Messages_controller', 'message'))
|
||
if (!$this->acl_check_view('Members_whitelists_Controller', 'whitelist'))
|
||
Controller::error(ACCESS);
|
||
|
||
// gets new selector
|
||
... | ... | |
Controller::error(RECORD);
|
||
|
||
// access rights
|
||
if (!$this->acl_check_view('Messages_controller', 'message', $member->id))
|
||
if (!$this->acl_check_view('Members_whitelists_controller', 'whitelist', $member->id))
|
||
Controller::error(ACCESS);
|
||
|
||
// load members
|
||
... | ... | |
'use_selector' => false,
|
||
));
|
||
|
||
$grid->add_new_button(
|
||
'members_whitelists/add/' . $member->id,
|
||
'Add new whitelist', array('class' => 'popup_link')
|
||
);
|
||
if ($this->acl_check_new('Members_whitelists_controller', 'whitelist', $member->id))
|
||
{
|
||
$grid->add_new_button(
|
||
'members_whitelists/add/' . $member->id,
|
||
'Add new whitelist', array('class' => 'popup_link')
|
||
);
|
||
}
|
||
|
||
$grid->field('id')
|
||
->label('ID');
|
||
... | ... | |
|
||
$actions = $grid->grouped_action_field();
|
||
|
||
$actions->add_action()
|
||
->icon_action('edit')
|
||
->url('members_whitelists/edit')
|
||
->class('popup_link');
|
||
if ($this->acl_check_edit('Members_whitelists_controller', 'whitelist'))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('edit')
|
||
->url('members_whitelists/edit')
|
||
->class('popup_link');
|
||
}
|
||
|
||
if ($this->acl_check_delete('Members_whitelists_controller', 'whitelist'))
|
||
{
|
||
$actions->add_action()
|
||
->icon_action('delete')
|
||
->url('members_whitelists/delete')
|
||
->class('delete_link');
|
||
}
|
||
|
||
$grid->datasource($member_whitelist->get_member_whitelists($member_id));
|
||
|
||
... | ... | |
Controller::error(RECORD);
|
||
|
||
// access control
|
||
if (!$this->acl_check_new('Messages_controller', 'message', $member->id))
|
||
if (!$this->acl_check_new('Members_whitelists_controller', 'whitelist', $member->id))
|
||
Controller::Error(ACCESS);
|
||
|
||
// saving id for callback function
|
||
... | ... | |
->enable_translation()
|
||
->link('members_whitelists/show_by_member/'.$member_id, 'Whitelists',
|
||
$this->acl_check_view(
|
||
'Messages_controller', 'message', $member->id
|
||
'Members_whitelists_controller', 'whitelist', $member->id
|
||
)
|
||
)
|
||
->disable_translation()
|
||
... | ... | |
Controller::error(RECORD);
|
||
|
||
// access control
|
||
if (!$this->acl_check_edit('Messages_controller', 'message', $mw->id))
|
||
if (!$this->acl_check_edit('Members_whitelists_controller', 'whitelist', $mw->id))
|
||
Controller::Error(ACCESS);
|
||
|
||
// saving id for callback function
|
||
... | ... | |
->enable_translation()
|
||
->link('members_whitelists/show_by_member/'.$mw->member_id, 'Whitelists',
|
||
$this->acl_check_view(
|
||
'Messages_controller', 'message', $mw->member_id
|
||
'Members_whitelists_controller', 'whitelist', $mw->member_id
|
||
)
|
||
)
|
||
->disable_translation()
|
||
... | ... | |
$mid = $mw->member_id;
|
||
|
||
// access control
|
||
if (!$this->acl_check_delete('Messages_controller', 'message', $mid))
|
||
if (!$this->acl_check_delete('Members_whitelist_controller', 'whitelist', $mid))
|
||
Controller::Error(ACCESS);
|
||
|
||
// success
|
freenetis/branches/1.1/application/controllers/messages.php | ||
---|---|---|
->label(__('IW').' '.help::hint('ignore_whitelist'))
|
||
->callback('callback::boolean');
|
||
|
||
$grid->callback_field('id')
|
||
->label('Preview')
|
||
->callback('callback::message_preview_field');
|
||
if ($this->acl_check_view('Messages_Controller', 'preview'))
|
||
{
|
||
$grid->callback_field('id')
|
||
->label('Preview')
|
||
->callback('callback::message_preview_field');
|
||
}
|
||
|
||
if ($this->acl_check_edit('Messages_Controller', 'message'))
|
||
if ($this->acl_check_edit('Messages_Controller', 'activate'))
|
||
{
|
||
$grid->callback_field('id')
|
||
->label('Activate')
|
||
->callback('callback::message_activate_field');
|
||
}
|
||
|
||
if ($this->acl_check_edit('Messages_Controller', 'message'))
|
||
if ($this->acl_check_edit('Messages_Controller', 'deactivate'))
|
||
{
|
||
$grid->callback_field('id')
|
||
->label('Deactivate')
|
||
... | ... | |
{
|
||
$headline = __('Add notification message');
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('messages/show_all', 'Messages',
|
||
$this->acl_check_view('Redirection_Controller', 'redirection')
|
||
$this->acl_check_view('Messages_Controller', 'message')
|
||
)->disable_translation()
|
||
->text($headline);
|
||
|
||
... | ... | |
Controller::error(ACCESS);
|
||
}
|
||
|
||
// access rights
|
||
if (!$this->acl_check_edit('Messages_Controller', 'message'))
|
||
Controller::error(ACCESS);
|
||
|
||
$form = new Forge('messages/edit/'.$message_id);
|
||
|
||
$form->group('Basic information');
|
||
... | ... | |
{
|
||
$headline = __('Edit notification message');
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('messages/show_all', 'Messages',
|
||
$this->acl_check_view(
|
||
'Redirection_Controller', 'redirection'
|
||
'Messages_Controller', 'messages'
|
||
)
|
||
);
|
||
|
||
... | ... | |
*/
|
||
public function activate($message_id = NULL)
|
||
{
|
||
if (!$this->acl_check_new('Messages_Controller', 'member'))
|
||
if (!$this->acl_check_new('Messages_Controller', 'activate'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
|
||
$headline = __('Activate message for all members');
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('messages/show_all', 'Messages',
|
||
$this->acl_check_view(
|
||
'Redirection_Controller', 'redirection'
|
||
'Messages_Controller', 'messages'
|
||
)
|
||
);
|
||
|
||
... | ... | |
|
||
$headline = __('Activate message for all members');
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
$breadcrumbs = breadcrumbs::add()
|
||
->link('messages/show_all', 'Messages',
|
||
$this->acl_check_view(
|
||
'Redirection_Controller', 'redirection'
|
||
'messages_Controller', 'messages'
|
||
)
|
||
);
|
||
|
||
... | ... | |
*/
|
||
public function deactivate($message_id = NULL)
|
||
{
|
||
if (!$this->acl_check_edit('Messages_Controller', 'message'))
|
||
if (!$this->acl_check_edit('Messages_Controller', 'deactivate'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
||
... | ... | |
*/
|
||
public function delete($message_id = NULL)
|
||
{
|
||
if (!$this->acl_check_edit('Messages_Controller', 'message'))
|
||
if (!$this->acl_check_delete('Messages_Controller', 'message'))
|
||
{
|
||
Controller::error(ACCESS);
|
||
}
|
freenetis/branches/1.1/application/controllers/notifications.php | ||
---|---|---|
Controller::error(RECORD);
|
||
|
||
// access control
|
||
if (!$this->acl_check_new('Messages_Controller', 'member', $member->id))
|
||
if (!$this->acl_check_new('Notifications_Controller', 'member', $member->id))
|
||
Controller::error(ACCESS);
|
||
|
||
$headline = __('Notification setting of member').' '.$member->name;
|
||
... | ... | |
{
|
||
$headline = __('Notification setting of members');
|
||
|
||
if (!$this->acl_check_new('Notifications_Controller', 'members'))
|
||
Controller::error(ACCESS);
|
||
|
||
if (!$message_id)
|
||
{
|
||
// gets all user messages
|
||
... | ... | |
if (!Settings::get('networks_enabled'))
|
||
Controller::error (ACCESS);
|
||
|
||
if (!$this->acl_check_new('Notifications_Controller', 'subnet'))
|
||
Controller::error(ACCESS);
|
||
|
||
// bad parameter
|
||
if (!$subnet_id || !is_numeric($subnet_id))
|
||
Controller::warning(PARAMETER);
|
||
... | ... | |
if (!$cloud_id || !is_numeric($cloud_id))
|
||
Controller::warning(PARAMETER);
|
||
|
||
if (!$this->acl_check_new('Notifications_Controller', 'cloud'))
|
||
Controller::error(ACCESS);
|
||
|
||
$cloud = new Cloud_Model($cloud_id);
|
||
|
||
// record doesn't exist
|
freenetis/branches/1.1/application/controllers/redirect.php | ||
---|---|---|
}
|
||
|
||
/**
|
||
* Function redirects to show_all function.
|
||
*/
|
||
public function index()
|
||
{
|
||
url::redirect('redirect/show_all');
|
||
}
|
||
|
||
/**
|
||
* Shows all activated redirections.
|
||
*
|
||
* @author Jiri Svitak
|
||
... | ... | |
$order_by_direction = 'desc', $page_word = null, $page = 1)
|
||
{
|
||
// access rights
|
||
if (!$this->acl_check_view('Messages_Controller', 'message'))
|
||
if (!$this->acl_check_view('Redirect_Controller', 'redirect'))
|
||
Controller::error(ACCESS);
|
||
|
||
if (is_numeric($this->input->post('record_per_page')))
|
||
... | ... | |
public function activate_to_ip_address($ip_address_id = null)
|
||
{
|
||
// access rights
|
||
if (!$this->acl_check_edit('Messages_Controller', 'ip_address'))
|
||
if (!$this->acl_check_edit('Redirect_Controller', 'redirect'))
|
||
Controller::error(ACCESS);
|
||
|
||
if (!isset($ip_address_id))
|
||
... | ... | |
public function delete(
|
||
$ip_address_id = null, $message_id = null, $from = 'ip_address')
|
||
{
|
||
if (!$this->acl_check_delete('Messages_Controller', 'ip_address'))
|
||
if (!$this->acl_check_delete('Redirect_Controller', 'redirect'))
|
||
Controller::error(ACCESS);
|
||
|
||
if (!isset($ip_address_id) || !isset($message_id))
|
||
... | ... | |
public function activate_to_member($member_id = null)
|
||
{
|
||
// access rights
|
||
if (!$this->acl_check_edit('Messages_Controller', 'member'))
|
||
if (!$this->acl_check_edit('Redirect_Controller', 'redirect'))
|
||
Controller::error(ACCESS);
|
||
|
||
if (!isset($member_id))
|
||
... | ... | |
public function delete_from_member($member_id = null, $message_id = null)
|
||
{
|
||
// access rights
|
||
if (!$this->acl_check_delete('Messages_Controller', 'member'))
|
||
if (!$this->acl_check_delete('Redirect_Controller', 'redirect'))
|
||
Controller::error(ACCESS);
|
||
|
||
if (!isset($member_id) || !isset($message_id))
|
freenetis/branches/1.1/application/libraries/MY_Controller.php | ||
---|---|---|
'redirection');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of whitelists
|
||
if ($this->acl_check_view('Messages_Controller', 'message'))
|
||
if ($this->acl_check_view('Members_whitelists_Controller', 'whitelist'))
|
||
{
|
||
$menu->addItem(
|
||
'members_whitelists/show_all', __('Whitelist'),
|
||
'redirection');
|
||
}
|
||
|
||
/**
|
||
* @todo Add own AXO
|
||
*/
|
||
|
||
// list of activated redirections
|
||
if (Settings::get('redirection_enabled') &&
|
||
$this->acl_check_view('Messages_Controller', 'message'))
|
||
$this->acl_check_view('Redirect_Controller', 'redirect'))
|
||
{
|
||
$menu->addItem(
|
||
'redirect/show_all', __('Activated redirections'),
|
freenetis/branches/1.1/application/views/clouds/show.php | ||
---|---|---|
{
|
||
echo html::anchor('clouds/edit/' . $cloud->id, __('Edit cloud'));
|
||
|
||
if (module::e('notification'))
|
||
if (module::e('notification') &&
|
||
$this->acl_check_new('Notifications_Controller', 'cloud'))
|
||
echo ' | ' . html::anchor('notifications/cloud/' . $cloud->id, __('Notifications'));
|
||
}
|
||
?>
|
freenetis/branches/1.1/application/views/ip_addresses/show.php | ||
---|---|---|
$links[] = html::anchor('ip_addresses/edit/'.$ip_address->id, __('Edit'), array('class' => 'popup_link'));
|
||
if (!$ip_address->member_id && $this->acl_check_delete('Devices_Controller', 'ip_address'))
|
||
$links[] = html::anchor('ip_addresses/delete/'.$ip_address->id, __('Delete'));
|
||
if (Settings::get('redirection_enabled') && $this->acl_check_new('Messages_Controller', 'ip_address'))
|
||
if (module::e('redirection') && $this->acl_check_new('Redirect_Controller', 'redirect'))
|
||
$links[] = html::anchor('redirect/activate_to_ip_address/'.$ip_address->id, __('Activate redirection'));
|
||
if (Settings::get('redirection_enabled') && $this->acl_check_view('Messages_Controller', 'ip_address'))
|
||
if (module::e('redirection') && $this->acl_check_view('Redirect_Controller', 'redirect'))
|
||
$links[] = html::anchor(url::base().'redirection/?ip_address='.$ip_address->ip_address, __('Redirection preview'));
|
||
|
||
echo implode(' | ', $links);
|
freenetis/branches/1.1/application/views/subnets/show.php | ||
---|---|---|
}
|
||
|
||
if (module::e('notification') &&
|
||
$this->acl_check_edit('Subnets_Controller', 'redirect'))
|
||
$this->acl_check_new('Notifications_Controller', 'subnet'))
|
||
{
|
||
$links[] = html::anchor('notifications/subnet/' . $subnet->id, __('Notifications'));
|
||
}
|
freenetis/branches/1.1/db_upgrades/upgrade_1.1.0~alpha44.php | ||
---|---|---|
<?php defined('SYSPATH') or die('No direct script access.');
|
||
/*
|
||
* This file is part of open source system FreenetIS
|
||
* and it is released under GPLv3 licence.
|
||
*
|
||
* More info about licence can be found:
|
||
* http://www.gnu.org/licenses/gpl-3.0.html
|
||
*
|
||
* More info about project can be found:
|
||
* http://www.freenetis.org/
|
||
*
|
||
*/
|
||
|
||
/**
|
||
* This upgrade is not equal to any of previos upgrades
|
||
*
|
||
* @author David Raška
|
||
*/
|
||
$upgrade_equal_to['1.1.0~alpha44'] = array();
|
||
|
||
/**
|
||
* ACL records for notifications, messages and redirect controllers
|
||
*
|
||
* @author David Raška
|
||
*/
|
||
$upgrade_sql['1.1.0~alpha44'] = array
|
||
(
|
||
// Notification Controller AXO
|
||
"INSERT INTO `axo` (`id`, `section_value`, `value`, `name`) VALUES ('204', 'Notifications_Controller', 'member', 'Member notification');",
|
||
|
||
"INSERT INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES ('38', 'Notifications_Controller', 'member');",
|
||
|
||
"INSERT INTO `axo` (`id`, `section_value`, `value`, `name`) VALUES ('205', 'Notifications_Controller', 'members', 'Members notification');",
|
||
|
||
"INSERT INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES ('38', 'Notifications_Controller', 'members');",
|
||
|
||
"INSERT INTO `axo` (`id`, `section_value`, `value`, `name`) VALUES ('206', 'Notifications_Controller', 'subnet', 'Subnet notification');",
|
||
|
||
"INSERT INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES ('38', 'Notifications_Controller', 'subnet');",
|
||
|
||
"INSERT INTO `axo` (`id`, `section_value`, `value`, `name`) VALUES ('207', 'Notifications_Controller', 'cloud', 'Cloud notification');",
|
||
|
||
"INSERT INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES ('38', 'Notifications_Controller', 'cloud');",
|
||
|
||
// Messages Controller AXO
|
||
"INSERT INTO `axo` (`id`, `section_value`, `value`, `name`) VALUES ('208', 'Messages_Controller', 'activate', 'Activate message');",
|
||
|
||
"INSERT INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES ('38', 'Messages_Controller', 'activate');",
|
||
|
||
"INSERT INTO `axo` (`id`, `section_value`, `value`, `name`) VALUES ('209', 'Messages_Controller', 'deactivate', 'Deactivate message');",
|
||
|
||
"INSERT INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES ('38', 'Messages_Controller', 'deactivate');",
|
||
|
||
"INSERT INTO `axo` (`id`, `section_value`, `value`, `name`) VALUES ('210', 'Messages_Controller', 'preview', 'Preview message');",
|
||
|
||
"INSERT INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES ('38', 'Messages_Controller', 'preview');",
|
||
|
||
// Redirect Controller AXO
|
||
"INSERT INTO `axo` (`id`, `section_value`, `value`, `name`) VALUES ('211', 'Redirect_Controller', 'redirect', 'Redirection');",
|
||
|
||
"INSERT INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES ('38', 'Redirect_Controller', 'redirect');",
|
||
|
||
// Members whitelists Controller AXO
|
||
"INSERT INTO `axo` (`id`, `section_value`, `value`, `name`) VALUES ('212', 'Members_whitelists_Controller', 'whitelist', 'Whitelist');",
|
||
|
||
"INSERT INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES ('38', 'Members_whitelists_Controller', 'whitelist');",
|
||
|
||
// AXO Sections
|
||
"INSERT INTO `axo_sections` (`id`, `value`, `name`) VALUES (33, 'Notifications_Controller', 'Notifications');",
|
||
|
||
"INSERT INTO `axo_sections` (`id`, `value`, `name`) VALUES (34, 'Redirect_Controller', 'Redirection');",
|
||
|
||
"INSERT INTO `axo_sections` (`id`, `value`, `name`) VALUES (35, 'Members_Whitelists_Controller', 'Members Whitelists');",
|
||
);
|
freenetis/branches/1.1/version.php | ||
---|---|---|
* The current version of FreenetIS.
|
||
* This value must be changed by developers in a new release of FreenetIS.
|
||
*/
|
||
define('FREENETIS_VERSION', '1.1.0~alpha43');
|
||
define('FREENETIS_VERSION', '1.1.0~alpha44');
|
Také k dispozici: Unified diff
Opravy:
- fixes #689 - Pridani samostatnych pristupovych prav pro upozorneni