Revize 1790
Přidáno uživatelem Ondřej Fibich před téměř 12 roky(ů)
freenetis/branches/1.1/application/i18n/cs_CZ/validation.php | ||
---|---|---|
'digit' => 'číslice',
|
||
'numeric' => 'číslo',
|
||
'gps' => 'Chybný formát GPS souřadnice',
|
||
'preg_regex' => 'Chybný formát regulárního výrazu',
|
||
|
||
'phone' => 'číslo ve středoevropském tvaru',
|
||
'suffix' => 'příponu',
|
freenetis/branches/1.1/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'login data' => 'Přihlašovací údaje',
|
||
'login logs' => 'Logy přihlášení',
|
||
'login logs of user' => 'Logy přihlášení uživatele',
|
||
'login must contains only a-z and 0-9 and starts with literal' => 'Pole login musí obsahovat pouze znaky a-z a 0-9 a začínat písmenem.',
|
||
'login must contains only a-z and 0-9 and starts with literal' => 'Pole přihl. jméno musí obsahovat pouze znaky a-z a 0-9 a začínat písmenem.',
|
||
'login name' => 'Přihl. jméno',
|
||
'login_name' => 'Přihl. jméno',
|
||
'login do not match with data in information system' => 'Přihlašovací jméno nesouhlasí s údaji v informačním systému',
|
freenetis/branches/1.1/application/controllers/users.php | ||
---|---|---|
|
||
$user_model = new User_Model();
|
||
|
||
if ($user_model->username_exist($input->value, $this->_user_id) ||
|
||
trim($input->value) == '')
|
||
$username_regex = Settings::get('username_regex');
|
||
|
||
if (preg_match($username_regex, $input->value) == 0)
|
||
{
|
||
$input->add_error('required', __(
|
||
'Login must contains only a-z and 0-9 and starts with literal.'
|
||
));
|
||
}
|
||
else if ($user_model->username_exist($input->value, $this->_user_id) ||
|
||
trim($input->value) == '')
|
||
{
|
||
$input->add_error('required', __(
|
||
'Username already exists in database.'
|
||
));
|
||
}
|
freenetis/branches/1.1/application/controllers/installation.php | ||
---|---|---|
self::error(PAGE);
|
||
}
|
||
|
||
if (preg_match('/^[a-z]{1}[a-z0-9]+$/', $input->value) == 0)
|
||
$username_regex = Settings::get('username_regex');
|
||
|
||
if (preg_match($username_regex, $input->value) == 0)
|
||
{
|
||
$input->add_error(
|
||
'required', __(
|
freenetis/branches/1.1/application/controllers/registration.php | ||
---|---|---|
}
|
||
|
||
$user_model = new User_Model();
|
||
$username_regex = Settings::get('username_regex');
|
||
|
||
if ($user_model->username_exist($input->value) && !trim($input->value) == '')
|
||
{
|
||
$input->add_error('required', __('Username already exists in database'));
|
||
}
|
||
else if (preg_match('/^[a-z]{1}[a-z0-9]+$/', $input->value) == 0)
|
||
else if (preg_match($username_regex, $input->value) == 0)
|
||
{
|
||
$input->add_error(
|
||
'required', __('Login must contains only a-z and 0-9 and starts with literal.')
|
freenetis/branches/1.1/application/controllers/forgotten_password.php | ||
---|---|---|
self::error(PAGE);
|
||
}
|
||
|
||
if (preg_match('/^[a-zA-Z0-9]+$/', $input->value) == 0)
|
||
$username_regex = Settings::get('username_regex');
|
||
|
||
if (preg_match($username_regex, $input->value) == 0)
|
||
{
|
||
$input->add_error('required', __(
|
||
'Login must contains only a-z and 0-9 and starts with literal.'
|
freenetis/branches/1.1/application/controllers/members.php | ||
---|---|---|
}
|
||
|
||
$user_model = new User_Model();
|
||
$username_regex = Settings::get('username_regex');
|
||
|
||
if ($user_model->username_exist($input->value) && !trim($input->value)=='')
|
||
{
|
||
$input->add_error('required', __('Username already exists in database'));
|
||
}
|
||
else if (!preg_match("/^[a-z][a-z0-9]*[_]{0,1}[a-z0-9]+$/", $input->value))
|
||
else if (!preg_match($username_regex, $input->value))
|
||
{
|
||
$input->add_error('required', __(
|
||
'Login must contains only a-z and 0-9 and starts with literal.'
|
freenetis/branches/1.1/application/libraries/Settings.php | ||
---|---|---|
'module_status_timeout' => 2,
|
||
// are connection requests enabled?
|
||
'connection_request_enable' => 0,
|
||
// username regex #360
|
||
'username_regex' => '/^[a-z][a-z0-9_]{4,}$/',
|
||
);
|
||
|
||
/**
|
freenetis/branches/1.1/application/libraries/forge/Form_Input.php | ||
---|---|---|
}
|
||
|
||
/**
|
||
* Chceck if value is GPS coordinate if it is not empty
|
||
* Check if value is GPS coordinate if it is not empty
|
||
*
|
||
* @author Ondřej Fibich
|
||
*/
|
||
... | ... | |
}
|
||
|
||
/**
|
||
* Check if value is pregex if it is not empty
|
||
*
|
||
* @author Ondřej Fibich
|
||
*/
|
||
protected function rule_preg_regex()
|
||
{
|
||
if ($this->value)
|
||
{
|
||
if (@preg_match($this->value, '') === FALSE)
|
||
{
|
||
$this->errors['preg_regex'] = TRUE;
|
||
}
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Validate required.
|
||
*/
|
||
protected function rule_required()
|
freenetis/branches/1.1/system/i18n/en_US/validation.php | ||
---|---|---|
'alpha_dash' => 'alphabetical, dash, and underscore',
|
||
'digit' => 'digit',
|
||
'numeric' => 'numeric',
|
||
'gps' => 'Wrong formar of GPS coordinate',
|
||
'gps' => 'Wrong format of GPS coordinate',
|
||
'preg_regex' => 'Wrong regular expresion format',
|
||
);
|
freenetis/branches/1.1/2013-01-04.log.php | ||
---|---|---|
<?php defined('SYSPATH') or die('No direct script access.'); ?>
|
||
|
||
2013-01-04 21:44:38 -- error: Nezachycená PHP Error: Undefined offset: 0 v souboru application/vendors/tcpdf/tcpdf.php na řádce 13167 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 21:49:53 -- error: Nezachycená PHP Error: Undefined index: cols v souboru application/vendors/tcpdf/tcpdf.php na řádce 13090 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 21:50:39 -- error: Nezachycená PHP Error: Undefined index: cols v souboru application/vendors/tcpdf/tcpdf.php na řádce 13090 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 21:50:42 -- error: Nezachycená PHP Error: Undefined index: cols v souboru application/vendors/tcpdf/tcpdf.php na řádce 13090 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 21:51:38 -- error: Nezachycená PHP Error: Undefined index: cols v souboru application/vendors/tcpdf/tcpdf.php na řádce 13090 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 21:51:40 -- error: Nezachycená PHP Error: Undefined index: cols v souboru application/vendors/tcpdf/tcpdf.php na řádce 13090 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 21:56:03 -- error: Nezachycená PHP Error: Undefined index: cols v souboru application/vendors/tcpdf/tcpdf.php na řádce 13090 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 21:56:29 -- error: Nezachycená PHP Error: Undefined index: cols v souboru application/vendors/tcpdf/tcpdf.php na řádce 13090 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 21:57:57 -- error: Nezachycená PHP Error: Undefined index: cols v souboru application/vendors/tcpdf/tcpdf.php na řádce 13090 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 21:58:02 -- error: Nezachycená PHP Error: Undefined index: cols v souboru application/vendors/tcpdf/tcpdf.php na řádce 13090 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 21:58:12 -- error: Nezachycená PHP Error: Undefined index: cols v souboru application/vendors/tcpdf/tcpdf.php na řádce 13090 URL: cs/members/registration_export/4?noredirect=0&path_qsurl=members%2Fshow%2F4
|
||
|
||
2013-01-04 22:29:50 -- error: Nezachycená PHP Error: preg_match(): No ending delimiter '/' found v souboru application/libraries/forge/Form_Input.php na řádce 710 URL: cs/settings/system
|
||
|
Také k dispozici: Unified diff
Implementace nastavitelneho validatoru prihlasovaciho jmena.
Rozhodl jsem se jej neumistnit do nastaveni, je mozne jej nastavovat jen v DB polem config.username_regex.
Bojim se co by se mohlo stat, kdyby to editoval nekdo kdo se nevyzna v regexech,
Issue #360 - Nastavitelný validátor pro přihlašovací jméno