Revize 1250
Přidáno uživatelem Michal Kliment před asi 13 roky(ů)
freenetis/branches/testing/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'gateway ip address' => 'IP adresa brány',
|
||
'gateway name' => 'Jméno brány',
|
||
'general information' => 'Obecné informace',
|
||
'general settings' => 'Obecná nastavení',
|
||
'generate' => 'Generovat',
|
||
'generate address book' => 'Vytvořit telefonní adresář',
|
||
'generate dhcp files' => 'Generovat soubory DHCP',
|
||
... | ... | |
'information for members (how to log in)' => 'Informace pro členy (jak se přihlásit)',
|
||
'information from header of bank statement' => 'Informace z hlavičky bankovního výpisu',
|
||
'infrastructure account' => 'Účet infrastruktury',
|
||
'initial debtor immunity' => 'Počáteční imunita pro dlužníka',
|
||
'initial immunity' => 'Počáteční imunita',
|
||
'insert' => 'Vložit',
|
||
'install' => 'Instalovat',
|
||
'installation' => 'Instalace',
|
freenetis/branches/testing/application/i18n/cs_CZ/help.php | ||
---|---|---|
'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".',
|
||
'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.',
|
||
'initial_immunity' => 'Počet dní, po které nemá být nový člen upozorňován na placení. Výchozí hodnota je 14 dní.',
|
||
'initial_debtor_immunity' => 'Počet dní, po které nemá být nový člen blokován a upozorňován jako dlužník. Výchozí hodnota je 35 dní.',
|
||
'login_name' => 'Přihlašovací jméno do systému je nutné k přihlášení. Přihlašovací jmémo může obsahovat znaky anglické abecedy, čísla, těčku a podtržítko, minimální délka jména je 5 znaků.',
|
||
'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í.',
|
freenetis/branches/testing/application/models/ip_address.php | ||
---|---|---|
LEFT JOIN users u ON u.id = d.user_id
|
||
) ip
|
||
JOIN members m ON m.id = ip.member_id
|
||
JOIN accounts a ON a.member_id = m.id AND m.id <> 1
|
||
JOIN accounts a ON a.member_id = m.id AND m.id <> ?
|
||
WHERE a.balance < ?
|
||
", $debtor_boundary);
|
||
AND CURDATE() - m.entrance_date >= ?
|
||
AND (ip.whitelisted IS NULL OR ip.whitelisted = 0)
|
||
",
|
||
array
|
||
(
|
||
Member_Model::ASSOCIATION,
|
||
$debtor_boundary,
|
||
Settings::get('initial_debtor_immunity')
|
||
));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
LEFT JOIN users u ON u.id = d.user_id
|
||
) ip
|
||
JOIN members m ON m.id = ip.member_id
|
||
JOIN accounts a ON a.member_id = m.id AND m.id <> 1
|
||
WHERE a.balance < ? AND a.balance >= ?
|
||
AND (ip.whitelisted IS NULL OR ip.whitelisted = 0)
|
||
", $payment_notice_boundary, $debtor_boundary);
|
||
JOIN accounts a ON a.member_id = m.id AND m.id <> ?
|
||
WHERE
|
||
(
|
||
CURDATE() - m.entrance_date >= ? AND a.balance >= ?
|
||
OR CURDATE() - m.entrance_date < ? AND CURDATE() - m.entrance_date >= ?
|
||
)
|
||
AND a.balance < ?
|
||
AND (ip.whitelisted IS NULL OR ip.whitelisted = 0)
|
||
",
|
||
array
|
||
(
|
||
Member_Model::ASSOCIATION,
|
||
Settings::get('initial_debtor_immunity'),
|
||
$debtor_boundary,
|
||
Settings::get('initial_debtor_immunity'),
|
||
Settings::get('initial_immunity'),
|
||
$payment_notice_boundary
|
||
));
|
||
}
|
||
|
||
|
||
... | ... | |
WHERE ip_address = ? AND member_id IS NOT NULL
|
||
", $ip_address);
|
||
}
|
||
|
||
/**
|
||
* Returns all IP addresses of members belongs to protective period
|
||
* (too new members to be redirected)
|
||
*
|
||
* @author Michal Kliment
|
||
* @return MySQL Iterator object
|
||
*/
|
||
public function get_ip_addresses_of_members_in_protective_period ()
|
||
{
|
||
return $this->db->query("
|
||
SELECT IFNULL(m.ip_address_id,ip.id) AS id
|
||
FROM
|
||
(
|
||
SELECT m.id, IFNULL(ip1.id,ip2.id) AS ip_address_id
|
||
FROM
|
||
(
|
||
SELECT m.id
|
||
FROM members m
|
||
WHERE (CURDATE() - m.entrance_date) <= 100 AND m.id NOT IN
|
||
(
|
||
SELECT mi.member_id
|
||
FROM membership_interrupts mi
|
||
LEFT JOIN members_fees mf ON mi.members_fee_id = mf.id
|
||
WHERE mf.activation_date <= CURDATE()
|
||
AND mf.deactivation_date >= CURDATE()
|
||
)
|
||
) m
|
||
LEFT JOIN users u ON u.member_id = m.id
|
||
LEFT JOIN devices d ON d.user_id = u.id
|
||
LEFT JOIN ifaces i ON i.device_id = d.id
|
||
LEFT JOIN vlan_ifaces vi ON vi.iface_id = i.id
|
||
LEFT JOIN ip_addresses ip1 ON ip1.iface_id = i.id
|
||
AND (ip1.whitelisted IS NULL OR ip1.whitelisted = 0)
|
||
LEFT JOIN ip_addresses ip2 ON ip2.vlan_iface_id = vi.id
|
||
AND (ip2.whitelisted IS NULL OR ip2.whitelisted = 0)
|
||
) m
|
||
LEFT JOIN ip_addresses ip ON ip.member_id = m.id
|
||
WHERE IFNULL(m.ip_address_id,ip.id) IS NOT NULL
|
||
");
|
||
}
|
||
|
||
public function set_whitelist ($whitelist, $ip_address_id = NULL)
|
||
{
|
||
if (!$ip_address_id && isset($this))
|
||
$ip_address_id = $this->id;
|
||
|
||
return $this->db->query("
|
||
UPDATE ip_addresses ip
|
||
SET whitelisted = ?
|
||
WHERE id = ?
|
||
", array($whitelist, $ip_address_id));
|
||
}
|
||
|
||
}
|
freenetis/branches/testing/application/models/users_contacts.php | ||
---|---|---|
JOIN membership_interrupts mi ON mi.member_id = m.id
|
||
JOIN members_fees mf ON mi.members_fee_id = mf.id
|
||
WHERE mf.activation_date <= CURDATE() AND mf.deactivation_date >= CURDATE()
|
||
) AND a.balance < ".intval($debtor_boundary)
|
||
) AND CURDATE() - m.entrance_date >= ".intval(Settings::get('initial_debtor_immunity'))."
|
||
AND a.balance < ".intval($debtor_boundary)
|
||
, $type, self::NO_WHITELIST, Member_Model::TYPE_FORMER);
|
||
}
|
||
|
||
... | ... | |
JOIN membership_interrupts mi ON mi.member_id = m.id
|
||
JOIN members_fees mf ON mi.members_fee_id = mf.id
|
||
WHERE mf.activation_date <= CURDATE() AND mf.deactivation_date >= CURDATE()
|
||
) AND a.balance >= ".intval($debtor_boundary)." AND a.balance < ".intval($payment_notice_boundary)
|
||
, $type, self::NO_WHITELIST, Member_Model::TYPE_FORMER);
|
||
)
|
||
AND a.balance < ".intval($payment_notice_boundary)."
|
||
AND
|
||
(
|
||
CURDATE() - m.entrance_date >= ".intval(Settings::get('initial_debtor_immunity'))."
|
||
AND a.balance >= ".intval($debtor_boundary)."
|
||
OR CURDATE() - m.entrance_date < ".intval(Settings::get('initial_debtor_immunity'))."
|
||
AND CURDATE() - m.entrance_date >= ".intval(Settings::get('initial_immunity'))."
|
||
)
|
||
",
|
||
array
|
||
(
|
||
$type,
|
||
self::NO_WHITELIST,
|
||
Member_Model::TYPE_FORMER
|
||
));
|
||
}
|
||
|
||
/**
|
freenetis/branches/testing/application/controllers/notifications.php | ||
---|---|---|
->set_attr('method', 'post');
|
||
|
||
$this->form->group('')
|
||
->label(__('Notification settings'));
|
||
->label(__('General settings'));
|
||
|
||
$this->form->input('gateway')
|
||
->label(__('Gateway IP address').":")
|
||
->value($this->settings->get('gateway'));
|
||
|
||
$this->form->input('payment_notice_boundary')
|
||
->label(__('Payment notice boundary')." (".
|
||
$this->settings->get('currency')."): ".
|
||
... | ... | |
help::hint('debtor_boundary'))
|
||
->value($this->settings->get('debtor_boundary'));
|
||
|
||
$this->form->input('initial_immunity')
|
||
->label(__('Initial immunity').': '.
|
||
help::hint('initial_immunity'))
|
||
->rules('required|valid_numeric')
|
||
->value($this->settings->get('initial_immunity'));
|
||
|
||
$this->form->input('initial_debtor_immunity')
|
||
->label(__('Initial debtor immunity').': '.
|
||
help::hint('initial_debtor_immunity'))
|
||
->rules('required|valid_numeric')
|
||
->value($this->settings->get('initial_debtor_immunity'));
|
||
|
||
$this->form->group('')
|
||
->label(__('Redirection'));
|
||
|
||
$this->form->input('gateway')
|
||
->label(__('Gateway IP address').":")
|
||
->value($this->settings->get('gateway'));
|
||
|
||
$this->form->input('redirection_logo_url')
|
||
->label(__('Redirection logo URL').":")
|
||
->value($this->settings->get('redirection_logo_url'));
|
||
... | ... | |
help::hint('self_cancel_text'))
|
||
->value($this->settings->get('self_cancel_text'));
|
||
|
||
$this->form->group('')
|
||
->label(__('E-mail'));
|
||
|
||
$this->form->input('email_subject_prefix')
|
||
->label(__('E-mail subject prefix').':')
|
||
->value($this->settings->get('email_subject_prefix'));
|
freenetis/branches/testing/application/libraries/Settings.php | ||
---|---|---|
// default value for prefix of subject of notification e-mails to members
|
||
private static $email_subject_prefix = 'FreeNetIS';
|
||
private static $ip_addresses_states_interval = 60;
|
||
// count of days in which new members will not be notificated to pay, default 14
|
||
private static $initial_immunity = 14;
|
||
// count of days in which new members will not be blocked and notificated as debtor, default 35
|
||
private static $initial_debtor_immunity = 35;
|
||
|
||
/**
|
||
* Function to get value from settings by given key
|
Také k dispozici: Unified diff
Dopsana podpora iumnity novych clenu u upozornovani na placeni a blokovani pro dluh.