We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit e42fc265 authored by Luke Slater's avatar Luke Slater

Removed unused invite code and template.

parent 6d3b040f
<?php
/* GNU FM -- a free network service for sharing your music listening habits
Copyright (C) 2009 Free Software Foundation, Inc
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once('database.php');
require_once('templating.php');
require_once('utils/EmailAddressValidator.php');
echo '<p>Invites are disabled.</p>';
/*
if(!$logged_in) {
$smarty->display('login.tpl');
die();
}
if(isset($_POST['invite'])) {
$errors = '';
$email = $_POST['email'];
$mail_validator = new EmailAddressValidator();
if(!$mail_validator->check_email_address($email)) {
$errors .= 'You must enter a valid e-mail address('.$email.').<br />';
}
# clean up
unset($mail_validator);
if(empty($errors)) {
$code = md5(md5($username) . time());
$adodb->Execute('INSERT INTO Invitations (inviter, code) VALUES ('
. $adodb->qstr($username) . ', '
. $adodb->qstr($code) . ')');
$url = $base_url . '/register.php?authcode=' . $code;
$headers = 'From: Libre.fm Invitations <invitations@libre.fm>';
$subject = 'Libre.fm Invitation';
$body = 'Hi!' . "\n\n" .
'Clearly ' . $username . ' really likes you, because he/she\'s inviting you to join http://libre.fm!' . "\n\n" .
'Just visit ' . $url . ' to sign up, all the cool kids are doing it.\n';
mail($email, $subject, $body, $headers);
unset($url, $subject, $body, $headers);
$smarty->assign('sent', true);
} else {
$smarty->assign('errors', $errors);
}
}
$smarty->display("invite.tpl");
?>
*/
......@@ -27,15 +27,6 @@ if($logged_in == true){
header('Location: index.php');
} else {
// Moving to open alpha
/*$authcode = $_GET["authcode"];
$res = $adodb->GetRow('SELECT inviter FROM Invitations WHERE code = ' . $adodb->qstr($authcode));
if(!$res) {
$invalid_authcode = true;
} else {
$invalid_authcode = false;
}*/
function sendEmail($text, $email) {
$headers = 'From: Libre.fm Account Activation <account@libre.fm>';
$subject = 'Libre.fm Account Activation - Action needed!';
......@@ -162,10 +153,6 @@ if(isset($_POST['register'])) {
. "please disregard this email.\n\n" . $url . "\n\n- The Libre.fm Team";
sendEmail($content, $email);
// Remove auth code and set their username as the invitee
//$adodb->Execute("UPDATE Invitations SET code = NULL, invitee = " . $adodb->qstr($username) . " WHERE code = " . $adodb->qstr($authcode));
//$removesql = "DELETE FROM Invitation_Request WHERE email=" . $adodb->qstr($email);
//$adodb->Execute($removesql);
$smarty->assign('registered', true);
} else {
$smarty->assign('username', $username);
......@@ -176,8 +163,6 @@ if(isset($_POST['register'])) {
$smarty->assign('errors', $errors);
}
}
//$smarty->assign("invalid_authcode", $invalid_authcode);
//$smarty->assign("authcode", $authcode);
$smarty->display('register.tpl');
}
{include file='header.tpl'}
<h2>Invite</h2>
{if isset($errors)}
<p id='errors'>{$errors}</p>
{/if}
{if isset($sent)}
<p>{t}Your invitation has been sent, pretty soon your friend should be thanking you profusely.{/t}</p>
{else}
<div id='invite'>
<form action='' method='post'>
<fieldset>
<p>{t escape=no}Do you have an awesome friend you'd like to share with? Just enter his/her email address and we'll sort them out with an invitation code.{/t}</p>
<label for='email'>{t}Invitee's E-mail:{/t}<span>{t}must be valid!{/t}</span></label>
<input id='email' name='email' type='text' value='' />
<input type='submit' name='invite' value='{t}Let them in!{/t}'/>
</fieldset>
</form>
</div>
{/if}
{include file='footer.tpl'}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment