} header('Location: index.php?e=6'); exit; } else { // need to check the Activatoin table. $a = new Activation(); $a->getByEmail($email); if ($a->id and !$a->success) { // Good $a->password = md5($password); $a->save(); if (!doEmail($a->username, $password, $a->email)) { throw new Exception('Could not send the activation email. Please contact an admin on the forum, or by email'); } header('Location: index.php?e=6'); exit; } else { throw new Exception('That email address does not exists'); } } } //if } // try catch (Exception $e) {
} /* now with both of those functions defined, you can run a simple check to get back your responce: */ $fp = doTheCurl(); if (!$fp) { doEmail("cURL ERROR, SWITCHING TO HTTP", $email); $fp = doTheHttp(); } $res = $fp; /* and after that, you can check to see if $res is invalid or verified */ if (strcmp($res, "VERIFIED") == 0) { /* log stuff into your database here! Also, it's a good idea to send yourself an e-mail with all _POST params, just so you know what's going on. The e-mail code is here, the database code is not. */ doEmail("PayPal Purchase Success", $email); } else { if (strcmp($res, "INVALID") == 0) { doEmail("INVALID PayPal Purchase!!", $email); } else { doEmail("Error in IPN Code - Normally HTTP Error", $email); } } ?>
} } // don't start sending now, because we want to inform the client first and show the logentry // log-messages will be sent to client if ($config['send_mail'] == 1) { $log->write(Log::PHP, $lang['L_EMAIL_START']); } if (count($_SESSION['log']['ftp']) > 0) { $log->write(Log::PHP, $lang['L_FTP_START']); } } else { if (count($_SESSION['log']['email']) > 0) { // Ok we need to send an e-mail -> get index of first file $files = $_SESSION['log']['email']; $key = array_keys($files); doEmail($_SESSION['log']['email'][$key[0]]); unset($_SESSION['log']['email'][$key[0]]); // remove from array } else { $dump['backup_in_progress'] = 0; // all files sent } if ($dump['backup_in_progress'] == 0) { // check if ftp-transfers need to be done if (isset($_SESSION['log']['ftp']) && count($_SESSION['log']['ftp']) > 0) { // a file needs to be transferred $dump['backup_in_progress'] = 1; // indicate that there is still more to do // get index of ftp-connection $ftpConnectionIndexes = array_keys($_SESSION['log']['ftp']); $ftpConnection = $ftpConnectionIndexes[0];