RouterOS API ile kullanıcı kaydı yaptırıyorum, kayıt yaparken aynı TC(email) ile kayıt olmayı nasıl yapabilirim.
kayıt formu
require('../routeros_api.class.php');
$API = new RouterosAPI();
$API->connect('10.10.10.10', 'user', 'pass');
$API->debug = true;
function r_get($name)
{
if($_POST[$name])
{
return htmlspecialchars(strip_tags(mysql_real_escape_string($_POST[$name])));
}
else
{
return false;
}
}
if(isset($_POST['submit']))
{
$ad=$_POST['ad'];
$soyad=$_POST['soyad'];
$tc=$_POST['tc'];
$dogum=$_POST['dogum'];
$kullanici=$_POST['user'];
$password=$_POST['pass'];
function tcno_dogrula($bilgiler){
$gonder = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TCKimlikNoDogrula xmlns="http://tckimlik.nvi.gov.tr/WS">
<TCKimlikNo>'.$bilgiler["tc"].'</TCKimlikNo>
<Ad>'.$bilgiler["ad"].'</Ad>
<Soyad>'.$bilgiler["soyad"].'</Soyad>
<DogumYili>'.$bilgiler["dogum"].'</DogumYili>
</TCKimlikNoDogrula>
</soap:Body>
</soap:Envelope>';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx" );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_POST, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $gonder);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'POST /Service/KPSPublic.asmx HTTP/1.1',
'Host: tckimlik.nvi.gov.tr',
'Content-Type: text/xml; charset=utf-8',
'SOAPAction: "http://tckimlik.nvi.gov.tr/WS/TCKimlikNoDogrula"',
'Content-Length: '.strlen($gonder)
));
$gelen = curl_exec($ch);
curl_close($ch);
return strip_tags($gelen);
}
$bilgiler = array(
"ad" => $ad,
"soyad" => $soyad,
"dogum" => $dogum,
"tc" => $tc
);
$sonuc = tcno_dogrula($bilgiler);
if($sonuc!="true"){
echo "<script>alert('Lütfen Doğru Kimlik Bilgileri Giriniz!');</script></center></h4>";
echo "<script type='text/javascript'> document.location = 'index.php'; </script>";
exit;
}else{
$API->comm("/ip/hotspot/user/add", array(
"server" => "all",
"name" => "$kullanici",
"email" => "$tc",
"password" => "$password",
"profile" => "default",
));
if($API)
{
echo "<script>alert('Kayıt Başarılı');</script>";
//echo "<script type='text/javascript'> document.location = 'index.php'; </script>";
exit;
}
}
}Verileri okuma$API->write('/ip/hotspot/user/print');API : https://github.com/BenMenking/router..._api.class.php