2025-06-16 18:28:08 +05:00

42 lines
1.3 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
$mod = new main($smarty, $settings);
$mod->db=$db;
//print_r($_POST);
//Array ( [email] => 1@yurecnt.ru [act] => auth [pwd] => 123 [remember] => on [ok] => Войти )
if ( $_POST['act'] == 'login' ) $mod -> login ( $_POST );
if ( $_POST['act'] == 'reg' ) $mod -> reg ( $_POST );
/*
if ( isset( $_POST['ok'] ) ){//если есть входящие данные
$email = @$_POST['email'];
$pwd = md5( @$_POST['pwd'] );
unset( $a );
$a['email'] = $email;
$a['pwd'] = $pwd;
$a['act'] = 1;
$id = $db -> get_val( 'users', $a, 'id' );
unset( $a );
$a['user_id'] = $id;
$dostup = $db -> get_val( 'users_groupe', $a, 'dostup' );
if ( $dostup ){
$db->free_sql('UPDATE `cart` SET `id` = "' . $id . '" WHERE `id` = "' . $_COOKIE['user_id'] .'"');
$_SESSION['dostup'] = $dostup;
$_SESSION['user_id'] = $id;
if ($_POST['save_me']=='on'){//пишем в куки
$tri_mes=time()+259200;
setcookie('email', $email, $tri_mes, '/', SITE);
setcookie('pwd', $pwd, $tri_mes, '/', SITE);
}
if($_SESSION['dostup'] == 'a' || $_SESSION['dostup'] == 'e')
header( 'Location: /admin/' );
else
header( 'Location: /' . $settings['default_mod_auth'] . '/' );
}
else
$smarty -> assign( 'error', 'Не верный логин или пароль' );
}
*/
?>