<?php

header('Content-type: application/json');
chdir('../../common');
require_once 'init.php';
chdir('../database');
require_once 'storeFrontend.php';
require_once 'plataform.php';
chdir('../actions');
require_once 'plataform.php';
chdir('../ajax/plataform');
if (isset($_GET['email']) and isset($_GET['domain'])) {
    $merchantEmail = (string) $_GET['email'];
    $storeDomain = (string) $_GET['domain'];
    $merchantId = getMerchantByEmail($merchantEmail);
    $merchantId = $merchantId["id"];
    $storeId = getStoreId($storeDomain);
    addStoreOwner($storeId, $merchantId);
    echo json_encode(array("result" => "ok"));
} else {
    echo json_encode(array("result" => "missingParams"));
}
<?php

header('Content-type: application/json');
chdir('../../common');
require_once 'init.php';
chdir('../database');
require_once 'plataform.php';
chdir('../ajax/plataform');
if (isset($_GET['id']) or isset($_GET['email'])) {
    $id = "";
    if (isset($_GET['id'])) {
        $id = $_GET['id'];
    } else {
        $id = getMerchantByEmail($_GET['email']);
        $id = $id["id"];
    }
    if ($id) {
        if (isset($_GET['name'])) {
            $name = $_GET['name'];
            updateMerchantName($id, $name);
        }
        if (isset($_GET['newEmail'])) {
            $email = $_GET['newEmail'];
            updateMerchantEmail($id, $email);
        }
        if (isset($_GET['password'])) {
            $password = $_GET['password'];
            $password = hash("sha256", $password);
            updateMerchantPassword($id, $password);
        }
        if (isset($_GET['status'])) {