$phone = addslashes(htmlentities($_POST['phone']));
 if ($email != "" && $username != "" && $passwd != "" && $cpasswd != "" && $phone != "") {
     $valid = registerFormValidate($email, $username, $passwd, $cpasswd, $phone);
     //captcha check here.
     /*if(CAPTCHA) {
     			$privatekey = "6LeBe-gSAAAAAFUapPTQRce8OoINxje_0nnq57x5";
     			$resp = recaptcha_check_answer ($privatekey,
     						$_SERVER["REMOTE_ADDR"],
     						$_POST["recaptcha_challenge_field"],
     						$_POST["recaptcha_response_field"]);
     			$validCaptcha = $resp->is_valid;
     			
     		} else {*/
     $validCaptcha = 1;
     if ($valid == 1 && $validCaptcha == 1) {
         addAccount($username, $passwd, $email, $phone);
         if (sendAccountConfMail($username)) {
             $success = "You are Successfully Registered. A Confirmation mail has been sent to you. (Make sure to check your spam folder in your email account)";
         } else {
             $errmsg = "There's been an error while sending the Confirmation mail. We'll look into it soon. Inconvenience caused is deeply regretted.";
         }
         /*if ()
         		activateAccount($username);
         		$success = "You are Successfully Registered. Now you can login (link at bottom of page).";*/
         $email = "";
         $username = "";
         $passwd = "";
         $cpasswd = "";
         $phone = "";
     } else {
         if ($valid != 1) {
Exemplo n.º 2
0
require_once $_SESSION['File_Root'] . '/HTML/Header.php';
require_once 'Functions/SQL.php';
if (isset($_POST['accountPseudo']) && $_POST['accountPassword'] && $_POST['accountPasswordConfirm'] && $_POST['accountEmail'] && $_POST['characterLastName'] && $_POST['characterFirstName']) {
    $accountPseudo = htmlspecialchars(addslashes($_POST['accountPseudo']));
    $accountPassword = sha1(htmlspecialchars(addslashes($_POST['accountPassword'])));
    $accountPasswordConfirm = sha1(htmlspecialchars(addslashes($_POST['accountPasswordConfirm'])));
    $accountEmail = htmlspecialchars(addslashes($_POST['accountEmail']));
    $characterLastName = htmlspecialchars(addslashes($_POST['characterLastName']));
    $characterFirstName = htmlspecialchars(addslashes($_POST['characterFirstName']));
    if ($accountPassword == $accountPasswordConfirm) {
        if (isset($_POST['Licence'])) {
            $pseudoList = accountExist($bdd, $accountPseudo);
            if ($pseudoList == 0) {
                $characterList = characterExist($bdd, $characterLastName);
                if ($characterList == 0) {
                    addAccount($bdd, $accountPseudo, $accountPassword, $accountEmail);
                    $ID = findIdByPseudo($bdd, $accountPseudo);
                    addCharacter($bdd, $ID, $characterLastName, $characterFirstName);
                    echo $register10;
                } else {
                    echo $register11;
                }
            } else {
                echo $register12;
            }
        } else {
            echo $register13;
        }
    } else {
        echo $register14;
    }
Exemplo n.º 3
0
<?php

include 'connection.php';
//handle connection to mysql DB
//call the requested function
if ($_POST['method'] == "getAccounts") {
    getAccounts();
    //call getAccounts method
} elseif ($_POST['method'] == "addAccount") {
    addAccount($_POST['json']);
}
//get all accounts
function getAccounts()
{
    global $mysqli;
    $strQuery = "SELECT * FROM accounts";
    $accounts = getAccountsByQuery($strQuery);
    //return accounts as a json Object
    echo json_encode(array('Accounts' => $accounts));
}
//get accounts from db filterd by parameter strQuery
function getAccountsByQuery($strQuery)
{
    global $mysqli;
    // get array of accounts
    $result = $mysqli->query($strQuery);
    $accounts = array();
    if ($result->num_rows > 0) {
        while ($row = $result->fetch_assoc()) {
            $accounts[] = $row;
        }
Exemplo n.º 4
0
      */
 /**
  *		Attempt to create a new contact to the WhatsSpy Public Database (39512f5ea29c597f25483697471ac0b00cbb8088359c219e98fa8bdaf7e079fa)
  *		@notice This user is not verified as a WhatsApp user, the tracker verifies the contacts.
  */
 case 'addContact':
     requireAuth();
     if (isset($_GET['number']) && isset($_GET['countrycode'])) {
         // Name is optional
         $name = isset($_GET['name']) ? $_GET['name'] : null;
         // cut any prefix zero's of the number and country code.
         $number = cutZeroPrefix($_GET['number']);
         $countrycode = cutZeroPrefix($_GET['countrycode']);
         $groups = explode(',', $_GET['groups'] == '' ? null : $_GET['groups']);
         $account = preg_replace('/\\D/', '', $countrycode . $number);
         echo json_encode(addAccount($name, $account, $groups, true));
     } else {
         echo json_encode(['error' => 'No phone number supplied!', 'code' => 400]);
     }
     break;
     /**
      *		Set a contact to inactive, causing the user will not be tracked anymore but all data will be retained.
      */
 /**
  *		Set a contact to inactive, causing the user will not be tracked anymore but all data will be retained.
  */
 case 'setContactInactive':
     requireAuth();
     // We need the exact ID: this means no 003106 (only 316...)
     if (isset($_GET['number'])) {
         $number = preg_replace('/\\D/', '', $_GET['number']);
Exemplo n.º 5
0
    if ($password == '') {
        $arrayErrors['passwordNull'] = true;
    } else {
        // Teste sur la longueur du mot de passe
        if (strlen($password) < 5) {
            $arrayErrors['passwordLong'] = true;
        } else {
            // Teste si les mots de passe sont identiques
            if ($password != $confirmation) {
                $arrayErrors['passwordMatches'] = true;
            }
        }
    }
    // Vérification de l'existance du pseudo et du mail
    if (!isExistPseudo($dataBase, $pseudo)) {
        if (!isExistEmail($dataBase, $email)) {
            if (!isset($arrayErrors)) {
                addAccount($dataBase, $pseudo, $password, $email);
                header('Location: index.php');
            }
        } else {
            $arrayErrors['mailExist'] = true;
        }
    } else {
        $arrayErrors['pseudoExist'] = true;
    }
}
// Chargement du langage
loadLanguage(getLanguage());
// Affichage de la vue
require 'views/registerView.php';
Exemplo n.º 6
0
<?php

include_once '../index.php';
include_once '../connectDB.php';
if (isset($_SESSION['msg'])) {
    echo $_SESSION['msg'];
}
if (login_check($mysqli) && $_SESSION['registerPriv']) {
    if (isset($_POST['add'])) {
        addAccount($mysqli, $_POST['emailText'], $_POST['accountText'], $_POST['nameText']);
        header('Location: add_account.php');
    }
    echo '<form method=\'post\' action=\'' . htmlspecialchars($_SERVER['PHP_SELF']) . '\'><br>
	<fieldset>
	<legend>új felhasználó</legend>
	<label for="emailText"> Email: </label> <input type="email" name = "emailText" id="emailText" required /><br>
	<label for="accountText"> Account: </label> <input type="text" name="accountText" id="accountText" 
	pattern="^[a-zA-Z][a-zA-Z0-9-_\\.]{1,20}$"
	title="2-20 karakter, betűvel kezdve"
	required /><br>
	<label for="nameText"> Name: </label><input type="text" name = "nameText" id="nameText" required/><br>
	<button type="submit" name="add" value="add" > add </button>
	</fieldset>
	</form><br><br>';
} else {
    echo "NOT ALLOWED";
}
echo '</body>
	</html>';