virt2/api/php/login.php

26 lines
781 B
PHP
Raw Normal View History

<?php
function replacer_email ($text) { // ФУНКЦИЯ очистки кода
$old1 = array("%40");#Ищем вредное ">",, "<"
$new1 = array("@");#Меняем на полезное"&gt;", , "&lt;"
$text = str_replace($old1, $new1, $text);#Собсно сама замена =)
return $text; }#Возвращение результата наших извращений =)
$email=replacer_email($_COOKIE['email']);
$pwd=$_COOKIE['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 ){
$_SESSION['dostup'] = $dostup;
$_SESSION['user_id'] = $id;
}
?>