Revize 756
Přidáno uživatelem Roman Ševčík před téměř 14 roky(ů)
freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'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 name' => 'Přihl. jméno',
|
||
'login_name' => 'Přihl. jméno',
|
||
'login or e-mail do not match with data in information system' => 'Login nebo e-mail nesouhlasí s údaji v informačním systému',
|
||
'login to' => 'Přihlášení',
|
||
'login' => 'Přihlásit',
|
||
'logout' => 'Odhlásit',
|
freenetis/trunk/kohana/application/helpers/valid.php | ||
---|---|---|
return preg_match('/^[-\pL\pN\pZ_]++$/uD', (string) $str);
|
||
}
|
||
|
||
public static function date($date = array())
|
||
{
|
||
return (count(date::days($date['month'],$date['year'])) >= $date['day']);
|
||
}
|
||
public static function date($date = array())
|
||
{
|
||
return (count(date::days($date['month'],$date['year'])) >= $date['day']);
|
||
}
|
||
|
||
public static function mac_address($str)
|
||
{
|
||
return preg_match ("/^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$/", $str);
|
||
}
|
||
public static function mac_address($str)
|
||
{
|
||
return preg_match ("/^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$/", $str);
|
||
}
|
||
|
||
public static function ip_address($str)
|
||
{
|
||
return preg_match ("/^((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|[0-9])\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|[0-9])\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|[0-9])\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|[0-9])$/", $str);
|
||
}
|
||
public static function ip_address($str)
|
||
{
|
||
return preg_match ("/^((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|[0-9])\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|[0-9])\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|[0-9])\.((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|[0-9])$/", $str);
|
||
}
|
||
|
||
public static function suffix ($str)
|
||
{
|
||
return preg_match ("/^\/([^\/]+\/)*$/", $str);
|
||
}
|
||
public static function suffix ($str)
|
||
{
|
||
return preg_match ("/^\/([^\/]+\/)*$/", $str);
|
||
}
|
||
|
||
|
||
} // End valid
|
freenetis/trunk/kohana/application/controllers/forgotten_password.php | ||
---|---|---|
$form = new Forge(url_lang::base()."forgotten_password", '', 'POST', array('id' => 'article_form'));
|
||
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
|
||
$form->radio('method')->label(url_lang::lang('texts.Method').':')->options(array(self::$METHOD_EMAIL=>url_lang::lang('texts.E-mail'),self::$METHOD_SMS=>'SMS '.url_lang::lang('texts.Message')))->default(self::$METHOD_EMAIL);
|
||
//Do not work, still...
|
||
//$form->radio('method')->label(url_lang::lang('texts.Method').':')->options(array(self::$METHOD_EMAIL=>url_lang::lang('texts.E-mail'),self::$METHOD_SMS=>'SMS '.url_lang::lang('texts.Message')))->default(self::$METHOD_EMAIL);
|
||
$form->radio('method')->label(url_lang::lang('texts.Method').':')->options(array(self::$METHOD_EMAIL=>url_lang::lang('texts.E-mail')))->default(self::$METHOD_EMAIL);
|
||
|
||
$form->input('login')->label(url_lang::lang('texts.username').':')->rules('required|length[3,50]')->callback(array($this, 'valid_username'));;
|
||
$form->input('email')->label(url_lang::lang('texts.email').':')->rules('length[4,50]|valid_email');
|
||
|
||
$form->input('phone')->label(url_lang::lang('texts.phone').':')->rules('length[9,12]|valid_phone');
|
||
//Do not work, still...
|
||
//$form->input('phone')->label(url_lang::lang('texts.phone').':')->rules('length[9,12]|valid_phone');
|
||
|
||
// submit button
|
||
$form->submit('submit')->value(url_lang::lang('texts.Send'));
|
||
... | ... | |
|
||
$user = ORM::factory('user')->where('login', $form_data['login'])->find();
|
||
|
||
//print'<pre>';
|
||
//print_r($user);
|
||
//print'</pre>';
|
||
|
||
$msg_err_email = '<b>'.url_lang::lang('texts.Login or e-mail do not match with data in information system').'.'.'</b>';
|
||
$msg_err_sms = '<b>'.url_lang::lang('texts.Login or phone do not match with data in information system').'.'.'</b>';
|
||
|
Také k dispozici: Unified diff
Oprava mechanismu zapomenutého hesla. Metoda SMS zakomentována dokud se nevyřeší SMS brány.