Permalink
Browse files

Added location information to read only version of events.added lost …

…password retrieval
  • Loading branch information...
1 parent 963d722 commit c6aae43d7ad3df7cb76908c7e1bde5cc3df152f6 @mikevalstar committed Jan 22, 2013
View
2 class/user.class.php
@@ -86,7 +86,7 @@ static function lostpassword($email){
$user = new user($uid);
$password = generatePassword(10, 8);
$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;
}
View
1 content/index.php
@@ -10,6 +10,7 @@
case 'login':
case 'logout':
case 'register':
+ case 'forgot_password':
require_once('routes/manage/'. $PATH[0] .'.php');
break;
// requires login
View
13 routes/manage/forgot_password.php
@@ -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();
View
25 template/manage/forgot_password.tpl
@@ -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}
View
1 template/manage/login.tpl
@@ -25,6 +25,7 @@
</div>
</div>
</form>
+ <div class="pull-right"><a href="/Forgot_Password">Forgot Your Password?</a></div>
<div><a href="/Register">Register</a></div>
</div>
View
2 template/manage/plays.tpl
@@ -20,7 +20,7 @@
</thead>
<tbody>
{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['started']|x}</td>
<td>{$row['playtime']|x} Min</td>

0 comments on commit c6aae43

Please sign in to comment.