<?php
// === Добавление уравнений ===
define('IN_EqWorld_AddEqs', true);
require_once('templates/header_prep.php');
$_SESSION['act']['action']='activation'; // Тип дейстивия
$AddEqs_title_1 = 'Activation The Your Submited Equation'; // Вторичный заголовок
$AddEqs_header_type = 'nav_full'; // Вид навигции
$AddEqs_form_submit = 'activation.php'; // куда из форм
require_once('templates/header.php');

// получили код активации
if( isset($_REQUEST['actCode']) && isset($_REQUEST['actEmail']) && $_REQUEST['actCode']!=='' && $_REQUEST['actEmail']!=='' )
{
 $id = EWAE_DB_DataCheckPasw($_REQUEST['actCode'],'',$_REQUEST['actEmail']);
 if( $id>=0 )
 {
  EWAE_DB_DataUpdateActivate($id,1);
  EWAE_SESSION_AuthForId($id);
  print '<div align="center">Your Equation is activated<br>Click <a href="view.php?id='.htmlentities(urlencode($id)).'">here</a> to view your equation it or <a href="index.php">here</a> to return to main page</div>';
  require_once('templates/footer.php');
  exit();
 }
 else
  print '<div align="center" class="EWae_red">Error during activation. May be wrong type your email or password?</div>';
}
?>

<form action="<?php print $AddEqs_form_submit?>" method="post"><table align="center" border="0" class="EWae_form" cellspacing="1">
<tr><td align="right" nowrap><b>Email</b>:&nbsp;</td><td>&nbsp;<input name="actEmail" type="text" size="25" maxlength="40"></td></tr>
<tr><td align="right" nowrap><b>Password</b>&nbsp;(Activation&nbsp;code):&nbsp;</td><td>&nbsp;<input name="actCode" type="password" size="25" maxlength="25"></td></tr>
<tr><td align="center" colspan="2" class="hl"><input type="submit" value="Go!"></td></tr>
</table></form>
<?php
require_once('templates/footer.php');
?>