Revize 1101
Přidáno uživatelem Jiří Sviták před asi 13 roky(ů)
freenetis/branches/redirection/media/css/style.css | ||
---|---|---|
background: #FFFFFF url(../images/menu/administration.png) 5px 5px no-repeat;
|
||
}
|
||
#menu li.redirection {
|
||
background: #FFFFFF url(../images/menu/redirection.png) 5px 5px no-repeat;
|
||
background: #FFFFFF url(../images/menu/emblem-synchronizing.png) 5px 5px no-repeat;
|
||
}
|
||
#menu li.backup {
|
||
background: #FFFFFF url(../images/menu/backup.png) 5px 5px no-repeat;
|
freenetis/branches/redirection/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'message is already active' => 'Zpráva je již aktivní',
|
||
'message is active, cannot be deleted' => 'Zpráva je aktivní, nemůže být smazána',
|
||
'message name' => 'Název zprávy',
|
||
'messages' => 'Zprávy',
|
||
'messages for redirection' => 'Zprávy pro přesměrování',
|
||
'method' => 'Metoda',
|
||
'middle name' => 'Prostřední jméno',
|
freenetis/branches/redirection/application/controllers/web_interface.php | ||
---|---|---|
* Prints to output all IP addresses, which never should be redirected.
|
||
* @author Jiri Svitak
|
||
* @return unknown_type
|
||
* @TODO remove
|
||
*/
|
||
/*
|
||
function whitelisted_ip_addresses()
|
||
{
|
||
$ips = $this->db->query("
|
||
... | ... | |
echo "$ip->ip_address\n";
|
||
}
|
||
}
|
||
*/
|
||
|
||
/**
|
||
* Prints to output all subnets which have enabled redirection. Any IP address belonging to these
|
||
... | ... | |
SELECT DISTINCT IF(mip.ip_address_id IS NULL, ip.ip_address, NULL) AS ip_address
|
||
FROM ip_addresses ip
|
||
LEFT JOIN messages_ip_addresses mip ON mip.ip_address_id = ip.id
|
||
WHERE ip_address IS NOT NULL OR
|
||
(
|
||
whitelisted > 0 AND ip_address NOT IN
|
||
(
|
||
SELECT DISTINCT ip.ip_address
|
||
FROM ip_addresses ip
|
||
JOIN messages_ip_addresses mip ON mip.ip_address_id = ip.id
|
||
JOIN messages m ON m.id = mip.message_id
|
||
WHERE m.ignore_whitelist = 1
|
||
)
|
||
)
|
||
");
|
||
foreach($ips as $ip)
|
||
{
|
||
echo "$ip->ip_address\n";
|
||
}
|
||
}
|
||
/*
|
||
function allowed_ip_addresses()
|
||
{
|
||
$ips = $this->db->query("
|
||
SELECT DISTINCT IF(mip.ip_address_id IS NULL, ip.ip_address, NULL) AS ip_address
|
||
FROM ip_addresses ip
|
||
LEFT JOIN messages_ip_addresses mip ON mip.ip_address_id = ip.id
|
||
WHERE ip_address IS NOT NULL
|
||
");
|
||
foreach($ips as $ip)
|
||
... | ... | |
echo "$ip->ip_address\n";
|
||
}
|
||
}
|
||
*
|
||
*/
|
||
|
||
/**
|
||
* Prints IP addresses which have at least one self-cancelable redirection. Self-cancelable redirection is always before
|
||
... | ... | |
* @author Jiri Svitak
|
||
* @return unknown_type
|
||
*/
|
||
/*
|
||
function self_cancelable_ip_addresses()
|
||
{
|
||
$ips = $this->db->query("
|
||
... | ... | |
echo "$ip->ip_address\n";
|
||
}
|
||
}
|
||
|
||
/*
|
||
// asi neni nutne resit posilani zpravy z centralniho routeru, proste kdyz jsem prijde, tak je synchornizovany
|
||
function synchronized()
|
||
{
|
||
// get actual synchronization status
|
||
$synchronized = $this->settings->get('synchronized');
|
||
// set status to synchronized
|
||
$this->settings->set('synchronized', 1);
|
||
// return synchronization status to central router
|
||
return $synchronized;
|
||
}
|
||
*
|
||
*/
|
||
|
||
/**
|
||
... | ... | |
* they have already visited canceling page. So this method cancels redirection in Freenetis database.
|
||
* @author Jiri Svitak
|
||
* @return unknown_type
|
||
* @TODO remove
|
||
*/
|
||
/*
|
||
function already_seen_ip_addresses()
|
||
{
|
||
if (!empty($_POST))
|
||
... | ... | |
echo $form->html();
|
||
}
|
||
}
|
||
*/
|
||
|
||
|
||
/**
|
||
* Function is used for VoIP callback.
|
||
* @param <type> $user
|
freenetis/branches/redirection/application/controllers/messages.php | ||
---|---|---|
'limit_results' => $limit_results,
|
||
'url_array_ofset' => 1,
|
||
));
|
||
$grid->add_new_button(url_lang::base().'messages/add', url_lang::lang('texts.Add new message'));
|
||
$grid->order_field('id')->label('ID');
|
||
$grid->order_callback_field('message')->label(url_lang::lang('texts.Name'))->callback('callback::message_field');
|
||
$grid->callback_field('type')->label(url_lang::lang('texts.Type'))->callback('callback::message_type_field');
|
||
... | ... | |
$view->content = new View('show_all');
|
||
$view->content->headline = $headline;
|
||
$view->content->table = $grid;
|
||
$view->content->link_back = Redirect_Controller::get_redirection_settings_links();
|
||
$view->render(TRUE);
|
||
}
|
||
|
freenetis/branches/redirection/application/controllers/redirect.php | ||
---|---|---|
*/
|
||
class Redirect_Controller extends Controller
|
||
{
|
||
|
||
/**
|
||
* Gets redirection links.
|
||
* @author Jiri Svitak
|
||
*/
|
||
static function get_redirection_settings_links()
|
||
{
|
||
// creating links
|
||
$arr_links = array();
|
||
$arr_links[] = html::anchor(url_lang::base().'messages/show_all', url_lang::lang('texts.Messages for redirection'));
|
||
$arr_links[] = html::anchor(url_lang::base().'redirect/show_all', url_lang::lang('texts.Active Redirections'));
|
||
$arr_links[] = html::anchor(url_lang::base().'redirect/settings', url_lang::lang('texts.Settings'));
|
||
$arr_links[] = html::anchor(url_lang::base().'messages/add', url_lang::lang('texts.Add new message'));
|
||
$arr_links[] = html::anchor(url_lang::base().'redirect/generate_htaccess', url_lang::lang('texts.Generate htaccess'));
|
||
$links = implode(' | ', $arr_links);
|
||
return $links;
|
||
}
|
||
|
||
/**
|
||
* Shows all active redirections.
|
||
* @author Jiri Svitak
|
||
* @param $limit_results
|
||
... | ... | |
$view->content->headline = $headline;
|
||
$view->content->message = $this->session->get_once('message');
|
||
$view->content->table = $grid;
|
||
$view->content->link_back = self::get_redirection_settings_links();
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
... | ... | |
$view->content = new View('form');
|
||
$view->content->form = $this->form->html();
|
||
$view->content->headline = url_lang::lang('texts.Redirection settings');
|
||
$view->content->link_back = self::get_redirection_settings_links();
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
... | ... | |
}
|
||
}
|
||
|
||
/**
|
||
* Shows members with at least one whitelisted IP address.
|
||
* @author Jiri Svitak
|
||
*/
|
||
function show_whitelisted()
|
||
{
|
||
|
||
}
|
||
|
||
}
|
||
?>
|
freenetis/branches/redirection/application/views/menu.php | ||
---|---|---|
</ul>
|
||
</li><?php } ?>
|
||
|
||
<?php if ($this->acl_check_view('Messages_Controller', 'message')) { ?>
|
||
<li class="redirection"><h2><?php echo url_lang::lang('texts.Redirection') ?></h2>
|
||
<ul>
|
||
<li><?php echo html::anchor(url_lang::base().'redirect/show_all', url_lang::lang('texts.Active redirections')) ?></li>
|
||
<li><?php echo html::anchor(url_lang::base().'redirect/show_whitelisted', url_lang::lang('texts.Whitelist')) ?></li>
|
||
<li><?php echo html::anchor(url_lang::base().'messages/show_all', url_lang::lang('texts.Messages')) ?></li>
|
||
<li><?php echo html::anchor(url_lang::base().'redirect/settings', url_lang::lang('texts.Settings')) ?></li>
|
||
</ul>
|
||
</li>
|
||
<?php } ?>
|
||
|
||
<?php if ($this->acl_check_view('Settings_Controller', 'system') || $this->acl_check_view('Address_points_Controller', 'address_point')) { ?>
|
||
<li class="administration"><h2><?php echo url_lang::lang('texts.Administration') ?></h2>
|
||
... | ... | |
<?php if ($this->acl_check_view('Settings_Controller', 'system')) { ?>
|
||
<li><?php echo html::anchor(url_lang::base().'settings/info', url_lang::lang('texts.Settings')) ?></li>
|
||
<?php } ?>
|
||
<?php if ($this->acl_check_view('Messages_Controller', 'message')) {?>
|
||
<li><?php echo html::anchor(url_lang::base().'messages/show_all', url_lang::lang('texts.Redirection')) ?></li>
|
||
<?php } ?>
|
||
<?php if ($this->acl_check_view('Address_points_Controller', 'address_point')) {?>
|
||
<li><?php echo html::anchor(url_lang::base().'address_points/show_all', url_lang::lang('texts.Address points')) ?></li>
|
||
<?php } ?>
|
Také k dispozici: Unified diff
Pridano nove menu pro presmerovani, odeslani starsich a jeste neposlanych zmen.