Skip to content

Commit

Permalink
Added location information to read only version of events.added lost …
Browse files Browse the repository at this point in the history
…password retrieval
  • Loading branch information
mikevalstar committed Jan 22, 2013
1 parent 963d722 commit c6aae43
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion class/user.class.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static function lostpassword($email){
$user = new user($uid); $user = new user($uid);
$password = generatePassword(10, 8); $password = generatePassword(10, 8);
$user->save(array('passkey' => md5($password))); $user->save(array('passkey' => md5($password)));
email::send($_POST['email'], "Game Night Password Retrieval", "Your account on KG Game Night has been reset with the following password: {$password}"); email::send($_POST['email'], $user->name_first . ' ' . $user->name_last, "You Idiot - Password Retreival", "Your account on KG Game Night has been reset with the following password: {$password}");


return true; return true;
} }
Expand Down
1 change: 1 addition & 0 deletions content/index.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
case 'login': case 'login':
case 'logout': case 'logout':
case 'register': case 'register':
case 'forgot_password':
require_once('routes/manage/'. $PATH[0] .'.php'); require_once('routes/manage/'. $PATH[0] .'.php');
break; break;
// requires login // requires login
Expand Down
13 changes: 13 additions & 0 deletions routes/manage/forgot_password.php
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,13 @@
<?PHP

$T = new bTemplate('manage', 'forgot_password.tpl');

if(isset($_POST['email'])){
if(user::lostpassword($_POST['email'])){
header('location: /');
}else{
$T->assign('error', 'There is no use for this email address.');
}
}

$T->run();
25 changes: 25 additions & 0 deletions template/manage/forgot_password.tpl
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,25 @@
{extends 'layout.tpl'}
{block name="content"}

<div class="span6 offset3">
<form class="form-horizontal" method="post">
<legend>Forgotten Password</legend>
{if isset($error)}
<div class="alert alert-error">{$error}</div>
{/if}
<div class="control-group">
<label class="control-label" for="inputEmail">Email</label>
<div class="controls">
<input type="email" name="email" id="inputEmail" placeholder="Email" value="{$email|default:''}">
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary">Forgotten Password</button>
</div>
</div>
</form>
<div><a href="/Register">Register</a></div>
</div>

{/block}
1 change: 1 addition & 0 deletions template/manage/login.tpl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
</div> </div>
</div> </div>
</form> </form>
<div class="pull-right"><a href="/Forgot_Password">Forgot Your Password?</a></div>
<div><a href="/Register">Register</a></div> <div><a href="/Register">Register</a></div>
</div> </div>


Expand Down
2 changes: 1 addition & 1 deletion template/manage/plays.tpl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</thead> </thead>
<tbody> <tbody>
{foreach from=$results item=row} {foreach from=$results item=row}
<tr class="linkrow" data-link="/play/{$row['play_pk']}/{$row['game_name']|prettyurlencode}"> <tr class="linkrow" data-link="/plays/{$row['play_pk']}/{$row['game_name']|prettyurlencode}">
<td>{$row['game_name']|x}</td> <td>{$row['game_name']|x}</td>
<td>{$row['started']|x}</td> <td>{$row['started']|x}</td>
<td>{$row['playtime']|x} Min</td> <td>{$row['playtime']|x} Min</td>
Expand Down

0 comments on commit c6aae43

Please sign in to comment.