} else { return Redirect::to('error'); } }); Route::get('emails/welcome', function () { return View::make('emails/welcome'); }); Route::match(array('GET', 'POST'), '{page}', array('before' => 'auth', function ($page) { switch ($page) { case 'send': $envio = new SendMail(); $envio->enviar(); return Redirect::to('admin'); break; case 'new_user': $new = new NewUser(); $new->crear_user(); return Redirect::to('admin'); break; case 'crear_grupo': $crear = new CrearGrupo(); $crear->nuevoGrupo(); return Redirect::to('lista'); break; case 'send_camp': set_time_limit(0); ini_set('memory_limit', '-1'); $send_camp = new SendMail(); $send_camp->enviar(); return Redirect::to('admin'); break;
<span class="searchBlock"> Create an Account!<br> Please fill in the information below to get started<br><br> <?php //preliminary check //check if var set if (isset($_POST['name'])) { //set flag for terms and conditions checking $termsStatus = 0; if (isset($_POST['accepted'])) { $termsStatus = 1; } $incomingUser = new NewUser(); //set parameters $incomingUser->name = $_POST['name']; $incomingUser->username = $_POST['username']; $incomingUser->password1 = $_POST['password']; $incomingUser->password2 = $_POST['password2']; $incomingUser->emailaddress = $_POST['emailaddress']; $incomingUser->setAcceptedTermsStatus($termsStatus); $incomingUser->verifyNewAccountEntry(); /* //check and proceed if free to write into table if( checkexisting($tableName, $userArgument, $userValue) == 0){ //if free, extract inputs and save to database $nameValue = mysql_real_escape_string($_POST['name']);
$generic_error = 'You left a field blank'; if (isset($_POST['submit'])) { if (empty($_POST['username']) || empty($_POST['password']) || empty($_POST['password2']) || empty($_POST['email']) || empty($_POST['handle'])) { $error_message = $generic_error; } else { if ($_POST['password'] !== $_POST['password2']) { $error_message = 'Mis-matching passwords'; echo $error_message; header('Location: ../../../pages/signup.php'); } else { // Attempt to implement some security by removing backslashes $username = stripslashes($_POST['username']); $password = stripslashes($_POST['password']); $handle = stripslashes($_POST['handle']); $email = stripslashes($_POST['email']); $signup = new NewUser($username, $password, $handle, $email); if ($signup->checkDuplicateEmail() && $signup->checkDuplicateUser()) { if ($signup->createUser() && $signup->checkUser()) { $_SESSION['username'] = $username; $_SESSION['handle'] = $handle; $_SESSION['email'] = $email; header('Location: /pages/profile.php'); } } else { $error_message = 'Something went wrong when creating the new user'; } } } } $stat = null; $signup = null;