if($checkEmail == true && $checkLogin == true && $checkPassword == true && $checkName == true && $roleWeb != 'default') {
$result::connectTables("INSERT INTO "._TABLE_STAFF_."(email, name, login, pass, roleweb, name_role, date_regist)
VALUES (
'".$email."',
'".$name."',
'".$login."',
MD5('".$password._GARBAGEKEY_."'),
'".$roleWeb."',
'".$nameRole."',
'".$datelocal."'
)");
echo "<h6>Сотрудник добавлен!</h6>";
$result::MySQLClose();
}
<?
if($outAccount != 1){
require_once'_mysql.php';
$result = new baseConnect();
$email = $_POST['email'];
$pass = $_POST['pass'];
$datelocal = date('Y-m-d h:i:s');
$checkPassword = false;
if(strlen($pass) != 0){
// Проверка пароля
if(preg_match( '/^\S*(?=\S{12,25})(?=\S*[a-z])(?=\S*[A-Z])(?=\S*[\d])\S*$/i',$pass)){
$checkPassword = true;
$password = MD5($pass._GARBAGEKEY_);
}else{
$error2 = "<p>Пароль не соответствует требованиям. Пожалуйста исправьте!</p>";
}
}else{$error1 = "<p>Поле с Паролем пустое.</p>";}
echo $email." ".$password;
if($checkPassword == true){
$res = $result::connectTables("SELECT email, pass FROM "._TABLE_STAFF_);
while( $e = mysqli_fetch_assoc($res) ) {
if($e['email'] == $email && $e['pass'] == $password){
$result::connectTables("INSERT INTO "._TABLE_STAFF_."(date_input) VALUES ('".$datelocal."')");
$result::MySQLClose();
$_SESSION['email'] = $email;
$_SESSION['pass'] = $password;
}
}
}
}else{
session_start();
session_unset();
session_destroy();
$outAccount = 0;
}
?>