Revize 854
Přidáno uživatelem Jiří Sviták před více než 13 roky(ů)
freenetis/branches/redirection/application/models/messages_ip_addresses.php | ||
---|---|---|
<?php
|
||
class Messages_ip_addresses_Model extends Model
|
||
{
|
||
function get_redirections_of_member($member_id)
|
||
{
|
||
return $this->db->query("
|
||
SELECT ip.ip_address, m.id, m.name, mip.ip_address_id, mip.message_id, $member_id AS member_id
|
||
FROM messages m
|
||
JOIN messages_ip_addresses mip ON mip.message_id = m.id
|
||
JOIN ip_addresses ip ON mip.ip_address_id = ip.id
|
||
JOIN ifaces i ON ip.iface_id = i.id
|
||
JOIN devices d ON i.device_id = d.id
|
||
JOIN users u ON d.user_id = u.id
|
||
WHERE u.member_id = $member_id
|
||
");
|
||
}
|
||
|
||
|
||
function get_redirections_of_ip_address($ip_address_id)
|
||
{
|
freenetis/branches/redirection/application/models/ip_address.php | ||
---|---|---|
ip.ip_address = '$ip_address'
|
||
");
|
||
}
|
||
|
||
function get_redirections_of_member($member_id)
|
||
{
|
||
return $this->db->query("
|
||
SELECT ip.id AS ip_address_id, ip.whitelist,
|
||
m.id AS message_id, m.name,
|
||
$member_id AS member_id
|
||
FROM ip_addresses ip
|
||
JOIN ifaces i ON ip.iface_id = i.id
|
||
JOIN devices d ON i.device_id = d.id
|
||
JOIN users u ON d.user_id = u.id
|
||
LEFT JOIN messages_ip_addresses mip ON mip.ip_address_id = ip.id
|
||
LEFT JOIN messages m ON m.id = mip.message_id
|
||
WHERE u.member_id = $member_id
|
||
");
|
||
}
|
||
|
||
}
|
||
|
||
?>
|
freenetis/branches/redirection/application/controllers/members.php | ||
---|---|---|
$info = $ip_model->get_whitelist_info_of_member($member_id);
|
||
$whitelist_info = url_lang::lang('texts.IP addresses').': '.url_lang::lang('texts.No whitelist').' ('.$info[Ip_address_Model::$no_whitelist].'), '.
|
||
url_lang::lang('texts.Permanent whitelist').' ('.$info[Ip_address_Model::$permanent_whitelist].'), '.url_lang::lang('texts.Temporary whitelist').' ('.$info[Ip_address_Model::$temporary_whitelist].')';
|
||
/*$mip_model = new Messages_ip_addresses_Model();
|
||
$messages = $mip_model->get_redirections_of_member($member_id);
|
||
//$mip_model = new Messages_ip_addresses_Model();
|
||
//$messages = $mip_model->get_redirections_of_member($member_id);
|
||
$ip_addresses = $ip_model->get_redirections_of_member($member_id);
|
||
$redir_grid = new Grid(url_lang::base().'members', null, array(
|
||
'use_paginator' => false,
|
||
'use_selector' => false
|
||
... | ... | |
$redir_grid->add_new_button(url_lang::base().'redirect/set_whitelist/'.$member_id.'/'.Ip_address_Model::$permanent_whitelist, url_lang::lang('texts.Set permanent whitelist'));
|
||
$redir_grid->add_new_button(url_lang::base().'redirect/set_whitelist/'.$member_id.'/'.Ip_address_Model::$temporary_whitelist, url_lang::lang('texts.Set temporary whitelist'));
|
||
}
|
||
$redir_grid->callback_field('ip_address')->label(url_lang::lang('texts.IP address'))->callback('callback::ip_address_field');
|
||
$redir_grid->callback_field('ip_address')->label(url_lang::lang('texts.IP address'))->callback('callback::ip_address_field');
|
||
$redir_grid->field('whitelist')->label(url_lang::lang('texts.Whitelist'));
|
||
$redir_grid->field('name')->label(url_lang::lang('texts.Message'));
|
||
if ($this->acl_check_delete('Messages_Controller', 'ip_address'))
|
||
$redir_grid->callback_field('redirection')->label(url_lang::lang('texts.Canceling of message for redirection'))->callback("callback::cancel_redirection_of_member");
|
||
$redir_grid->datasource($messages);*/
|
||
$redir_grid->datasource($ip_addresses);
|
||
|
||
// billing
|
||
$billing = new Billing();
|
||
... | ... | |
$view->content->billing_has_driver = $has_driver;
|
||
$view->content->billing_account = $b_account;
|
||
$view->content->mis = $mi_grid;
|
||
//$view->content->whitelist_info = $whitelist_info;
|
||
$view->content->whitelist_info = '';
|
||
//$view->content->redir_grid = $redir_grid;
|
||
$view->content->redir_grid = '';
|
||
$view->content->whitelist_info = $whitelist_info;
|
||
$view->content->redir_grid = $redir_grid;
|
||
foreach($member_data as $key=>$val)
|
||
{
|
||
// IE dont render TD border if content is NULL, so we must put nbsp into empty fields.
|
freenetis/branches/redirection/application/views/members_show.php | ||
---|---|---|
<br class = "clear" />
|
||
<br />
|
||
|
||
<?php /*<h3><?php echo url_lang::lang('texts.Active redirections')?></h3>
|
||
<h3><?php echo url_lang::lang('texts.Active redirections')?></h3>
|
||
<?php echo $whitelist_info ?>
|
||
<br />
|
||
<?php echo $redir_grid ?>
|
||
<br />*/ ?>
|
||
<br />
|
||
|
||
<h3><?php echo url_lang::lang('texts.Users')?></h3>
|
||
<?php echo $users ?>
|
Také k dispozici: Unified diff
Zacatek prace na novem systemu presmerovani.