Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1796

Přidáno uživatelem Ondřej Fibich před téměř 12 roky(ů)

Novinky:
- #143: Zabezpeceni neplatneho pridavani pozadavku o propojeni

Upravy:
- odstranena krpa v css u posilani posty

Zobrazit rozdíly:

freenetis/branches/1.1/media/css/style.css
}
.mail_subject_field {
width: 650px;
width: 630px;
}
.button_link {
freenetis/branches/1.1/application/i18n/cs_CZ/texts.php
'ip address has been successfully deleted' => 'IP adresa byla úspěšně smazána.',
'ip address has been successfully updated' => 'IP adresa byla úspěšně upravena.',
'ip address is already monitored' => 'IP adresa je už monitorována',
'ip address is not available anymore' => 'IP adresa již není dostupná.',
'ip address is required' => 'IP adresa je vyžadována.',
'ip address is successfully saved' => 'IP adresa byla úspěšně uložena.',
'ip address is successfully updated' => 'IP adresa byla úspěšně upravena.',
......
'sms settings' => 'SMS nastavení',
'some phones wasn\'t founded' => 'Některé telefony nebyly nalezeny',
'someone from the ip address %s, probably you, requested to change your password' => 'někdo, patrně Vy, žádal z IP %s o změnu vašeho hesla',
'someone have already requested for the same connection' => 'O stejné připojení už zažádal jiný člen.',
'specific symbol' => 'Specifický symbol',
'specification of type' => 'Specifikace typu',
'speed for active members' => 'Rychlost pro aktivní členy',
......
'you cannot vote twice about same work!' => 'Nemůžete hlasovat dvakrát o stejné práci!',
'you do not have required privilegies in database to perform this action' => 'Nemáte potřebná práva v databázi, pro provedení této akce',
'you are in debt' => 'Máte dluh',
'you have already requested for the same connection' => 'O stejné připojení už jste zažádal.',
'you have been successfully logged in' => 'Byl jste úspěšně přihlášen.',
'you have been successfully logged out' => 'Byl jste úspěšně odhlášen.',
'you have no permission to access redirection' => 'Nemáte práva k zobrazení přesměrování',
freenetis/branches/1.1/application/models/subnet.php
* from registered connection. If he is the null is returned.
* If not then subnet from which he is connected is searched.
* If the user may obtain this IP from the searched subnet
* the ID of subnet is returned.
* the ID of subnet is returned. (but there must not be any connection
* request on this connection already in tha database)
*
* @author Ondřej Fibich
* @param int $member_id User description
* @author Ondřej Fibich
* @param string $ip_address IP address from which the connection request is made
* @return int|null Subnet ID or null if invalid request was made
*/
public function get_subnet_for_connection_request($member_id, $ip_address)
public function get_subnet_for_connection_request($ip_address)
{
$result = $this->db->query("
SELECT s.id
FROM subnets s
LEFT JOIN ip_addresses ip ON ip.subnet_id = s.id AND
inet_aton(ip.ip_address) = inet_aton(?)
WHERE inet_aton(s.netmask) & inet_aton(?) = inet_aton(s.network_address)
", $ip_address, $ip_address);
LEFT JOIN connection_requests cr ON cr.ip_address = ip.ip_address
WHERE inet_aton(s.netmask) & inet_aton(?) = inet_aton(s.network_address) AND
(cr.id IS NULL OR cr.state <> ?)
", $ip_address, $ip_address, Connection_request_Model::STATE_UNDECIDED);
return ($result->count() == 1 ? $result->current()->id : NULL);
}
freenetis/branches/1.1/application/models/connection_request.php
", Config::get('lang'), $member_id);
}
/**
* Gets an undecided connection that contains given IP
*
* @param string $ip_address
* @return ORM_Iterator
*/
public function get_undecided_connection_with_ip($ip_address)
{
return $this->where(array(
'ip_address' => $ip_address,
'state' => self::STATE_UNDECIDED
))->find_all();
}
}
freenetis/branches/1.1/application/controllers/connection_requests.php
Controller::warning(PARAMETER);
}
// someone stole that IP, or someone tried to hack FN.
if ($subnet_model->get_subnet_for_connection_request($ip_address) == NULL)
{
status::warning('IP address is not available anymore.');
url::redirect('connection_requests/show_by_member/' . $this->member_id);
}
// check if someone does not requested for this IP already
$cr_model = new Connection_request_Model();
$prevs = $cr_model->get_undecided_connection_with_ip($ip_address);
if ($prevs->count() > 0)
{
// wait you have done this already
if ($prevs->current()->member_id == $this->member_id)
{
status::warning('You have already requested for the same connection.');
}
else
{
status::warning('Someone have already requested for the same connection.');
}
url::redirect('connection_requests/show_by_member/' . $this->member_id);
}
unset($prevs);
// all device templates
$arr_device_templates = array
(
......
if ($form->validate())
{
$form_data = $form->as_array();
$cr_model = new Connection_request_Model();
$cr_model->clear();
if (!isset($form_data['member_id']))
{
freenetis/branches/1.1/application/libraries/MY_Controller.php
if (Settings::get('connection_request_enable') &&
url_lang::current(2) != 'connection_requests/add')
{
$sid = ORM::factory('subnet')->get_subnet_for_connection_request(
$this->member_id, $ra_ip);
$sid = ORM::factory('subnet')->get_subnet_for_connection_request($ra_ip);
// can user make connection request for $ra_ip?
if ($sid)
{ // so we will inform him!

Také k dispozici: Unified diff