Пример #1
0
 public function resetpassword($email)
 {
     $settings = Plugin::getAllSettings("registered_users");
     $reset_pass_type = $settings['reset_pass_type'];
     $reset_pass_length = $settings['reset_pass_length'];
     $reset_password_subject = $settings['reset_password_subject'];
     $reset_password_from = $settings['reset_password_from'];
     $reset_email_body = $settings['reset_email_body'];
     $reset_email_confirmed = $settings['reset_email_confirmed'];
     $common = new RUCommon();
     $newpassword = $common->random_string($reset_pass_type, $reset_pass_length);
     $newpasswordencrypted = sha1($newpassword);
     $PDO = Record::getConnection();
     $updatepassword = "******" . TABLE_PREFIX . "user SET password='******' WHERE email='{$email}'";
     $updatepassword = $PDO->prepare($updatepassword);
     $updatepassword->execute();
     $subject = "{$reset_password_subject}";
     $headers = "From: {$reset_password_from}\r\nReply-To: no-reply";
     $message = '' . $reset_email_body . '' . $newpassword . '';
     mail($email, $subject, $message, $headers);
     echo $reset_email_confirmed;
 }
Пример #2
0
 function password_reset()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         global $__FROG_CONN__;
         $email = mysql_escape_string($_POST['email']);
         $registration_settings = "SELECT * FROM " . TABLE_PREFIX . "registered_users_settings WHERE id='1'";
         foreach ($__FROG_CONN__->query($registration_settings) as $row) {
             $reset_no_email = $row['reset_no_email'];
         }
         if (empty($_POST['email'])) {
             echo $reset_no_email;
         } else {
             $common = new RUCommon();
             $common->resetpassword($email);
         }
     } else {
         global $__FROG_CONN__;
         $registration_settings = "SELECT * FROM " . TABLE_PREFIX . "registered_users_settings WHERE id='1'";
         foreach ($__FROG_CONN__->query($registration_settings) as $row) {
             $reset_form = $row['reset_form'];
             $reset_page = $row['reset_page'];
             $reset_text = $row['reset_text'];
         }
         echo $reset_text;
         echo '<form action="' . URL_PUBLIC . '' . $reset_page . '' . URL_SUFFIX . '" method="post">';
         echo $reset_form;
         echo '</form>';
     }
 }
Пример #3
0
 public function resetpassword($email)
 {
     global $__FROG_CONN__;
     $registration_settings = "SELECT * FROM " . TABLE_PREFIX . "registered_users_settings WHERE id='1'";
     foreach ($__FROG_CONN__->query($registration_settings) as $row) {
         $reset_pass_type = $row['reset_pass_type'];
         $reset_pass_length = $row['reset_pass_length'];
         $reset_password_subject = $row['reset_password_subject'];
         $reset_password_from = $row['reset_password_from'];
         $reset_email_body = $row['reset_email_body'];
         $reset_email_confirmed = $row['reset_email_confirmed'];
     }
     $common = new RUCommon();
     $newpassword = $common->random_string($reset_pass_type, $reset_pass_length);
     $newpasswordencrypted = sha1($newpassword);
     $updatepassword = "******" . TABLE_PREFIX . "user SET password='******' WHERE email='{$email}'";
     $updatepassword = $__FROG_CONN__->prepare($updatepassword);
     $updatepassword->execute();
     $subject = "{$reset_password_subject}";
     $headers = "From: {$reset_password_from}\r\nReply-To: no-reply";
     $message = '' . $reset_email_body . '' . $newpassword . '';
     mail($email, $subject, $message, $headers);
     echo $reset_email_confirmed;
 }
Пример #4
0
 function password_reset()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $email = trim($_POST['email']);
         $reset_no_email = Plugin::getSetting('reset_no_email', "registered_users");
         if (empty($_POST['email'])) {
             echo $reset_no_email;
         } else {
             $common = new RUCommon();
             $common->resetpassword($email);
         }
     } else {
         $reset_form = new View('../../plugins/registered_users/views/reset');
         $reset_page = Plugin::getSetting('reset_page', "registered_users");
         $reset_text = Plugin::getSetting('reset_text', "registered_users");
         echo $reset_text;
         echo '<form action="' . URL_PUBLIC . '' . $reset_page . '' . URL_SUFFIX . '" method="post">';
         echo $reset_form;
         echo '</form>';
     }
 }