Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 573

Přidáno uživatelem Roman Ševčík před téměř 15 roky(ů)

Plřidán defaultní e-mail pro kontroler email. Přidána úprava defaultního e-mailu v nastavení.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'deduction of member fee' => 'Stržení členského příspěvku',
'deduction of member fees' => 'Stržení členských příspěvků',
'deduction of entrance fees' => 'Stržení vstupních příspěvků',
'default e-mail' => 'Výchozí e-mail',
'delete this contact' => 'Smazat tento kontakt',
'delete_member' => 'Smazat tohoto člena',
'delete_work' => 'Smazat tuto práci',
......
'editing of transfer' => 'Úprava převodu',
'editing of user' => 'Úprava uživatele',
'email' => 'E-mail',
'e-mail settings' => 'Nastavení e-mailu',
'enabled' => 'Zapnuto',
'end membership' => 'Ukončit členství',
'end of month' => 'Konec měsíce',
freenetis/trunk/kohana/application/controllers/registration.php.old
<?php
class Registration_Controller extends Controller {
function index()
{
$form = new Forge(url_lang::base()."registration", '', 'POST', array('id' => 'article_form'));
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
$form->group('')->label(url_lang::lang('texts.login data'));
$form->input('username')->label(url_lang::lang('texts.username').':')->rules('required|length[3,50]')->callback(array($this, 'valid_username'));
$form->password('password')->label(url_lang::lang('texts.password').':')->rules('required|length[3,50]')->class('required');
$form->password('confirm_password')->label(url_lang::lang('texts.confirm password').':')->rules('required|length[3,50]')->matches($form->password);
$form->group('')->label(url_lang::lang('texts.contact data'));
$form->input('pre_title')->label(url_lang::lang('texts.pre title').':')->rules('length[3,40]');
$form->input('name')->label(url_lang::lang('texts.name').':')->rules('required|length[3,30]');
$form->input('middle_name')->label(url_lang::lang('texts.middle name').':')->rules('length[3,30]');
$form->input('surname')->label(url_lang::lang('texts.surname').':')->rules('required|length[3,60]');
$form->input('post_title')->label(url_lang::lang('texts.post title').':')->rules('length[3,30]');
$form->date('birthday')->label(url_lang::lang('texts.birthday').':')->years(date('Y')-100, date('Y'))->rules('required');
$form->input('street')->label(url_lang::lang('texts.street').':')->rules('required|length[1,200]');
$form->input('street_number')->label(url_lang::lang('texts.street number').':')->rules('required|length[1,50]');
$form->input('town')->label(url_lang::lang('texts.town').':')->rules('required|length[3,200]');
$form->input('zip_code')->label(url_lang::lang('texts.zip code').':')->rules('required|length[5,10]');
$form->input('phone')->label(url_lang::lang('texts.phone').':')->rules('required|length[3,40]');
$form->input('email')->label(url_lang::lang('texts.email').':')->rules('required|length[3,50]|valid_email');
$form->submit('submit')->value(url_lang::lang('texts.register'));
special::required_forge_style($form, ' *', 'required');
if($form->validate())
{
if (!$this->model_users->Edit((int)$id, $form->as_array()))
{
// uspesna uprava
$this->load->library('session');
$this->session->set_flash('vypis', 'Uživatel úspěšně upraven.');
}
else
{
$this->load->library('session');
$this->session->set('vypis', 'Uživatele se nepodařilo upravit.');
}
url::redirect(url_lang::base().'users/index/'.(int)$m_id, 'redirect');
}
else
{
//echo $form->html();
}
$view = new View('registration');
$view->title = url_lang::lang('texts.registration form');
$view->form = $form->html();
$view->render(TRUE);
}
function valid_username($input)
{
$user_model=new User_Model();
if ($user_model->username_exist($input->value) || trim($input->value)=='')
{
$input->add_error('required', url_lang::lang('texts.Username already exists in database.'));
}
}
}
?>
freenetis/trunk/kohana/application/controllers/settings.php
// page title
$this->form->input('title')->label(url_lang::lang('texts.Page title').':')->rules('length[3,40]|required')->value($this->setting->title);
// currency
$this->form->input('currency')->label(url_lang::lang('texts.Currency').':')->rules('length[3,40]|required')->value($this->setting->currency);
// currency
$this->form->input('currency')->label(url_lang::lang('texts.Currency').':')->rules('length[3,40]|required')->value($this->setting->currency);
// self-registration
$this->form->radio('self_registration')->label(url_lang::lang('texts.Self-registration').':')->options(array('1'=>url_lang::lang('texts.Yes'),'0'=>url_lang::lang('texts.No')))->default($this->setting->self_registration);
// self-registration
$this->form->radio('self_registration')->label(url_lang::lang('texts.Self-registration').':')->options(array('1'=>url_lang::lang('texts.Yes'),'0'=>url_lang::lang('texts.No')))->default($this->setting->self_registration);
$this->form->group('')->label(url_lang::lang('texts.E-mail settings'));
$this->form->input('email_default_email')->label(url_lang::lang('texts.Default e-mail').':')->rules('length[3,100]|valid_email')->value($this->setting->email_default_email);
$this->form->submit('submit')->value(url_lang::lang('texts.Save'));
special::required_forge_style($this->form, ' *', 'required');
......
// create view for this template
$view = new View('main');
$view->title = url_lang::lang('texts.Settings').' - '.url_lang::lang('texts.VoIP');
$view->title = url_lang::lang('texts.Settings').' - '.url_lang::lang('texts.Map');
$view->content = new View('form');
$view->content->form = $this->form->html();
$view->content->headline = url_lang::lang('texts.Settings').' - '.url_lang::lang('texts.VoIP');
$view->content->headline = url_lang::lang('texts.Settings').' - '.url_lang::lang('texts.Map');
$view->content->link_back = $this->links;
$message = $this->session->get_once('message');
if (!empty($message))
freenetis/trunk/kohana/application/controllers/email.php
$view->content = new View('email/email_write');
$view->content->editorHead = $te->getHeadHtml();
$view->content->editorFieldName = $te->getFieldName();
$view->content->email_from = ($this->input->post('email_from') == NULL) ? 'no-reply@freenetis.slfree.net' : $this->input->post('email_from');
$view->content->email_from = ($this->setting->email_default_email == '') ? 'no-reply@freenetis.org' : $this->setting->email_default_email;
$view->content->email_to = $this->input->post('address');
$view->content->subject = ($this->input->post('subject') == NULL) ? '' : $this->input->post('subject');
$view->content->editor = $te->getHtml();
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql.php
// array of sql queries that upgrade database
$upgrade_sql[get_SVN_rev()] = array(
"CREATE TABLE IF NOT EXISTS `area_prefix` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`area_id` INTEGER UNSIGNED NOT NULL,
`prefix` INTEGER UNSIGNED NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"CREATE TABLE IF NOT EXISTS `areas` (
`id` INTEGER UNSIGNED NOT NULL,
`area_name` VARCHAR(60) NOT NULL,
`admin_id` INTEGER UNSIGNED NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"CREATE TABLE IF NOT EXISTS `config_files` (
`id` INTEGER NOT NULL,
`primary_dns` VARCHAR(45) NOT NULL,
`secondary_dns` VARCHAR(45) NOT NULL,
`tertiary_dns` VARCHAR(45) NOT NULL,
`domain_name` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"ALTER TABLE `config_files` ADD COLUMN `default_lease_time` INTEGER UNSIGNED NOT NULL AFTER `domain_name`,
ADD COLUMN `max_lease_time` INTEGER UNSIGNED NOT NULL AFTER `default_lease_time`;",
"ALTER TABLE `config_files` ADD COLUMN `name_server` VARCHAR(45) NOT NULL AFTER `max_lease_time`,
ADD COLUMN `name_server2` VARCHAR(45) NOT NULL AFTER `name_server`,
ADD COLUMN `mail_exchange` VARCHAR(45) NOT NULL AFTER `name_server2`,
ADD COLUMN `soa_record` VARCHAR(45) NOT NULL AFTER `mail_exchange`,
ADD COLUMN `refresh` INTEGER UNSIGNED NOT NULL AFTER `soa_record`,
ADD COLUMN `retry` INTEGER UNSIGNED NOT NULL AFTER `refresh`,
ADD COLUMN `expire` INTEGER UNSIGNED NOT NULL AFTER `retry`,
ADD COLUMN `minimum` INTEGER UNSIGNED NOT NULL AFTER `expire`,
ADD COLUMN `ttl` INTEGER UNSIGNED NOT NULL AFTER `minimum`;",
"ALTER TABLE `config_files` ADD COLUMN `freenet_ip` VARCHAR(15) NOT NULL AFTER `ttl`,
ADD COLUMN `dns_admin` VARCHAR(45) NOT NULL AFTER `freenet_ip`;",
"INSERT INTO `config_files` (id,primary_dns,secondary_dns,tertiary_dns,domain_name) VALUES (1,'10.107.4.100','10.107.4.129','10.107.3.1','hkfree.org');",
"UPDATE `config_files` SET name_server='ns.hkfree.org', name_server2='ns2.hkfree.org', mail_exchange='relay.hkfree.org', soa_record='charon.hkfree.org', refresh=604800, retry=86400, expire=2419200, minimum=604800, ttl=604800",
"UPDATE `config_files` SET freenet_ip='10.107', dns_admin='pmv.root.hkfree.org'",
"CREATE TABLE IF NOT EXISTS `redirection_logs` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`admin` VARCHAR(20) NOT NULL,
`action` INTEGER UNSIGNED NOT NULL,
`ip_address` VARCHAR(15) NOT NULL,
`time` DATETIME NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"CREATE TABLE IF NOT EXISTS `redirections` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`ip_address` VARCHAR(15) NOT NULL,
`destination` INT(1) UNSIGNED NOT NULL,
`duration` INT(4) UNSIGNED NOT NULL,
`message` VARCHAR(1000),
`note` VARCHAR(1000),
`locksign` INT(1) UNSIGNED NOT NULL,
`admin` VARCHAR(20) NOT NULL,
`email` VARCHAR(45) NOT NULL,
`selfaccess` INT(1) UNSIGNED NOT NULL,
`sendmail` INT(1) UNSIGNED NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"CREATE TABLE IF NOT EXISTS `redirection_settings` (
`admin_id` INTEGER UNSIGNED NOT NULL,
`subnet_id` INTEGER UNSIGNED NOT NULL,
PRIMARY KEY (`admin_id`)
)
ENGINE = InnoDB;",
"INSERT INTO `enum_type_names` (type_name) VALUES ('Redirect duration'), ('Redirect destination')",
"INSERT INTO `enum_type_names` (type_name) VALUES ('Redirect action')",
"INSERT INTO `enum_types` (type_id, value, read_only) VALUES ('14', 'Virus', '1'),('14', 'Spam', '1'),('14', 'Message', '1'),('14', 'Admin contacting', '1'),('14', 'Rules breaking', '1')",
"INSERT INTO `enum_types` (type_id, value, read_only) VALUES ('13', '4 hours', '1'),('13', 'End of day', '1'),('13', 'End of month', '1'),('13', 'Indefinitely', '1')",
"INSERT INTO `enum_types` (type_id, value, read_only) VALUES ('15', 'redirected', '1'),('15', 'edited', '1'),('15', 'deleted', '1')",
"INSERT INTO `translations` (original_term, translated_term, lang) values ('4 hours','4 hodiny','cs'),('End of day','Do konce dne','cs'),('End of month','Do konce m?s?ce','cs'), ('Indefinitely','Na neur?ito','cs'),('Admin contacting','Kontaktov?n? spr?vce','cs'),('Message','Zpr?va','cs'),('Rules breaking','Poru?en? pravidel','cs'),('Spam','Rozes?l?n? spamu','cs'),('Virus','Zavirovan? po??ta?','cs')",
"INSERT INTO `translations` (original_term, translated_term, lang) values ('Redirected','P?esm?roval','cs'),('Edited','Upravil','cs'),('Deleted','Smazal','cs')",
"CREATE TABLE IF NOT EXISTS `backup` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` INTEGER UNSIGNED NOT NULL,
`name` VARCHAR(45) NOT NULL,
`platform` INTEGER UNSIGNED NOT NULL,
`locksign` BOOLEAN NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"INSERT INTO `enum_types` (type_id,value,read_only) values (16,'RB mikrotik',1),(16,'PC router',1)",
"INSERT INTO `enum_type_names` (type_name) values ('backup platform')"
"INSERT INTO `config` (`name`, `value`) VALUES
('email_default_email', '');
"
);
?>
freenetis/trunk/kohana/application/upgrade_sql/upgrade_sql_569.php
<?php
$upgrade_sql[569] = array(
"CREATE TABLE IF NOT EXISTS `area_prefix` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`area_id` INTEGER UNSIGNED NOT NULL,
`prefix` INTEGER UNSIGNED NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"CREATE TABLE IF NOT EXISTS `areas` (
`id` INTEGER UNSIGNED NOT NULL,
`area_name` VARCHAR(60) NOT NULL,
`admin_id` INTEGER UNSIGNED NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"CREATE TABLE IF NOT EXISTS `config_files` (
`id` INTEGER NOT NULL,
`primary_dns` VARCHAR(45) NOT NULL,
`secondary_dns` VARCHAR(45) NOT NULL,
`tertiary_dns` VARCHAR(45) NOT NULL,
`domain_name` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"ALTER TABLE `config_files` ADD COLUMN `default_lease_time` INTEGER UNSIGNED NOT NULL AFTER `domain_name`,
ADD COLUMN `max_lease_time` INTEGER UNSIGNED NOT NULL AFTER `default_lease_time`;",
"ALTER TABLE `config_files` ADD COLUMN `name_server` VARCHAR(45) NOT NULL AFTER `max_lease_time`,
ADD COLUMN `name_server2` VARCHAR(45) NOT NULL AFTER `name_server`,
ADD COLUMN `mail_exchange` VARCHAR(45) NOT NULL AFTER `name_server2`,
ADD COLUMN `soa_record` VARCHAR(45) NOT NULL AFTER `mail_exchange`,
ADD COLUMN `refresh` INTEGER UNSIGNED NOT NULL AFTER `soa_record`,
ADD COLUMN `retry` INTEGER UNSIGNED NOT NULL AFTER `refresh`,
ADD COLUMN `expire` INTEGER UNSIGNED NOT NULL AFTER `retry`,
ADD COLUMN `minimum` INTEGER UNSIGNED NOT NULL AFTER `expire`,
ADD COLUMN `ttl` INTEGER UNSIGNED NOT NULL AFTER `minimum`;",
"ALTER TABLE `config_files` ADD COLUMN `freenet_ip` VARCHAR(15) NOT NULL AFTER `ttl`,
ADD COLUMN `dns_admin` VARCHAR(45) NOT NULL AFTER `freenet_ip`;",
"INSERT INTO `config_files` (id,primary_dns,secondary_dns,tertiary_dns,domain_name) VALUES (1,'10.107.4.100','10.107.4.129','10.107.3.1','hkfree.org');",
"UPDATE `config_files` SET name_server='ns.hkfree.org', name_server2='ns2.hkfree.org', mail_exchange='relay.hkfree.org', soa_record='charon.hkfree.org', refresh=604800, retry=86400, expire=2419200, minimum=604800, ttl=604800",
"UPDATE `config_files` SET freenet_ip='10.107', dns_admin='pmv.root.hkfree.org'",
"CREATE TABLE IF NOT EXISTS `redirection_logs` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`admin` VARCHAR(20) NOT NULL,
`action` INTEGER UNSIGNED NOT NULL,
`ip_address` VARCHAR(15) NOT NULL,
`time` DATETIME NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"CREATE TABLE IF NOT EXISTS `redirections` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`ip_address` VARCHAR(15) NOT NULL,
`destination` INT(1) UNSIGNED NOT NULL,
`duration` INT(4) UNSIGNED NOT NULL,
`message` VARCHAR(1000),
`note` VARCHAR(1000),
`locksign` INT(1) UNSIGNED NOT NULL,
`admin` VARCHAR(20) NOT NULL,
`email` VARCHAR(45) NOT NULL,
`selfaccess` INT(1) UNSIGNED NOT NULL,
`sendmail` INT(1) UNSIGNED NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"CREATE TABLE IF NOT EXISTS `redirection_settings` (
`admin_id` INTEGER UNSIGNED NOT NULL,
`subnet_id` INTEGER UNSIGNED NOT NULL,
PRIMARY KEY (`admin_id`)
)
ENGINE = InnoDB;",
"INSERT INTO `enum_type_names` (type_name) VALUES ('Redirect duration'), ('Redirect destination')",
"INSERT INTO `enum_type_names` (type_name) VALUES ('Redirect action')",
"INSERT INTO `enum_types` (type_id, value, read_only) VALUES ('14', 'Virus', '1'),('14', 'Spam', '1'),('14', 'Message', '1'),('14', 'Admin contacting', '1'),('14', 'Rules breaking', '1')",
"INSERT INTO `enum_types` (type_id, value, read_only) VALUES ('13', '4 hours', '1'),('13', 'End of day', '1'),('13', 'End of month', '1'),('13', 'Indefinitely', '1')",
"INSERT INTO `enum_types` (type_id, value, read_only) VALUES ('15', 'redirected', '1'),('15', 'edited', '1'),('15', 'deleted', '1')",
"INSERT INTO `translations` (original_term, translated_term, lang) values ('4 hours','4 hodiny','cs'),('End of day','Do konce dne','cs'),('End of month','Do konce m�s�ce','cs'), ('Indefinitely','Na neur�ito','cs'),('Admin contacting','Kontaktov�n� spr�vce','cs'),('Message','Zpr�va','cs'),('Rules breaking','Poru�en� pravidel','cs'),('Spam','Rozes�l�n� spamu','cs'),('Virus','Zavirovan� po��ta�','cs')",
"INSERT INTO `translations` (original_term, translated_term, lang) values ('Redirected','P�esm�roval','cs'),('Edited','Upravil','cs'),('Deleted','Smazal','cs')",
"CREATE TABLE IF NOT EXISTS `backup` (
`id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` INTEGER UNSIGNED NOT NULL,
`name` VARCHAR(45) NOT NULL,
`platform` INTEGER UNSIGNED NOT NULL,
`locksign` BOOLEAN NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
CHARACTER SET utf8 COLLATE utf8_general_ci;",
"INSERT INTO `enum_types` (type_id,value,read_only) values (16,'RB mikrotik',1),(16,'PC router',1)",
"INSERT INTO `enum_type_names` (type_name) values ('backup platform')"
);
?>

Také k dispozici: Unified diff