Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Smarty Mail template Goes on error while password reset

 
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
chatber
Smarty n00b


Joined: 12 Jul 2016
Posts: 3

PostPosted: Tue Jul 12, 2016 4:40 am    Post subject: Smarty Mail template Goes on error while password reset Reply with quote

Hey admin or developers


Am new to this template engine, as i was searching throughout Google i found a php Social networking scripts, and it was designed biased smarty php template


And my problem is that when ever i use to reset pw, it sends mail. But it do not fetch reset code,

And i have check out my database, in that also it has not been updated


Here is php code for lostpass.php


Code:
<?
$page = "lostpass";
include "header.php";

if(isset($_POST['task'])) { $task = $_POST['task']; } elseif(isset($_GET['task'])) { $task = $_GET['task']; } else { $task = "main"; }

// SET ERROR VARS
$is_error = 0;
$submitted = 0;


if($task == "send_email") {

  $new_user = new se_user(Array(0, "", $_POST['user_email']), Array('user_id, user_email, user_username'));
  $submitted = 1;

  if($new_user->user_exists == 0) {
    $is_error = 1;
  } else {
    $lostpassword_code = randomcode(15);
    $lostpassword_time = time();
    if(send_lostpassword($new_user->user_info, $lostpassword_code)) {
      $database->database_query("UPDATE se_usersettings SET usersetting_lostpassword_code='$lostpassword_code', usersetting_lostpassword_time='$lostpassword_time' WHERE usersetting_user_id='".$new_user->user_info[user_id]."'");
    } else {
      $is_error = 1;
    }
  }
}



// ASSIGN VARIABLES AND INCLUDE FOOTER
$smarty->assign('is_error', $is_error);
$smarty->assign('submitted', $submitted);
include "footer.php";
?>



Here is lostpass.tpl
Code:
<html>
<head>
<title>{$admin_lostpass1}</title>

{literal}
<style type='text/css'>
body {
   color: #666666;
   text-align: center;
   background-color: #EEEEEE;
}
td {
   font-family: "Trebuchet MS", tahoma, verdana, serif;
   font-size: 9pt;
}
td.box {
   border: 1px dashed #AAAAAA;
   padding: 15px;
   background: #FFFFFF;
   font-family: "Trebuchet MS", tahoma, verdana, serif;
   font-size: 9pt;
}
td.login {
   font-family: "Trebuchet MS", tahoma, verdana, serif;
   font-size: 9pt;
}
input.text {
   font-family: arial, tahoma, verdana, serif;
   font-size: 9pt;
}
div.error {
   text-align: center;
   padding-top: 3px;
   font-weight: bold;
}
input.button {
   font-family: arial, tahoma, verdana, serif;
   font-size: 9pt;
   background: #DDDDDD;
   padding: 2px;
   font-weight: bold;
}
div.page_header {
   font-size: 14pt;
}
td.success {
   font-weight: bold;
   padding: 7px 8px 7px 7px;
   background: #f3fff3;
}
td.error {
   font-weight: bold;
   color: #FF0000;
   padding: 7px 8px 7px 7px;
   background: #FFF3F3;
}
img.icon {
   vertical-align: middle;
   margin-right: 4px;
}
a:link { color: #336699; }
a:visited { color: #336699; }
a:hover { color: #336699; }
</style>
{/literal}

</head>
<body>

<table height='100%' width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td>

  <table cellpadding='0' cellspacing='0' align='center' width='600'>
  <tr>
  <td class='box'>

    <div class='page_header'>{$admin_lostpass1}</div>
    {$admin_lostpass2}
    <br><br>

      {* SHOW SUCCESS MESSAGE IF NO ERROR *}
      {if $submitted == 1 AND $is_error == 0}

      <table cellpadding='0' cellspacing='0'>
      <tr><td class='success'>
        {$admin_lostpass3}
      </td></tr></table>
      <br>

    {else}

      {if $is_error == 1}
        <table cellpadding='0' cellspacing='0'>
        <tr><td class='error'>
          <img src='../images/error.gif' border='0' class='icon'>{$admin_lostpass4}
        </td></tr></table>
      <br>
      {/if}
 
      <form action='admin_lostpass.php' method='post'>
      <table cellpadding='0' cellspacing='0' align='center'>
      <tr>
      <td>{$admin_lostpass5}&nbsp;</td>
      <td><input type='text' class='text' name='admin_email' maxlength='70' size='40'></td>
      </tr>
      <tr>
      <td>&nbsp;</td>
      <td>
        <table cellpadding='0' cellspacing='0' style='margin-top: 5px;'>
        <td valign='top'>
          <input type='submit' class='button' value='{$admin_lostpass6}'>&nbsp;
          <input type='hidden' name='task' value='send_email'>
          </form>
        </td>
        <td valign='top'>
          <form action='admin_login.php' method='post'>
          <input type='submit' class='button' value='{$admin_lostpass7}'>
          </form>
        </td>
        </tr>
        </table>
      </td>
      </tr>
      </table>

    {/if}

  </td>
  </tr>
  </table>
</td>
</tr>
</table>

</body>
</html>



Please help to find a answer


Its occur because of php ugrade???
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP