Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1883

Přidáno uživatelem Ondřej Fibich před více než 11 roky(ů)

freenetis_1.1.0~alpha15

Novinky:
- closes #515: Moznost povoleni/zakazani upozornovani

Upravy:
- informace o pripojeni cekatele pri pridani zarizeni i bez requestu

Opravy:
- fixes #520: Pristupova prava pro tridy rychlosti
- oprava zobrazovani informace o moznosti presmerovani vnitrni posty v pripade ze uzivatel nema takova prava (cekatel)

Zobrazit rozdíly:

freenetis/branches/1.1/db_upgrades/upgrade_1.1.0~alpha15.php
<?php defined('SYSPATH') or die('No direct script access.');
/*
* This file is part of open source system FreenetIS
* and it is released under GPLv3 licence.
*
* More info about licence can be found:
* http://www.gnu.org/licenses/gpl-3.0.html
*
* More info about project can be found:
* http://www.freenetis.org/
*
*/
/**
* This upgrade is not equal to any of previos upgrades
*
* @author Ondřej Fibich <ondrej.fibich@gmail.com>
*/
$upgrade_equal_to['1.1.0~alpha15'] = array();
/**
* Expiring of testing connection (#527).
* Access rights for regular member to view his QoS info (#520).
*
* @author Ondřej Fibich <ondrej.fibich@gmail.com>
*/
$upgrade_sql['1.1.0~alpha15'] = array
(
// messages for denying of expired test connection
"INSERT INTO `messages` (`id`,`name`, `text`, `email_text`, `sms_text`, `type`, `self_cancel`, `ignore_whitelist`) VALUES
(NULL, 'Test connection has expired', 'Test connection has expired. You must submit your membership registration!', NULL, NULL, 16, NULL, 0);",
// qos info access rights
"REPLACE INTO `axo_map` (`acl_id`, `section_value`, `value`) VALUES
(43, 'Members_Controller', 'qos_ceil'),
(43, 'Members_Controller', 'qos_rate');",
);
freenetis/branches/1.1/application/i18n/cs_CZ/texts.php
'tenth-degree certified engineers' => 'Certifikování technici desátého stupně',
'terminating call' => 'Příchozí volání',
'tertiary dns' => 'Terciární DNS.',
'test connection duration' => 'Délka testovacího připojení',
'test connection has expired' => 'Testovací připojení vypršelo',
'test mode' => 'Testovací mód',
'testing driver' => 'Test ovladače',
'text of message is too long' => 'Text zprávy je příliš dlouhý',
......
'your email' => 'Váš email',
'your request for membership has not been approved yet' => 'Vaše žádost o členství zatím nebyla schválena',
'your name' => 'Vaše jméno',
'your registration has been sended and waiting for admin approval' => 'Vaše registrace byla odeslána a čeká na schválení adminem',
'your registration has been sended and waiting for admin approval' => 'Vaše registrace byla odeslána a čeká na schválení správcem',
'your request has been succesfully stored' => 'Váš požadavek byl úspěšně uložen.',
'your work has been added' => 'Vaše práce byla přidána',
'your work has been approved' => 'Vaše práce byla schválena',
freenetis/branches/1.1/application/i18n/cs_CZ/help.php
'allowed_subnets_update_interval' => 'Interval aktualizace povolených podsítí v sekundách. Po uplynutí této doby se IP adresám z nepovolených podsítí nastaví přesměrování typu Přerušené členství. Výchozí hodnota je 60 sekund (1 minuta).',
'amount_including_transfer_fee' => 'Částka včetně transakčního poplatku',
'applicant_additional_payment' => 'Dodatečné stržení částky za členstké přizpěvky za dobu před vstupem.',
'applicant_connection_test_duration' => 'Testovací připojení je umožněno zájemcům o členství a je limitované délkou udanou v počtech dní, po jejímž uběhnutí je připojení zakázáno, pokud zájemce do té doby neodevzdá přihlášku.',
'application_password' => 'Aplikační heslo slouží uživateli pro přihlášení ke službám, které jsou závislé na Radius serveru, jako například VPN, aktivní prvky sítě atd. Toto heslo je v databázi uloženo v otevřené podobě.',
'approval_priority' => 'Priorita umožňuje vícekolové hlasování o práci/pracovním výkazu. Pokud nechcete šablonu s vícekolovým hlasováním, nastavte u všech položek šablony prioritu na hodnotu \'0\'. Vícekolové hlasování začíná u prvku s nejvyšší prioritou a sestupuje k dalším kolům hlasováním, dokud není buďto schváleno ve všech kolech, nebo v jednom z kol zamítnuto. Pokud v některém z kol hlasování chcete schvalovat více prvků zadejte jim stejnou prioritu.',
'approval_state' => 'Stav je ve formátu Pro / Proti / Zdrželi se.',
freenetis/branches/1.1/application/i18n/en_US/help.php
'allowed_subnets_update_interval' => 'Update interval of allowed subnets in seconds. After this time, the IP addresses from unauthorized subnets set up redirects Broken type of membership. The default is 60 seconds (1 minute).',
'amount_including_transfer_fee' => 'Amount including transfer fee',
'applicant_additional_payment' => 'Additional charges for member fees for the period before entry.',
'applicant_connection_test_duration' => 'The test connection is enabled for membership applicants and it is limited by the length given in number of days after which the connection is denied. The connection may continue if applicant subnmits a membership registration.',
'application_password' => 'Application user password used to login to services that are dependent on the Radius server, such as VPN, active network elements, etc. This password is stored in the database in an open form.',
'approval_priority' => 'Priority allows multi-round voting for works / work reports. If you do not vote multi-round template, set the template for all items priority to \'0 \'. Multi-round voting begins at the element with the highest priority and descends to the next rounds of voting until it is either approved in all rounds, or in one of the rounds rejected. If any of the rounds of votes to approve more elements enter them the same priority.',
'approval_state' => 'State with the format in Agree / Disagree / Abstain.',
freenetis/branches/1.1/application/models/ip_address.php
)
");
}
/**
* Returns all IDs of IP addresses with expired connection test
*
* @author Ondrej Fibich
* @return Mysql_Result
*/
public function get_ip_addresses_with_expired_connection_test()
{
return $this->db->query("
SELECT ip.id, ip.ip_address
FROM ip_addresses ip
LEFT JOIN ifaces i ON ip.iface_id = i.id
LEFT JOIN devices d ON i.device_id = d.id
LEFT JOIN users u ON d.user_id = u.id
JOIN members m ON m.id = ip.member_id OR m.id = u.member_id
WHERE m.type = ? AND m.registration = 0
AND DATEDIFF(NOW(), m.applicant_connected_from) > ?
", array
(
Member_Model::TYPE_APPLICANT,
Settings::get('applicant_connection_test_duration')
));
}
/**
* Returns all ip addresses which can cancel redirect by themselves
freenetis/branches/1.1/application/models/message.php
const CONNECTION_REQUEST_REFUSE = 12;
/**
* content of page for inforrmation about request for connection
* content of page for information about request for connection
*/
const CONNECTION_REQUEST_INFO = 13;
/**
* content of page for information about host down in monitoring
*/
const MONITORING_HOST_DOWN = 14;
const MONITORING_HOST_UP = 15;
/**
* content of page for information about host up in monitoring
*/
const MONITORING_HOST_UP = 15;
/**
* content of page for information about connection test expiration
*/
const CONNECTION_TEST_EXPIRED = 16;
// self-cancel constants
/**
......
$type == self::CONNECTION_REQUEST_REFUSE ||
$type == self::CONNECTION_REQUEST_INFO ||
$type == self::MONITORING_HOST_DOWN ||
$type == self::MONITORING_HOST_UP
$type == self::MONITORING_HOST_UP ||
$type == self::CONNECTION_TEST_EXPIRED
);
}
......
$type != self::CONNECTION_REQUEST_INFO &&
$type != self::UNALLOWED_CONNECTING_PLACE_MESSAGE &&
$type != self::MONITORING_HOST_DOWN &&
$type != self::MONITORING_HOST_UP
$type != self::MONITORING_HOST_UP &&
$type != self::CONNECTION_TEST_EXPIRED
);
}
......
}
/**
* Deny ip addresses with expired test connections
*
* @see Scheduler_Controller#update_applicant_connection_test
* @author Ondrej Fibich
* @param integer $user_id Who redirects
*/
public function activate_test_connection_end_message($user_id)
{
$mm = new Message_Model();
try
{
$mm->transaction_start();
// preparation
$message = ORM::factory('message')->where(array
(
'type' => self::CONNECTION_TEST_EXPIRED
))->find();
// message do not exists
if (!$message || !$message->id)
{
throw new Exception('Connection test expired message not founded');
}
// deletes old redirections
Database::instance()->delete('messages_ip_addresses', array
(
'message_id' => $message->id
));
// find IP addresses with interrupted membership
$ip_model = new Ip_address_Model();
$ips = $ip_model->get_ip_addresses_with_expired_connection_test();
// activate
$result = self::activate_redirection($message, $ips, $user_id);
$mm->transaction_commit();
return $result;
}
catch (Exception $e)
{
$mm->transaction_rollback();
Log::add_exception($e);
return 0;
}
}
/**
* Activates notifications for ip addresses with unallowed connecting place
*
* @author Michal Kliment
freenetis/branches/1.1/application/models/member.php
break;
case Message_Model::DEBTOR_MESSAGE:
$where = "WHERE a.balance < ".intval(Settings::get('debtor_boundary'))
$where = "WHERE m.type <> " . intval(Member_Model::TYPE_APPLICANT)
. " AND a.balance < ".intval(Settings::get('debtor_boundary'))
." AND DATEDIFF(CURDATE(), m.entrance_date) >= ".intval(Settings::get('initial_debtor_immunity'));
$order_by = "whitelisted ASC, balance ASC";
break;
case Message_Model::PAYMENT_NOTICE_MESSAGE:
$where = "WHERE a.balance < ".intval(Settings::get('payment_notice_boundary'))."
$where = "WHERE m.type <> " . intval(Member_Model::TYPE_APPLICANT)
. " AND a.balance < ".intval(Settings::get('payment_notice_boundary'))."
AND
(
DATEDIFF(CURDATE(), m.entrance_date) >= ".intval(Settings::get('initial_debtor_immunity'))."
freenetis/branches/1.1/application/controllers/mail.php
}
// mail redirection
$uc_model = new Users_contacts_Model();
$email_redirections = $uc_model->get_redirected_email_boxes_of($this->user_id);
$contacts_link = html::anchor('/contacts/show_by_user/' . $this->user_id, __('here'));
if (count($email_redirections))
if ($this->acl_check_edit(
'Users_Controller', 'additional_contacts', $this->member_id
))
{
$emails = '';
foreach ($email_redirections as $e)
$uc_model = new Users_contacts_Model();
$email_redirections = $uc_model->get_redirected_email_boxes_of($this->user_id);
$contacts_link = html::anchor('/contacts/show_by_user/' . $this->user_id, __('here'));
if (count($email_redirections))
{
$emails .= $e->value . ', ';
$emails = '';
foreach ($email_redirections as $e)
{
$emails .= $e->value . ', ';
}
status::minfo('Your inner mail is redirected to your following e-mail '
. 'addresses %s you can disable this %s.', TRUE,
array(substr($emails, 0, -2), $contacts_link));
}
status::minfo('Your inner mail is redirected to your following e-mail '
. 'addresses %s you can disable this %s.', TRUE,
array(substr($emails, 0, -2), $contacts_link));
else
{
status::minfo('You can redirect your inner mail to your e-mail box '
. 'by editing your e-mail %s.', TRUE, array($contacts_link));
}
}
else
{
status::minfo('You can redirect your inner mail to your e-mail box '
. 'by editing your e-mail %s.', TRUE, array($contacts_link));
}
// create grid
$grid = new Grid('mail/inbox', '', array
freenetis/branches/1.1/application/controllers/scheduler.php
self::log_error('action_logs_active', $e);
}
}
/* Each day at 5 */
if (date('H:i') == '05:00')
{
try
{
self::update_applicant_connection_test();
}
catch (Exception $e)
{
self::log_error('update_applicant_connection_test', $e);
}
}
/*
if (date('H:i') == "01:00")
......
->activate_unallowed_connecting_place_message(User_Model::ASSOCIATION);
}
}
/**
* If self member registration is enabled then this rutine denies test
* connections of applicants after count of days stored in settings property
* 'applicant_connection_test_duration'. Connections will not be denyed
* if the applicant became member or submit member registration.
*
* @author Ondrej Fibich
*/
private static function update_applicant_connection_test()
{
if (Settings::get('self_registration') &&
(Settings::get('applicant_connection_test_duration') > 0))
{
ORM::factory('message')
->activate_test_connection_end_message(User_Model::ASSOCIATION);
}
}
/**
* Sent e-mails from queue
freenetis/branches/1.1/application/controllers/settings.php
$this->sections = array();
$this->sections['info'] = __('Info');
$this->sections['info'] = __('Info');
$this->sections['system'] = __('System');
$this->sections['approval'] = __('Approval');
$this->sections['approval'] = __('Approval');
$this->sections['email'] = __('Email');
$this->sections['sms'] = __('SMS');
// is voip enabled
if (Settings::get('voip_enabled'))
$this->sections['voip'] = __('VoIP');
if (Settings::get('voip_enabled'))
$this->sections['voip'] = __('VoIP');
$this->sections['notifications'] = __('Notifications');
......
->rules('required|valid_numeric')
->value(Settings::get('initial_debtor_immunity'));
if (Settings::get('self_registration'))
{
$this->form->input('applicant_connection_test_duration')
->label('Test connection duration')
->help(help::hint('applicant_connection_test_duration'))
->rules('valid_numeric')
->value(Settings::get('applicant_connection_test_duration'));
}
$this->form->group('Redirection');
$this->form->input('gateway')
freenetis/branches/1.1/application/controllers/devices.php
$cr_model->device_id = $device->id;
$cr_model->decided_at = date('Y-m-d H:i:s');
$cr_model->save_throwable();
}
// change connected from if member is applicant and if
// he is not connected yet
if ($cr_model->member->type == Member_Model::TYPE_APPLICANT && (
empty($cr_model->member->applicant_connected_from) ||
$cr_model->member->applicant_connected_from == '0000-00-00'
))
{
// connected from now
$cr_model->member->applicant_connected_from = date('Y-m-d');
$cr_model->member->save_throwable();
}
// change connected from if member is applicant and if
// he is not connected yet
if ($cr_model->member->type == Member_Model::TYPE_APPLICANT && (
empty($cr_model->member->applicant_connected_from) ||
$cr_model->member->applicant_connected_from == '0000-00-00'
))
{
// connected from now
$cr_model->member->applicant_connected_from = date('Y-m-d');
$cr_model->member->save_throwable();
}
// expired subnets (#465)
freenetis/branches/1.1/application/libraries/Settings.php
// count of days in which new members will not be notificated
// to pay, default 14
'initial_immunity' => 14,
// if self member registration is enabled then this value gives
// a day count after which the application that is connected and
// he have not submit his member registration
// is bannet from using of this connection (redirected)
'applicant_connection_test_duration' => 14,
// count of days in which new members will not be blocked
// and notificated as debtor, default 35
'initial_debtor_immunity' => 35,
......
// password check also for MD5 algorithm (not only fo SHA1)
// this is here because of posibility of transformation from old data
// structures (another IS). I (Ondrej Fibich) made this due to
// inport of passwords from old IS of PVFREE association (2013-02-15)
// import of passwords from old IS of PVFREE association (2013-02-15)
'pasword_check_for_md5' => FALSE,
);
freenetis/branches/1.1/application/libraries/Menu_builder.php
return $this->render();
}
}
?>
freenetis/branches/1.1/version.php
* The current version of FreenetIS.
* This value must be changed by developers in a new release of FreenetIS.
*/
define('FREENETIS_VERSION', '1.1.0~alpha14');
define('FREENETIS_VERSION', '1.1.0~alpha15');

Také k dispozici: Unified diff