Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $valid = 'false';
- require_once("passClass.php");
- $sql = array();
- $sql['host'] = "xxxxxxxxxxxx";
- $sql['user'] = "xxxxxxxxxxxxxxxxxx";
- $sql['pwd'] = "xxxxxxxxxx";
- $sql['db'] = "xxxxxxxxxxxx";
- $sql['mysql_error'] = "Verbindung zur Datenbank konnte hergestellt werden SQL Array Prüfen.";
- $sql['db_error'] = "Datenbank konnte gewählt werden.";
- $db = @mysqli_connect($sql['host'], $sql['user'], $sql['pwd']) or die($sql['mysql_error']);
- @mysqli_select_db($db,$sql['db']) or die($sql['db_error']);
- $username = @$_POST['username'];
- $password = @$_POST['password'];
- $sql = "SELECT password, userID FROM wcf1_user WHERE username = '" . $username . "'";
- ?>
- <?php
- $result = mysqli_query($db,$sql);
- $suche = mysqli_num_rows($result);
- $id = 0;
- if ($suche == '0') {
- $valid = 'false0';
- //echo "Diesen Benutzer Gibt es nicht";
- } else {
- while ($row = mysqli_fetch_assoc($result)) {
- $test = PasswordUtil::getDoubleSaltedHash($password,$row['password']);
- if($test == $row['password']){
- $valid = 'true'; // Passwort Stimmt
- $id = $row['userID'];
- }else{
- $valid = 'false'; // Passwort Falsch
- }
- }
- }
- if($valid == 'false'){
- //echo "Iwas Stimmt nicht!";
- echo "Passwort Falsch";
- }else if($valid == "false0"){
- //echo "Irgentwas ist falsch";
- }else{
- $sqlA = "SELECT userOption33 FROM wcf1_user_option_value WHERE userID = '".$id."'";
- $socialClub = mysqli_query($db,$sqlA);
- while ($d = mysqli_fetch_assoc($socialClub)){
- $club = $d['userOption33'];
- $json = "{\"erlich\":\"" . $valid . "\",\"SocialClub\":\"" . $club . "\"}";
- echo toGM("http://54.36.126.228:8888/Login", $json);
- }
- }
- function toGM($urli,$data){
- $url = $urli;
- $content = json_encode($data);
- $curl = curl_init($url);
- curl_setopt($curl, CURLOPT_HEADER, false);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_HTTPHEADER,
- array("Content-type: application/json"));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_TIMEOUT, 10);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
- $json_response = curl_exec($curl);
- $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
- if ( $status != 200 ) {
- die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
- }
- curl_close($curl);
- $response = json_decode($json_response, true);
- return $response;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement