Email handling, frontpage design, signup page, minor other style changes
parent
8eab3e0e54
commit
94fe505254
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/*
|
||||
* projectname is more free software. It is licensed under the WTFPL, which
|
||||
* allows you to do pretty much anything with it, without having to
|
||||
* ask permission. Commercial use is allowed, and no attribution is
|
||||
* required. We do politely request that you share your modifications
|
||||
* to benefit other developers, but you are under no enforced
|
||||
* obligation to do so :)
|
||||
*
|
||||
* Please read the accompanying LICENSE document for the full WTFPL
|
||||
* licensing text.
|
||||
*/
|
||||
|
||||
if(!isset($_APP)) { die("Unauthorized."); }
|
||||
|
||||
$sPageContents = NewTemplater::Render("index", $locale->strings, array());
|
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/*
|
||||
* projectname is more free software. It is licensed under the WTFPL, which
|
||||
* allows you to do pretty much anything with it, without having to
|
||||
* ask permission. Commercial use is allowed, and no attribution is
|
||||
* required. We do politely request that you share your modifications
|
||||
* to benefit other developers, but you are under no enforced
|
||||
* obligation to do so :)
|
||||
*
|
||||
* Please read the accompanying LICENSE document for the full WTFPL
|
||||
* licensing text.
|
||||
*/
|
||||
|
||||
if(!isset($_APP)) { die("Unauthorized."); }
|
||||
|
||||
$sErrors = array();
|
||||
|
||||
if(!empty($_POST['submit']))
|
||||
{
|
||||
if(empty($_POST['username']) || !preg_match("/^[a-zA-Z0-9-.]+$/", $_POST['username']))
|
||||
{
|
||||
$sErrors[] = "You did not enter a valid username. Your username can only contain a-z, A-Z, 0-9, dots, and dashes.";
|
||||
}
|
||||
elseif(User::CheckIfUsernameExists($_POST['username']) || User::CheckIfDisplayNameExists($_POST['username']))
|
||||
{
|
||||
$sErrors[] = "The username you entered is already in use. Please pick a different username.";
|
||||
}
|
||||
|
||||
if(empty($_POST['email']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL))
|
||||
{
|
||||
$sErrors[] = "You did not enter a valid e-mail address.";
|
||||
}
|
||||
elseif(User::CheckIfEmailExists($_POST['email']))
|
||||
{
|
||||
$sErrors[] = "The e-mail address you entered is already in use. Did you <a href=\"/forgot-password\">forget your password</a>?";
|
||||
}
|
||||
|
||||
if(empty($_POST['password']) || strlen($_POST['password']) < 8)
|
||||
{
|
||||
$sErrors[] = "You did not enter a valid password. Your password has to be at least 8 characters.";
|
||||
}
|
||||
elseif(empty($_POST['password2']) || $_POST['password'] != $_POST['password2'])
|
||||
{
|
||||
$sErrors[] = "The passwords you entered did not match.";
|
||||
}
|
||||
|
||||
if(!empty($_POST['displayname']) && User::CheckIfDisplayNameExists($_POST['displayname']))
|
||||
{
|
||||
$sErrors[] = "The (display) name you entered is already in use. Please pick a different name. You can also just use your nickname!";
|
||||
}
|
||||
|
||||
if(empty($sErrors))
|
||||
{
|
||||
$sUser = new User(0);
|
||||
$sUser->uUsername = $_POST['username'];
|
||||
$sUser->uDisplayName = (!empty($_POST['displayname'])) ? $_POST['displayname'] : $_POST['username'];
|
||||
$sUser->uPassword = $_POST['password'];
|
||||
$sUser->uEmailAddress = $_POST['email'];
|
||||
$sUser->uActivationKey = random_string(16);
|
||||
$sUser->GenerateSalt();
|
||||
$sUser->GenerateHash();
|
||||
$sUser->InsertIntoDatabase();
|
||||
|
||||
send_mail($_POST['email'], "Please confirm your registration at ReDonate.",
|
||||
NewTemplater::Render("email/signup.txt", $locale->strings, array(
|
||||
"confirmation-url" => "http://redonate.cryto.net/confirm/{$sUser->sEmailAddress}/{$sUser->sActivationKey}/",
|
||||
"name" => $sUser->uDisplayName)), /* we don't want a HTML-entities-encoded version here */
|
||||
NewTemplater::Render("email/layout.html", $locale->strings, array(
|
||||
"contents" => NewTemplater::Render("email/signup.html", $locale->strings, array(
|
||||
"confirmation-url" => "http://redonate.cryto.net/confirm/{$sUser->sEmailAddress}/{$sUser->sActivationKey}/",
|
||||
"name" => $sUser->sDisplayName))
|
||||
))
|
||||
);
|
||||
|
||||
$sPageContents = NewTemplater::Render("signup/success", $locale->strings, array());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$sPageContents = NewTemplater::Render("signup/form", $locale->strings, array('errors' => $sErrors));
|
@ -0,0 +1,23 @@
|
||||
<p>
|
||||
<strong>Hello there, great to have you on board!</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You've subscribed to pledge {%?amount} a month to {%?project-name} using Redonate. We want to make sure that it was really you, so you'll have to click on the following link (or copy-paste it) to confirm that you want to do this:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="{%?confirmation-url}">{%?confirmation-url}</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you did not subscribe and someone else used your e-mail address, don't panic! ReDonate is a service for voluntary recurring donations. We do not automatically charge for a donation, and just act as a reminder service. You can safely ignore this e-mail if you did not subscribe (or changed your mind), and we'll remove the subscription in 7 days.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you have any further questions, don't hesitate to reply to this e-mail! We promise we'll read every e-mail, and give you a personal response.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<em>- Sven Slootweg, ReDonate</em>
|
||||
</p>
|
@ -0,0 +1,11 @@
|
||||
Hello there, great to have you on board!
|
||||
|
||||
You've subscribed to pledge {%?amount} a month to {%?project-name} using Redonate. We want to make sure that it was really you, so you'll have to click on the following link (or copy-paste it) to confirm that you want to do this:
|
||||
|
||||
{%?confirmation-url}
|
||||
|
||||
If you did not subscribe and someone else used your e-mail address, don't panic! ReDonate is a service for voluntary recurring donations. We do not automatically charge for a donation, and just act as a reminder service. You can safely ignore this e-mail if you did not subscribe (or changed your mind), and we'll remove the subscription in 7 days.
|
||||
|
||||
If you have any further questions, don't hesitate to reply to this e-mail! We promise we'll read every e-mail, and give you a personal response.
|
||||
|
||||
- Sven Slootweg, ReDonate
|
@ -0,0 +1,5 @@
|
||||
<div style="background-color: #E5EFD7; font-family: sans-serif; padding: 12px; color: black;">
|
||||
<p style="font-size: 46px; font-weight: bold; margin-top: 5px; margin-bottom: 12px;"><span style="color: #7AAA3E;">Re</span><span style="color: #587532;">Donate</span></p>
|
||||
|
||||
{%?contents}
|
||||
</div>
|
@ -0,0 +1,23 @@
|
||||
<p>
|
||||
<strong>Hello there {%?name}, great to have you on board!</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You've recently signed up on ReDonate. We want to make sure that it was really you, so you'll have to click (or copy-paste) the following link to let us know that you're okay with this:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="{%?confirmation-url}">{%?confirmation-url}</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you did not sign up yourself or you changed your mind, don't worry! You can simply ignore this e-mail, and we'll remove your account in 7 days.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you have any further questions, don't hesitate to reply to this e-mail! We promise we'll read every e-mail, and give you a personal response.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<em>- Sven Slootweg, ReDonate</em>
|
||||
</p>
|
@ -0,0 +1,11 @@
|
||||
Hello there {%?name}, great to have you on board!
|
||||
|
||||
You've recently signed up on ReDonate. We want to make sure that it was really you, so you'll have to click (or copy-paste) the following link to let us know that you're okay with this:
|
||||
|
||||
{%?confirmation-url}
|
||||
|
||||
If you did not sign up yourself or you changed your mind, don't worry! You can simply ignore this e-mail, and we'll remove your account in 7 days.
|
||||
|
||||
If you have any further questions, don't hesitate to reply to this e-mail! We promise we'll read every e-mail, and give you a personal response.
|
||||
|
||||
- Sven Slootweg, ReDonate
|
@ -0,0 +1,60 @@
|
||||
<div class="padding">
|
||||
<h2>ReDonate is recurring contributions, done right.</h2>
|
||||
</div>
|
||||
<div class="intro">
|
||||
<img src="/static/images/intro.png">
|
||||
</div>
|
||||
<div class="padding">
|
||||
<div class="col1">
|
||||
<h3>Why use ReDonate?</h3>
|
||||
|
||||
<p>
|
||||
You just made an awesome website. Or maybe you made an album, or even a movie! You really want
|
||||
to make it available to others for free, but you don't get donations very often.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>What if your fans are simply <em>forgetting</em> to donate?</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Maybe you've considered recurring donations. But on the other hand, would you really want to automatically take
|
||||
away money from your users and fans? If they have to jump through hoops to get rid of it... is it really a donation?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>We're here to help.</strong> We'll allow your users and fans to subscribe to monthly donations, while
|
||||
still keeping them <em>100% voluntary</em>. A donor can unsubscribe or choose not to donate at any time. And
|
||||
we'll give you a neat statistics page to keep track of what's going on :)
|
||||
</p>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<h3>Here's what you get:</h3>
|
||||
|
||||
<ul>
|
||||
<li><strong>100% free! No fees, no paid memberships.</strong></li>
|
||||
<li>For developers, creators, artists, fundraisers, charity workers, and quite literally everyone else.</li>
|
||||
<li>Have a more predictable income, from donations.</li>
|
||||
<li>Keep your donations <em>really</em> voluntary.</li>
|
||||
<li>Allow your donors to unsubscribe at any time, no commitments or hoops to jump through.</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>No restrictions on payment methods or currencies.</li>
|
||||
<li>Yes, we do Bitcoin as well.</li>
|
||||
<li>No restrictions on what your campaign is about.</li>
|
||||
<li>Completely safe. We do not process any transactions ourselves, and do not hold any funds.</li>
|
||||
<li>ReDonate is a non-profit project. We have no interest or benefit in selling your data.</li>
|
||||
</ul>
|
||||
<div style="text-align: center; margin-top: 36px;">
|
||||
<form method="post" action="/sign-up">
|
||||
<button type="submit" class="green-button" id="button_subscribe">
|
||||
Sign up now!<br><span style="font-size: 12px;">(it's free, so why not?)</span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div style="font-size: 14px; margin-bottom: 24px; text-align: center;">
|
||||
(or <a href="/login">log in</a> to your existing account)
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
@ -0,0 +1,49 @@
|
||||
<h2 class="spaced">Great! It'll only take a moment...</h2>
|
||||
|
||||
{%if isempty|errors == false}
|
||||
<div class="errors">
|
||||
One or more problems occurred:
|
||||
<ul>
|
||||
{%foreach error in errors}
|
||||
<li>{%?error}</li>
|
||||
{%/foreach}
|
||||
</ul>
|
||||
Please correct these issues and submit the form again.
|
||||
</div>
|
||||
{%/if}
|
||||
|
||||
<form method="post" action="/sign-up">
|
||||
<div class="formfield next-similar">
|
||||
<label>Username</label>
|
||||
{%input type="text" name="username"}
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div class="formfield next-similar previous-similar">
|
||||
<label>Name (optional)</label>
|
||||
{%input type="text" name="displayname"}
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div class="formfield previous-similar">
|
||||
<label>E-mail address</label>
|
||||
{%input type="email" name="email"}
|
||||
<div class="note">we'll send you a verification e-mail</div>
|
||||
</div>
|
||||
|
||||
<div class="formfield next-similar">
|
||||
<label>Password</label>
|
||||
{%input type="password" name="password"}
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div class="formfield previous-similar">
|
||||
<label>Password (again)</label>
|
||||
{%input type="password" name="password2"}
|
||||
<div class="note">at least 8 characters</div>
|
||||
</div>
|
||||
|
||||
<div class="formfield submit">
|
||||
<button type="submit" class="green-button" name="submit" value="submit">Sign me up!</button>
|
||||
</div>
|
||||
</form>
|
@ -0,0 +1,10 @@
|
||||
<h2>Only one more step...</h2>
|
||||
|
||||
<p>
|
||||
We want to make sure that you're really the owner of that e-mail address - we hate spam as much as you do!
|
||||
To verify, we've sent you an e-mail with a confirmation link.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Once you click that link, you'll be automatically logged in, and you can start creating a campaign right away!
|
||||
</p>
|
Loading…
Reference in New Issue