. */ include_once __DIR__ . '/../database/database.php'; include_once __DIR__ . '/../objects/account.php'; include_once __DIR__ . '/../objects/password.php'; include_once __DIR__ . '/../objects/alias.php'; include_once __DIR__ . '/../objects/user_info.php'; include_once __DIR__ . '/../misc/utilities.php'; include_once __DIR__ . '/accounts_email.php'; include_once __DIR__ . '/accounts_phone.php'; include_once __DIR__ . '/../misc/results_values.php'; function activate_email_account($user, $domain, $key, $algo) { $domain = get_domain($domain); $algo = get_algo($algo); Logger::getInstance()->message("[HTTP] activate_email_account(" . $user . ", " . $domain . ", " . $key . ", " . $algo . ")"); if (!check_parameter($user)) { return MISSING_USERNAME_PARAM; } elseif ($algo == null) { return ALGO_NOT_SUPPORTED; } $database = new Database(); $db = $database->getConnection(); $account = new Account($db); $account->username = $user; $account->domain = $domain; if (!$account->getOne()) { Logger::getInstance()->error("[HTTP] Account not found"); return ACCOUNT_NOT_FOUND; } elseif ($account->activated != "0") { Logger::getInstance()->warning("[HTTP] Account already activated"); return ACCOUNT_ALREADY_ACTIVATED; } if (!is_key_matching($key, $account)) { Logger::getInstance()->error("[HTTP] Key doesn't match"); return KEY_DOESNT_MATCH; } $account->activated = "1"; $account->update(); Logger::getInstance()->message("[HTTP] Account activated"); } $user = $_GET["username"]; $domain = $_GET["domain"]; $key = $_GET["confirmation_key"]; $algo = $_GET["algo"]; activate_email_account($user, $domain, $key, $algo); ?>