Working on L5

This commit is contained in:
Hillel Coren 2015-04-13 18:05:34 +03:00
parent 3641019d04
commit 635c1b9df1
14 changed files with 29 additions and 9 deletions

View File

@ -676,7 +676,7 @@ class AccountController extends BaseController
$user->last_name = trim(Input::get('new_last_name')); $user->last_name = trim(Input::get('new_last_name'));
$user->email = trim(strtolower(Input::get('new_email'))); $user->email = trim(strtolower(Input::get('new_email')));
$user->username = $user->email; $user->username = $user->email;
$user->password = trim(Input::get('new_password')); $user->password = bcrypt(trim(Input::get('new_password')));
$user->registered = true; $user->registered = true;
$user->save(); $user->save();

View File

@ -336,7 +336,7 @@ class UserController extends BaseController
// save the new password // save the new password
$user = Auth::user(); $user = Auth::user();
$user->password = $password; $user->password = bcrypt($password);
$user->save(); $user->save();
return RESULT_SUCCESS; return RESULT_SUCCESS;

View File

@ -165,7 +165,7 @@ class Utils
'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '', 'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '',
'ip' => Request::getClientIp(), 'ip' => Request::getClientIp(),
'count' => Session::get('error_count', 0), 'count' => Session::get('error_count', 0),
'input' => Input::all() //'input' => Input::all()
]; ];
Log::error($error."\n", $data); Log::error($error."\n", $data);

View File

@ -584,5 +584,7 @@ return array(
'email_approved' => 'Email me when a quote is <b>approved</b>', 'email_approved' => 'Email me when a quote is <b>approved</b>',
'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client',
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent',
); );

View File

@ -575,6 +575,8 @@ return array(
'email_approved' => 'Email me when a quote is <b>approved</b>', 'email_approved' => 'Email me when a quote is <b>approved</b>',
'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client',
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent',
); );

View File

@ -554,6 +554,8 @@ return array(
'email_approved' => 'Email me when a quote is <b>approved</b>', 'email_approved' => 'Email me when a quote is <b>approved</b>',
'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client',
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent',

View File

@ -575,6 +575,8 @@ return array(
'email_approved' => 'Email me when a quote is <b>approved</b>', 'email_approved' => 'Email me when a quote is <b>approved</b>',
'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client',
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent',
); );

View File

@ -577,6 +577,8 @@ return array(
'email_approved' => 'Email me when a quote is <b>approved</b>', 'email_approved' => 'Email me when a quote is <b>approved</b>',
'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client',
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent',
); );

View File

@ -585,6 +585,8 @@ return array(
'email_approved' => 'Email me when a quote is <b>approved</b>', 'email_approved' => 'Email me when a quote is <b>approved</b>',
'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client',
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent',

View File

@ -583,6 +583,8 @@ return array(
'email_approved' => 'Email me when a quote is <b>approved</b>', 'email_approved' => 'Email me when a quote is <b>approved</b>',
'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client',
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent',
); );

View File

@ -578,6 +578,8 @@ return array(
'email_approved' => 'Email me when a quote is <b>approved</b>', 'email_approved' => 'Email me when a quote is <b>approved</b>',
'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client',
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent',

View File

@ -578,6 +578,8 @@ return array(
'email_approved' => 'Email me when a quote is <b>approved</b>', 'email_approved' => 'Email me when a quote is <b>approved</b>',
'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client',
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent',
); );

View File

@ -581,6 +581,8 @@ return array(
'email_approved' => 'Email me when a quote is <b>approved</b>', 'email_approved' => 'Email me when a quote is <b>approved</b>',
'notification_quote_approved_subject' => 'Quote :invoice was approved by :client', 'notification_quote_approved_subject' => 'Quote :invoice was approved by :client',
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent',
); );

View File

@ -104,7 +104,7 @@
&nbsp; &nbsp;
{!! Former::password('current_password')->style('width:300px') !!} {!! Former::password('current_password')->style('width:300px') !!}
{!! Former::password('new_password')->style('width:300px') !!} {!! Former::password('newer_password')->style('width:300px')->label(trans('texts.new_password')) !!}
{!! Former::password('confirm_password')->style('width:300px') !!} {!! Former::password('confirm_password')->style('width:300px') !!}
&nbsp; &nbsp;
@ -158,7 +158,7 @@
$('#country_id').combobox(); $('#country_id').combobox();
$('#passwordModal').on('hidden.bs.modal', function () { $('#passwordModal').on('hidden.bs.modal', function () {
$(['current_password', 'new_password', 'confirm_password']).each(function(i, field) { $(['current_password', 'newer_password', 'confirm_password']).each(function(i, field) {
var $input = $('form #'+field); var $input = $('form #'+field);
$input.val(''); $input.val('');
$input.closest('div.form-group').removeClass('has-success'); $input.closest('div.form-group').removeClass('has-success');
@ -193,13 +193,13 @@
function validateChangePassword(showError) function validateChangePassword(showError)
{ {
var isFormValid = true; var isFormValid = true;
$(['current_password', 'new_password', 'confirm_password']).each(function(i, field) { $(['current_password', 'newer_password', 'confirm_password']).each(function(i, field) {
var $input = $('form #'+field), var $input = $('form #'+field),
val = $.trim($input.val()); val = $.trim($input.val());
var isValid = val && val.length >= 6; var isValid = val && val.length >= 6;
if (isValid && field == 'confirm_password') { if (isValid && field == 'confirm_password') {
isValid = val == $.trim($('#new_password').val()); isValid = val == $.trim($('#newer_password').val());
} }
if (isValid) { if (isValid) {
@ -229,9 +229,9 @@
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '{{ URL::to('users/change_password') }}', url: '{{ URL::to('/users/change_password') }}',
data: 'current_password=' + encodeURIComponent($('form #current_password').val()) + data: 'current_password=' + encodeURIComponent($('form #current_password').val()) +
'&new_password=' + encodeURIComponent($('form #new_password').val()) + '&new_password=' + encodeURIComponent($('form #newer_password').val()) +
'&confirm_password=' + encodeURIComponent($('form #confirm_password').val()), '&confirm_password=' + encodeURIComponent($('form #confirm_password').val()),
success: function(result) { success: function(result) {
if (result == 'success') { if (result == 'success') {