<?php
class Login
{
protected $id;
private $email;
private $password;
private $json;
public function __construct()
{
$firebase = new \Firebase\FirebaseLib(DEFAULT_URL, DEFAULT_TOKEN);
$this->json = $firebase->get(DEFAULT_PATH . "/ARCusers/", array('activation' => '"true"'));
if (isset($_GET['Login'])) {
$this->email = '"' . $_GET['addemail'] . '"';
$this->password = '"' . $_GET['addpassword'] . '"';
$json = json_decode($this->json, true);
foreach ($json as $this->id => $val) {
if ($this->email == $firebase->get(DEFAULT_PATH . "/ARCusers/$this->id/email") && $this->password == $firebase->get(DEFAULT_PATH . "/ARCusers/$this->id/password")) {
$activation = $firebase->get(DEFAULT_PATH . "ARCusers/$this->id/activation");
if ($activation == 'true') {
header('Location: profile.php');
} else {
echo "<br>";
echo "<br>";
echo "Verify your email";
break;
}
} else {
echo "<br>";
echo "Email or password incorrect";
break;
}
}
}
}
}
class Activation extends Login
{
private $license_key;
private $license_key_activation;
private $getId;
public function __construct()
{
parent::__construct();
$this->getId = $this->id;
echo "$this->getId";
$firebase = new \Firebase\FirebaseLib(DEFAULT_URL, DEFAULT_TOKEN);
$this->license_key = $firebase->get(DEFAULT_PATH . "/ARCusers/$this->getId/License/license key");
$this->license_key_activation = $firebase->get(DEFAULT_PATH . "/ARCusers/$this->getId/License/license key activation ");
if (isset($_GET['LicenseKey'])) {
if ($this->license_key == '"' . $_GET['addlicensekey'] . '"') {
$firebase->set(DEFAULT_PATH . "/ARCusers/$this->getId/License/license key activation", true);
} else {
echo "false";
}
}
}
}
?>