Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if(isset($_POST['account']) && isset($_POST['key'])){ $file="../accounts/accounts.xml"; $account='account'; $masacc='accounts'; $nmtg='name'; $kytg='key'; $vrtg='verified'; if(file_exists($file)){ $xml = new DOMDocument(); $xml->load($file); $nodes = $xml->getElementsByTagName($masacc); if ($nodes->length > 0){ $new=$xml->createElement($account); $name=$xml->createElement($nmtg,strtolower($_POST['account'])); $pass=$xml->createElement($kytg,$_POST['key']); $verf=$xml->createElement($vrtg,"false"); $accnodes = $nodes->item(0)->getElementsByTagName($account); if ($accnodes->length > 0){ $add=true; $sucess=false; for ($i = 0; $i <$accnodes->length; $i++) { $nodeval=$accnodes->item($i)->getElementsByTagName($nmtg)->item(0)->nodeValue; if($nodeval==$_POST['account']){ $add=false; break; } } if($add==true){ $new->appendChild($name); $new->appendChild($pass); $new->appendChild($verf); $nodes->item(0)->appendChild($new); $xml->appendChild($nodes->item(0)); $xml->save($file); $success=true; } } } $json->account = $_POST['account']; $json->key = $_POST['key']; $json->success = $succ; $alljson = json_encode($json); echo $alljson; }else{ $xml = new DOMDocument("1.0","UTF-8"); $mass=$xml->createElement($masacc); $new=$xml->createElement($account); $name=$xml->createElement($nmtg,strtolower($_POST['account'])); $pass=$xml->createElement($kytg,$_POST['key']); $verf=$xml->createElement($vrtg,"false"); $new->appendChild($name); $new->appendChild($pass); $new->appendChild($verf); $mass->appendChild($new); $xml->appendChild($mass); $xml->save($file); $json->account = $_POST['account']; $json->key = $_POST['key']; $json->success = true; $alljson = json_encode($json); echo $alljson; } }else{ echo "err"; } ?>
- <?php if(isset($_POST['account']) && isset($_POST['key'])){ $file="../accounts/accounts.xml"; $dirofdir="../accounts/accounts/"; $account='account'; $masacc='accounts'; $nmtg='name'; $kytg='key'; $vrtg='verified'; if(file_exists($file)){ $xml = new DOMDocument(); $xml->load($file); $nodes = $xml->getElementsByTagName($masacc); $success=false; $verfied=false; if ($nodes->length > 0){ $accnodes = $nodes->item(0)->getElementsByTagName($account); if ($accnodes->length > 0){ for ($i = 0; $i <$accnodes->length; $i++) { $nodeval=$accnodes->item($i)->getElementsByTagName($nmtg)->item(0)->nodeValue; $nodekey=$accnodes->item($i)->getElementsByTagName($kytg)->item(0)->nodeValue; $nodeverf=$accnodes->item($i)->getElementsByTagName($vrtg)->item(0)->nodeValue; if($nodeval==$_POST['account']){ if($nodekey==$_POST['key']){ if($nodeverf=="false"){ $verfied=true; $accnodes->item($i)->getElementsByTagName($vrtg)->item(0)->nodeValue="true"; $xml->save($file); $dirofdir .=$_POST['account']; $dirofservices= $dirofdirs . '/services'; mkdir($dirofdir); mkdir($dirofservices); } } $success=true; break; } } } } $json->account = $_POST['account']; $json->key = $_POST['key']; $json->verified = $verfied; $json->success = $success; $alljson = json_encode($json); echo $alljson; } }else{ echo "err"; } ?>
- <?php if(isset($_POST['account']) && isset($_POST['key'])){ $file="../accounts/accounts.xml"; $account='account'; $masacc='accounts'; $nmtg='name'; $kytg='key'; $vrtg='verified'; if(file_exists($file)){ $xml = new DOMDocument(); $xml->load($file); $nodes = $xml->getElementsByTagName($masacc); if ($nodes->length > 0){ $accnodes = $nodes->item(0)->getElementsByTagName($account); if ($accnodes->length > 0){ $foundaccount=false; for ($i = 0; $i <$accnodes->length; $i++) { $nodename=$accnodes->item($i)->getElementsByTagName($nmtg)->item(0)->nodeValue; $nodekey=$accnodes->item($i)->getElementsByTagName($kytg)->item(0)->nodeValue; $nodeverf=$accnodes->item($i)->getElementsByTagName($vrtg)->item(0)->nodeValue; if($nodename==$_POST['account']){ $foundaccount=true; if($nodekey==$_POST['key']){ $json->account = $_POST['account']; $json->key = $_POST['key']; $json->access = ($nodekey==$_POST['key']); $json->verified = ($nodeverf=="true"); $json->success = true; $alljson = json_encode($json); echo $alljson; break; }else{ $json->account = $_POST['account']; $json->key = $_POST['key']; $json->access = ($nodekey==$_POST['key']); $json->verified = false; $json->success = true; $alljson = json_encode($json); echo $alljson; break; } } } if($foundaccount==false){ $json->account = $_POST['account']; $json->key = $_POST['key']; $json->access = false; $json->verified = false; $json->success = false; $alljson = json_encode($json); echo $alljson; } } } } }else{ echo "err"; } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement