Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1112

Přidáno uživatelem Jiří Sviták před asi 13 roky(ů)

Hromada prace...

Zobrazit rozdíly:

freenetis/branches/redirection/application/i18n/cs_CZ/texts.php
'if you want to run more than one freenetis in a single database' => 'pokud chcete provozovat více než jednu FreeNetIS instalaci v jedné databázi',
'if you want to run multiple freenetis installations in a single database, change this' => 'Jestliže chcete provozovat několik FreeNetIS instalací v jedné databázi, změňte toto.',
'ignore' => 'Ignorovat',
'ignore whitelist' => 'Ignorovat whitelist',
'ignore whitelist' => 'Ignorovat bílou listinu',
'import dhcp export from mikrotik' => 'Import exportu DHCP z Mikrotiku',
'import has been successfully finished' => 'Import byl úspěšně dokončen.',
'import has failed' => 'Import selhal.',
......
'redirection has been successfully canceled' => 'Přesměrování bylo úspěšně zrušeno.',
'redirection has been successfully update' => 'Přesměrování bylo úspěšně upraveno.',
'redirection has been successfully set' => 'Přesměrování bylo úspěšně nastaveno.',
'redirection logo url' => 'URL pro logo na stránce přesměrování',
'redirection logs' => 'Logy přesměrování',
'redirection "%s" for %d ip addresses have been activated' => 'Přesměrování "%s" pro %d IP adres bylo aktivováno.',
'redirection records' => 'Záznamy přesměrování',
freenetis/branches/redirection/application/i18n/cs_CZ/help.php
'entrance_fee_instalment' => 'Splátka vstupního příspěvku je pro případ, kdy člen chce splácet vstupní příspěvek postupně. Zde nastavená částka mu bude každý měsíc stržena z jeho kreditního účtu. Pokud nechcete splátky využít, nechte výši splátky rovnu výši vstupního příspěvku.',
'gateway' => 'Určuje, zda-li je tato IP adresa bránou ve své podsíti. Typicky má toto nastavena každá IP adresa končící na jedničku v síti s prefixem 24.',
'gps_coordinates' => 'GPS souřadnice může být ve tvaru desetinného čísla, nebo: hodiny°minuty\'sekundy&quot.',
'ignore_whitelist' => 'Umožňuje této zprávě, je-li aktivována, ignorovat bílou listinu. Určeno pro velmi speciální případy, například pokud je připojen městský úřad, který je na trvalé bílé listině, aby nebyl obtěžován a i přesto chceme jeho počítače přesměrovat kvůli informaci o výpadku.',
'mail_to_field' => 'Políčko bere jako vstup login uživatele, kterému chcete odeslat zprávu. Příjemců můžete uvést více, oddělte je čárkou.',
'member_name' => 'Vyplňujte v případě přidávání nějaké organizace. Pokud připojujete běžného člena, tak jako výsledné jméno člena se použije jeho jméno a příjmení.',
'never_redirect' => 'Zapnete-li tuto volbu, pak nebude možné tuto IP adresu nikdy přesměrovat běžným přesměrováním. Toto je vhodné zejména pro významné partnery jako jsou úřady, školy atd.',
......
'recalculate_fees' => 'Pro primární strhávání členských příspěvků používejte funkci pro globální strhávání členských příspěvků v Účetním deníku. Tuto funkci používejte opatrně a to jen v případě, že máte správně strženy všechny členské příspěvky pro všechny členy od založení sdružení až po současné datum. Pak můžete tomuto členovi přepočítat stržení členských příspěvků v případě, že u něj došlo k nutnosti je přepočítat, např. chybné datum vstupu, vznikla nutnost přidat přerušení členství apod.',
'recalculate_entrance_fees' => 'Pro primární strhávání vstupních příspěvků používejte funkci pro globální strhávání v účetním deníku. Tuto funkci používejte jen v případě, že došlo k nějakému omylu, například, že měl zaplatit vstupní a pak se ukázalo, že nemusel.',
'registration_logo' => 'Jedná se o logo sdružení, které se zobrazí v levém horním rohu vyexportované přihlášky',
'self_cancel' => 'Je-li daná zpráva samozrušitelná, znamená to, že při jejím zobrazení členovi se v patičce stránky objeví odkaz, který mu umožní přesměrování vypnout. Vhodné pro zprávy informativního charakteru. Rozlišuje se samozrušitelnost pro jednu IP adresu anebo pro všechny IP adresy člena.',
'self_cancel_text' => 'Text pro odkaz určený k zrušení přesměrování členem. Tento text se zobrazuje v patičce stránky přesměrovanému členovi.',
'self_cancel_url' => 'URL, která bude v odkazu pro zrušení přesměrování, které si může člen zrušit sám. Typicky je to adresa na centrální bráně, na které běží lighthttpd web server. Pravidla firewallu na centrální bráně takto poznají uživatelův úmysl ukončit přesměrování. Stránka tedy může obsahovat stručnou informaci o ukončení přesměrování, případně temporary HTTP redirect na jinou informující stránku.',
'service' => 'Je-li pro tuto IP adresu zapnuta služba, pak je tato IP adresa využívána pro Radius. Typicky jde o IP adresy aktivních síťových prvků, na které je se možné pomocí Radiusu přihlásit.',
freenetis/branches/redirection/application/helpers/callback.php
*/
public static function cancel_redirection_of_member($item, $name)
{
echo url_lang::lang('texts.Cancel').' ';
echo html::anchor(url_lang::base()."redirect/delete/$item->ip_address_id/$item->message_id/member", url_lang::lang('texts.one IP address'));
echo ' | ';
echo html::anchor(url_lang::base()."redirect/delete_from_member/$item->member_id/$item->message_id", url_lang::lang('texts.all ip addresses of member'));
if (empty($item->message_id))
{
echo ' ';
}
else
{
echo url_lang::lang('texts.Cancel').' ';
echo html::anchor(url_lang::base()."redirect/delete/$item->ip_address_id/$item->message_id/member", url_lang::lang('texts.one IP address'));
echo ' | ';
echo html::anchor(url_lang::base()."redirect/delete_from_member/$item->member_id/$item->message_id", url_lang::lang('texts.all ip addresses of member'));
}
}
/**
......
}
/**
* Field for updating messages. Only three special system messages can be updated.
* Other types of redirection has to be set manually by user.
* Activates multiple redirections. All interrupted members, all debtors
* with credit below debtor boundary and all should-pay members with
* credit below payment notice boundary may be redirected.
* @author Jiri Svitak
* @param unknown_type $item
* @param unknown_type $name
*/
static function message_update_field($item, $name)
static function message_activate_field($item, $name)
{
$message = new Message_Model($item->id);
if ($message->type == Message_Model::$contact_information)
if ($message->type == Message_Model::$contact_information
|| $message->type == Message_Model::$cancel_message
|| $message->type == Message_Model::$unknown_device_message)
{
echo ' ';
}
else
{
echo html::anchor(url_lang::base().'messages/update/'.$message->id, url_lang::lang('texts.Update'));
echo html::anchor(url_lang::base().'messages/activate/'.$message->id, url_lang::lang('texts.Activate'));
}
}
freenetis/branches/redirection/application/models/ip_address.php
SELECT ip.id, ip.ip_address, ip.whitelisted, s.name AS subnet_name, m.name AS member_name,
m.variable_symbol, a.balance
FROM ip_addresses ip
JOIN subnets s ON s.id = ip.subnet_id
JOIN ifaces i ON i.id = ip.iface_id
JOIN devices d ON d.id = i.device_id
JOIN users u ON u.id = d.user_id
......
function get_current_redirection_of_ip_address($ip_address)
{
return $this->db->query("
SELECT m.id, m.text, m.self_cancel, ip.ip_address, ip.whitelisted, s.name AS subnet_name,
members.name AS member_name, members.id AS member_id,
members.variable_symbol, a.balance, mip.comment
FROM messages m
JOIN messages_ip_addresses mip ON m.id = mip.message_id
JOIN ip_addresses ip ON ip.id = mip.ip_address_id
JOIN ifaces i ON i.id = ip.iface_id
JOIN devices d ON d.id = i.device_id
JOIN users u ON u.id = d.user_id
JOIN members ON members.id = u.member_id
JOIN accounts a ON a.member_id = m.id AND m.id <> 1
JOIN subnets s ON s.id = ip.subnet_id
WHERE ip.ip_address = '$ip_address'
ORDER BY m.self_cancel DESC, mip.datetime ASC
LIMIT 1
");
/*return $this->db->query("
SELECT *
FROM
(
......
) q
GROUP BY q.id
");
*/
}
/**
freenetis/branches/redirection/application/controllers/subnets.php
if ($this->acl_check_edit('Devices_Controller', 'subnet'))
$grid->action_field('subnet_id')->label(url_lang::lang('texts.Subnet')) ->url(url_lang::base().'subnets/edit') ->action(url_lang::lang('texts.Edit'))->class('center');
if ($this->acl_check_new('Messages_Controller', 'subnet'))
$grid->action_field('subnet_id')->label(url_lang::lang('texts.Subnet')) ->url(url_lang::base().'redirect/add_to_subnet') ->action(url_lang::lang('texts.Redirect'))->class('center');
//if ($this->acl_check_new('Messages_Controller', 'subnet'))
// $grid->action_field('subnet_id')->label(url_lang::lang('texts.Subnet')) ->url(url_lang::base().'redirect/add_to_subnet') ->action(url_lang::lang('texts.Redirect'))->class('center');
if ($this->acl_check_delete('Devices_Controller', 'subnet'))
$grid->action_field('subnet_id')->label(url_lang::lang('texts.Subnet')) ->url(url_lang::base().'subnets/delete') ->action(url_lang::lang('texts.Delete'))->class('center')->script('onclick="return potvrd(\''.url_lang::lang('texts.Do you want to delete this subnet').'\');"');
freenetis/branches/redirection/application/controllers/scheduler.php
// script needs to be run from its server machine
if (server::remote_addr() != server::server_addr())
die();
$member_model = new Member_Model();
// for debugging
/*
if (date('w') == '2' && date('H:i') == '13:16')
{
echo date('l H:i');
$member_model->update_payment_notice(-10000000, 0);
}
$this->profiler = new Profiler();
echo $this->profiler->render(true);
*/
// automatic redirection of 'should-pay' members
// tuesday nine o'clock and thursday nine o'clock (0 - sunday, 1 - monday, etc.)
if ((date('w') == '2' && date('H:i') == '09:00') ||
(date('w') == '4' && date('H:i') == '09:00'))
{
/*
$fee_model = new Fee_Model();
$fee = $fee_model->get_by_date_type(date('Y-m-d'), 'regular member fee');
if ($fee->id)
$current_fee = $fee->fee;
*/
$member_model->update_payment_notice(-10000000, 0);
}
// redirection of members with interrupted membership
// update system lock status every day
if ((date('H:i') == '00:00'))
{
$member_model->update_membership_interrupts();
$member_model->update_lock_status();
}
freenetis/branches/redirection/application/controllers/members.php
$grid->add_new_button(url_lang::base().'members/add', url_lang::lang('texts.Add new member'));
if ($this->acl_check_edit('Members_Controller', 'registration'))
$grid->add_new_button(url_lang::base().'members/registration', url_lang::lang('texts.Edit registrations'));
if ($this->acl_check_edit('Devices_Controller', 'redirect'))
$grid->add_new_button(url_lang::base().'redirect/members', url_lang::lang('texts.Redirection'));
if ($this->acl_check_view(get_class($this), 'members'))
{
// xls export of members, works fine in OpenOffice,
......
$grid->order_field('town')->label(url_lang::lang('texts.Town'));
//$grid->order_field('quarter')->label(url_lang::lang('texts.Quarter'));
$grid->order_callback_field('balance')->label(url_lang::lang('texts.Balance'))->callback('callback::balance_field');
$grid->order_callback_field('redirect')->label(url_lang::lang('texts.Redir'))->callback('callback::redirect_field');
//$grid->order_callback_field('redirect')->label(url_lang::lang('texts.Redir'))->callback('callback::redirect_field');
//$grid->order_field('comment')->label(url_lang::lang('texts.Comment'));
// action fields
if ($this->acl_check_view(get_class($this), 'members'))
freenetis/branches/redirection/application/controllers/messages.php
// $grid->callback_field('id')->label(url_lang::lang('texts.Preview'))->callback('callback::message_preview_field');
if ($this->acl_check_edit('Messages_Controller', 'message'))
$grid->action_field('id') ->label(url_lang::lang('texts.Edit'))->url(url_lang::base().'messages/edit')->action(url_lang::lang('texts.Edit'));
//if ($this->acl_check_edit('Messages_Controller', 'message'))
// $grid->callback_field('id')->label(url_lang::lang('texts.Update'))->callback('callback::message_update_field');
if ($this->acl_check_edit('Messages_Controller', 'message'))
$grid->callback_field('id')->label(url_lang::lang('texts.Activate'))->callback('callback::message_activate_field');
if ($this->acl_check_delete('Messages_Controller', 'message'))
$grid->callback_field('id')->label(url_lang::lang('texts.Delete'))->callback('callback::message_delete_field');
$grid->datasource($messages);
......
$message->type == Message_Model::$debtor_message ||
$message->type == Message_Model::$payment_notice_message)
{
$form->dropdown('self_cancel')->label(url_lang::lang('texts.Self-cancelable').':')->options($self_cancel)->selected($message->self_cancel);
$form->dropdown('ignore_whitelist')->label(url_lang::lang('texts.Ignore whitelist').':')->options($array)->selected($message->ignore_whitelist);
$form->dropdown('self_cancel')->label(url_lang::lang('texts.Self-cancelable').':&nbsp;'.help::hint('self_cancel'))->options($self_cancel)->selected($message->self_cancel);
$form->dropdown('ignore_whitelist')->label(url_lang::lang('texts.Ignore whitelist').':&nbsp;'.help::hint('ignore_whitelist'))->options($array)->selected($message->ignore_whitelist);
}
//echo $message->self_cancel; die();
$form->html_textarea('text')->label(url_lang::lang('texts.Content of the message').':&nbsp;'.help::hint('content_of_message'))->rows(5)->cols(100)->value($message->text);
......
* @author Jiri Svitak
* @param unknown_type $message_id
*/
function update($message_id)
function activate($message_id)
{
// preparation
$message = new Message_Model($message_id);
......
// choose which message to update
switch($message->type)
{
/*
case Message_Model::$cancel_message:
// cancel message must be set somewhere else than in static folder
//Redirection_Controller::update('cancel_message', $contact, $content, '');
break;
case Message_Model::$unknown_device_message:
Redirection_Controller::update('unknown_device_message', $contact, $content, '');
break;
*/
case Message_Model::$interrupted_membership_message:
// delete old redirections
$database->delete('messages_ip_addresses', array('message_id' => $message_id));
......
// set new redirections in junction table
foreach($ips as $ip)
{
// replace special tags
/*
foreach ($ip as $key => $value)
{
$content = str_replace('{'.$key.'}', $value, $content);
}*/
//Redirection_Controller::update($ip->ip_address, $contact, $content, '');
// insert values
$values[] = "($message->id, $ip->id, $user_id, '', '$datetime')";
$ip_count++;
......
case Message_Model::$debtor_message:
// boundary credit status
$debtor_boundary = $this->settings->get('debtor_boundary');
if ($debtor_boundary === null)
// saved as text, so comparation to empty string is necessary
if ($debtor_boundary == "")
{
//$db->transaction_rollback();
$message_model->transaction_rollback();
$this->session->set_flash('message', url_lang::lang('texts.Error - debtor credit boundary has not been set.'));
url::redirect(url_lang::base().'messages/show_all');
}
......
// set new redirections in junction table
foreach($ips as $ip)
{
// replace special tags
/*
foreach ($ip as $key => $value)
{
$content = str_replace('{'.$key.'}', $value, $content);
}
*
*/
//Redirection_Controller::update($ip->ip_address, $contact, $content, '');
// insert values
$values[] = "($message->id, $ip->id, $user_id, '', '$datetime')";
$ip_count++;
......
case Message_Model::$payment_notice_message:
// boundary credit status
$payment_notice_boundary = $this->settings->get('payment_notice_boundary');
if ($payment_notice_boundary === null)
if ($payment_notice_boundary == "")
{
//$db->transaction_rollback();
$message_model->transaction_rollback();
$this->session->set_flash('message', url_lang::lang('texts.Error - payment notice credit boundary has not been set.'));
url::redirect(url_lang::base().'messages/show_all');
}
......
// set new redirections in junction table
foreach($ips as $ip)
{
// replace special tags
/*
foreach ($ip as $key => $value)
{
$content = str_replace('{'.$key.'}', $value, $content);
}*/
//$cancel_link = html::anchor($this->settings->get('self_cancel_url'), url_lang::lang('texts.I accept this message and I want to cancel this redirection'));
//Redirection_Controller::update($ip->ip_address, $contact, $content, $cancel_link);
// insert values
$values[] = "($message->id, $ip->id, $user_id, '', '$datetime')";
$ip_count++;
......
catch (Exception $e)
{
$message_model->transaction_rollback();
$this->session->set_flash('message', url_lang::lang('texts.Error - cannot set redirection.'));
$this->session->set_flash('message', url_lang::lang('texts.Error - cant set redirection.'));
url::redirect(url_lang::base().'messages/show_all');
}
*
*/
}
freenetis/branches/redirection/application/controllers/redirect.php
// creating of new forge
$this->form = new Forge(url_lang::base()."redirect/settings", '', 'POST', array('id' => 'article_form'));
$this->form->set_attr('class', 'form_class')->set_attr('method', 'post');
$this->form->group('')->label(url_lang::lang('texts.Gateway'));
$this->form->group('')->label(url_lang::lang('texts.Redirection settings'));
$this->form->input('gateway')->label(url_lang::lang('texts.Gateway IP address').":")->value($this->settings->get('gateway'));
$this->form->input('payment_notice_boundary')->label(url_lang::lang('texts.Payment notice boundary')." (".$this->settings->get('currency')."):&nbsp;".help::hint('payment_notice_boundary'))->value($this->settings->get('payment_notice_boundary'));
$this->form->input('debtor_boundary')->label(url_lang::lang('texts.Debtor boundary')." (".$this->settings->get('currency')."):&nbsp;".help::hint('debtor_boundary'))->value($this->settings->get('debtor_boundary'));
$this->form->input('redirection_logo_url')->label(url_lang::lang('texts.Redirection logo URL').":")->value($this->settings->get('redirection_logo_url'));
$this->form->input('self_cancel_text')->label(url_lang::lang('texts.Text for self cancel anchor').":&nbsp;".help::hint('self_cancel_text'))->value($this->settings->get('self_cancel_text'));
$this->form->input('self_cancel_url')->label(url_lang::lang('texts.URL for self cancel possibility').":&nbsp;".help::hint('self_cancel_url'))->value($this->settings->get('self_cancel_url'));
$this->form->submit('submit')->value(url_lang::lang('texts.Save'));
......
$db = new Database();
$db->delete('messages_ip_addresses', $array);
$ip = new Ip_address_Model($ip_address_id);
self::update($ip->ip_address);
$this->session->set_flash('message', url_lang::lang('texts.Redirection has been successfully canceled.'));
if ($from == 'member')
url::redirect(url_lang::base().'members/show/'.$ip->iface->device->user->member_id);
......
$db->insert('messages_ip_addresses', array('message_id' => $form_data['message_id'],
'ip_address_id' => $ip->id, 'user_id' => $this->session->get('user_id'),
'comment' => $form_data['comment'], 'datetime' => date('Y-m-d H:i:s')));
// generate html page
self::find_current_redirection_and_update($ip->ip_address);
}
}
// set flash message
......
*/
function set_whitelist($member_id)
{
// access rights
if (!$this->acl_check_edit('Messages_Controller', 'member'))
Controller::error(ACCESS);
$db = new Database();
$ip_model = new Ip_address_Model();
$ips = $ip_model->get_ip_addresses_of_member($member_id);
foreach($ips as $ip)
$whitelist_array[Ip_address_Model::$no_whitelist] = url_lang::lang('texts.No whitelist');
$whitelist_array[Ip_address_Model::$permanent_whitelist] = url_lang::lang('texts.Permanent whitelist');
$whitelist_array[Ip_address_Model::$temporary_whitelist] = url_lang::lang('texts.Temporary whitelist');
// form
$form = new Forge(url_lang::base().'redirect/set_whitelist/'.$member_id, '', 'POST', array('id' => 'article_form'));
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
$form->dropdown('whitelist')->label(url_lang::lang('texts.Whitelist').':')->options($whitelist_array);
$form->submit('submit')->value(url_lang::lang('texts.Edit'));
if ($form->validate())
{
$ip = new Ip_address_Model($ip->id);
$ip->whitelisted = $whitelist;
$ip->save();
if (!$this->acl_check_edit('Messages_Controller', 'member'))
Controller::error(ACCESS);
$form_data = $form->as_array();
$ip_model = new Ip_address_Model();
$ips = $ip_model->get_ip_addresses_of_member($member_id);
foreach($ips as $ip)
{
$ip = new Ip_address_Model($ip->id);
$ip->whitelisted = $form_data['whitelist'];
$ip->save();
}
// set flash message
$this->session->set_flash('message', url_lang::lang('texts.Whitelist setting has been successfully set.'));
url::redirect(url_lang::base().'members/show/'.$member_id);
}
// set flash message
$this->session->set_flash('message', url_lang::lang('texts.Whitelist setting has been successfully set.'));
url::redirect(url_lang::base().'members/show/'.$member_id);
else
{
// view
$headline = url_lang::lang('texts.Whitelist');
$view = new View('main');
$view->title = $headline;
$view->content = new View('form');
$view->content->headline = $headline;
$view->content->link_back = html::anchor(url_lang::base().'members/show/'.$member_id, url_lang::lang('texts.Back to the member'));
$view->content->form = $form->html();
$view->render(TRUE);
}
}
freenetis/branches/redirection/redirection/cancel.php
<?php
/**
* Enables self canceling messages. Written in pure PHP due to performance reasons.
* @author Jiri Svitak
*
*/
// loading to access database password
define('SYSPATH', str_replace('\\', '/', realpath('system')).'/');
require '../config.php';
// connect to database
$link = mysql_connect($config['db_host'], $config['db_user'], $config['db_password']) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8", $link) or die(mysql_error());
mysql_query("SET NAMES utf8", $link) or die(mysql_error());
mysql_select_db($config['db_name']) or die(mysql_error());
// obtain remote ip address
$ip_address = $_SERVER['REMOTE_ADDR'];
// content of redirection message
$message_query = "
SELECT m.id, m.text, m.self_cancel, ip.ip_address, ip.whitelisted, s.name AS subnet_name,
members.name AS member_name, members.id AS member_id,
members.variable_symbol, a.balance, mip.comment
FROM messages m
JOIN messages_ip_addresses mip ON m.id = mip.message_id
JOIN ip_addresses ip ON ip.id = mip.ip_address_id
JOIN subnets s ON s.id = ip.subnet_id
JOIN ifaces i ON i.id = ip.iface_id
JOIN devices d ON d.id = i.device_id
JOIN users u ON u.id = d.user_id
JOIN members ON members.id = u.member_id
LEFT JOIN accounts a ON a.member_id = m.id AND m.id <> 1
WHERE ip.ip_address = '$ip_address'
ORDER BY m.self_cancel DESC, mip.datetime ASC
LIMIT 1";
$message_result = mysql_query($message_query, $link) or die(mysql_error());
$message = mysql_fetch_array($message_result);
if ($message['self_cancel'] == 0)
{
echo 'message cannot be canceled by user';
die();
}
if ($message['self_cancel'] == 1)
{
echo 'redirection canceled to all ip addresses of member';
}
else
{
echo 'redirection canceled just to this ip address';
}
?>
freenetis/branches/redirection/redirection/index.php
$ip_address = $_SERVER['REMOTE_ADDR'];
// content of redirection message
$message_query = "
SELECT *
FROM
(
SELECT m.id, m.text, m.self_cancel, ip.ip_address, ip.whitelisted, s.name AS subnet_name,
members.name AS member_name, members.id AS member_id,
members.variable_symbol, a.balance, mip.comment
FROM messages m
JOIN messages_ip_addresses mip ON m.id = mip.message_id
JOIN ip_addresses ip ON ip.id = mip.ip_address_id
JOIN subnets s ON s.id = ip.subnet_id
JOIN ifaces i ON i.id = ip.iface_id
JOIN devices d ON d.id = i.device_id
JOIN users u ON u.id = d.user_id
JOIN members ON members.id = u.member_id
LEFT JOIN accounts a ON a.member_id = m.id AND m.id <> 1
WHERE ip.ip_address = '$ip_address'
ORDER BY m.self_cancel DESC, mip.datetime ASC
) q
GROUP BY q.id";
SELECT m.id, m.text, m.self_cancel, ip.ip_address, ip.whitelisted, s.name AS subnet_name,
members.name AS member_name, members.id AS member_id,
members.variable_symbol, a.balance, mip.comment
FROM messages m
JOIN messages_ip_addresses mip ON m.id = mip.message_id
JOIN ip_addresses ip ON ip.id = mip.ip_address_id
JOIN subnets s ON s.id = ip.subnet_id
JOIN ifaces i ON i.id = ip.iface_id
JOIN devices d ON d.id = i.device_id
JOIN users u ON u.id = d.user_id
JOIN members ON members.id = u.member_id
LEFT JOIN accounts a ON a.member_id = m.id AND m.id <> 1
WHERE ip.ip_address = '$ip_address'
ORDER BY m.self_cancel DESC, mip.datetime ASC
LIMIT 1";
$message_result = mysql_query($message_query, $link) or die(mysql_error());
$message = mysql_fetch_array($message_result);
if ($message !== false)
......
$contact = str_replace('{'.$key.'}', $value, $contact);
}
}
// redirection logo url
$logo_query = "SELECT name, value FROM config WHERE name = 'redirection_logo_url'";
$logo_result = mysql_query($logo_query, $link) or die(mysql_error());
$logo_array = mysql_fetch_array($logo_result);
if (!$logo_array) { echo 'logo not set'; die(mysql_error()); }
$logo = $logo_array['value'];
// self cancelable messages have additional anchor for self canceling placed in footer
$scu_query = "SELECT name, value FROM config WHERE name = 'self_cancel_url'";
$scu_result = mysql_query($scu_query, $link) or die(mysql_error());
$scu_array = mysql_fetch_array($scu_result);
if (!$scu_array) { echo 'self_cancel_url not set'; die(mysql_error()); }
$scu = $scu_array['value'];
$sct_query = "SELECT name, value FROM config WHERE name = 'self_cancel_text'";
$sct_result = mysql_query($sct_query, $link) or die(mysql_error());
$sct_array = mysql_fetch_array($sct_result);
if (!$sct_array) { echo 'self_cancel_text not set'; die(mysql_error()); }
$sct = $sct_array['value'];
if ($message['self_cancel'] > 0)
$footer = '<a href="'.$this->settings->get('self_cancel_url').'">'.$this->settings->get('self_cancel_text').'</a>';
$footer = '<a href="'.$scu.'">'.$sct.'</a>';
else
$footer = '';
// close database connection
mysql_close($link);
?>
......
<body>
<div id="main">
<div id="header">
<h1 id="logo"><span>Freenetis</span></h1>
<?php//<h1 id="logo"><span>Freenetis</span></h1>?>
<h1 style="position:absolute;
top:24px;
left:18px;
background:url(./<?php echo $logo ?>);
width:212px;
height:49px;
">Freenetis</h1>
<!--<img src="<?php echo $logo ?>" />-->
<div class="status">
</div>

Také k dispozici: Unified diff