<?php
if (Wo_IsLogged() === true) {
   header("Location: " . $wo['config']['site_url']);
   exit();
} else {
  if (isset($_GET['tab2'])) {
   if ($_GET['tab2'] == 'success') {
?>
<div class="text-center">
   <h2><?php echo $wo['lang']['your_account_activated'];?></h2>
   <div class="account-activate-icon"><i class="fa fa-check-circle"></i></div>
   <h4><?php echo str_replace('{login}', $wo['lang']['login'], $wo['lang']['free_to_login']);?></h4>
</div>
<?php
    } else {
      header("Location: " . Wo_SeoLink('index.php?tab1=welcome'));
      exit();
    }
  } else if (isset($_GET['email'], $_GET['code']) === true) {
      $email = $_GET['email'];
      $code  = $_GET['code'];
      if (Wo_EmailExists($email) === false) {
        header("Location: " . Wo_SeoLink('index.php?tab1=welcome'));
        exit();
      } else if (Wo_ActivateUser($email, $code) === false) {   
        header("Location: " . Wo_SeoLink('index.php?tab1=welcome'));   
        exit();   
      } else {
        $_SESSION['user_id'] = Wo_UserIdFromEmail($email);
        header("Location: " . Wo_SeoLink('index.php?tab1=start-up'));
        exit();
      }
  } else {
    header("Location: " . Wo_SeoLink('index.php?tab1=welcome'));
    exit();
  }
}
?>