Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upadate the key of table name of password #549

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ to be confirmed to be able to login to the website._
In the `require` key of `composer.json` file add the following

```json
"zizaco/confide": "dev-5.0"
"zizaco/confide": "5.0.x-dev"
```

Run the Composer update comand
Expand Down Expand Up @@ -267,7 +267,7 @@ Confide::makeResetPasswordForm($token):
You would use:

```php
View::make(Config::get('confide::reset_password_form'))
View::make(Config::get('confide.reset_password_form'))
->with('token', $token);
```

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"src/commands"
],
"files": [
"tests/Confide/helpers.php"
"src/Confide/helpers.php"
],
"psr-4": {
"Zizaco\\Confide\\": "src/Confide/"
Expand Down
4 changes: 2 additions & 2 deletions src/Confide/CacheLoginThrottleService.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function isThrottled($identity)
// Retuns the current count
$count = $this->countThrottle($identity, 0);

return $count >= $this->app->make('config')->get('confide::throttle_limit');
return $count >= $this->app->make('config')->get('confide.throttle_limit');
}

/**
Expand Down Expand Up @@ -104,7 +104,7 @@ protected function countThrottle($identityString, $increments = 1)

$count = $count + $increments;

$ttl = $this->app->make('config')->get('confide::throttle_time_period');
$ttl = $this->app->make('config')->get('confide.throttle_time_period');

$this->app->make('cache')
->put('login_throttling:'.md5($identityString), $count, $ttl);
Expand Down
10 changes: 5 additions & 5 deletions src/Confide/Confide.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ protected function loginThrottling($identity)
$count = $this->loginThrottler
->throttleIdentity($identity);

if ($count >= $this->app->make('config')->get('confide::throttle_limit')) {
if ($count >= $this->app->make('config')->get('confide.throttle_limit')) {
return false;
}

Expand Down Expand Up @@ -292,7 +292,7 @@ public function logout()
*/
public function makeLoginForm()
{
return $this->app->make('view')->make($this->app->make('config')->get('confide::login_form'));
return $this->app->make('view')->make($this->app->make('config')->get('confide.login_form'));
}

/**
Expand All @@ -302,7 +302,7 @@ public function makeLoginForm()
*/
public function makeSignupForm()
{
return $this->app->make('view')->make($this->app->make('config')->get('confide::signup_form'));
return $this->app->make('view')->make($this->app->make('config')->get('confide.signup_form'));
}

/**
Expand All @@ -312,7 +312,7 @@ public function makeSignupForm()
*/
public function makeForgotPasswordForm()
{
return $this->app->make('view')->make($this->app->make('config')->get('confide::forgot_password_form'));
return $this->app->make('view')->make($this->app->make('config')->get('confide.forgot_password_form'));
}

/**
Expand All @@ -323,7 +323,7 @@ public function makeForgotPasswordForm()
public function makeResetPasswordForm($token)
{
return $this->app->make('view')->make(
$this->app->make('config')->get('confide::reset_password_form'),
$this->app->make('config')->get('confide.reset_password_form'),
array('token' => $token)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Confide/EloquentPasswordService.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ protected function sendEmail($user, $token)
$lang = $this->app->make('translator');

$this->app->make('mailer')->queueOn(
$config->get('confide::email_queue'),
$config->get('confide::email_reset_password'),
$config->get('confide.email_queue'),
$config->get('confide.email_reset_password'),
compact('user', 'token'),
function ($message) use ($user, $token, $lang) {
$message
Expand All @@ -197,7 +197,7 @@ protected function getOldestValidDate()
$config = $this->app->make('config');

return $carbon->now()
->subHours($config->get('confide::confide.password_reset_expiration', 7))
->subHours($config->get('confide.password_reset_expiration', 7))
->toDateTimeString();
}
}
File renamed without changes.
14 changes: 7 additions & 7 deletions src/views/generators/controller.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class {{ $class }} extends Controller
*/
public function {{ (! $restful) ? 'create' : 'getCreate' }}()
{
return View::make(Config::get('confide::signup_form'));
return View::make(Config::get('confide.signup_form'));
}

/**
Expand All @@ -43,10 +43,10 @@ public function {{ (! $restful) ? 'store' : 'postIndex' }}()
$user = $repo->signup(Input::all());

if ($user->id) {
if (Config::get('confide::signup_email')) {
if (Config::get('confide.signup_email')) {
Mail::queueOn(
Config::get('confide::email_queue'),
Config::get('confide::email_account_confirmation'),
Config::get('confide.email_queue'),
Config::get('confide.email_account_confirmation'),
compact('user'),
function ($message) use ($user) {
$message
Expand Down Expand Up @@ -77,7 +77,7 @@ public function {{ (! $restful) ? 'login' : 'getLogin' }}()
if (Confide::user()) {
return Redirect::to('/');
} else {
return View::make(Config::get('confide::login_form'));
return View::make(Config::get('confide.login_form'));
}
}

Expand Down Expand Up @@ -135,7 +135,7 @@ public function {{ (! $restful) ? 'confirm' : 'getConfirm' }}($code)
*/
public function {{ (! $restful) ? 'forgotPassword' : 'getForgot' }}()
{
return View::make(Config::get('confide::forgot_password_form'));
return View::make(Config::get('confide.forgot_password_form'));
}

/**
Expand Down Expand Up @@ -166,7 +166,7 @@ public function {{ (! $restful) ? 'doForgotPassword' : 'postForgot' }}()
*/
public function {{ (! $restful) ? 'resetPassword' : 'getReset' }}($token)
{
return View::make(Config::get('confide::reset_password_form'))
return View::make(Config::get('confide.reset_password_form'))
->with('token', $token);
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/generators/repository.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function login($input)
$input['password'] = null;
}

return Confide::logAttempt($input, Config::get('confide::signup_confirm'));
return Confide::logAttempt($input, Config::get('confide.signup_confirm'));
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Confide/CacheLoginThrottleServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testShouldCheckIsThrottled()
->andReturn(10); // More than the limit specified bellow

$config->shouldReceive('get')
->once()->with('confide::throttle_limit')
->once()->with('confide.throttle_limit')
->andReturn(9);

/*
Expand Down Expand Up @@ -118,7 +118,7 @@ public function testShouldCheckIsThrottledOnNonThrottled()
->andReturn(5); // Less than the limit specified bellow

$config->shouldReceive('get')
->once()->with('confide::throttle_limit')
->once()->with('confide.throttle_limit')
->andReturn(9);

/*
Expand Down Expand Up @@ -295,7 +295,7 @@ public function testShouldCountThrottle()
->andReturn(1);

$config->shouldReceive('get')
->once()->with('confide::throttle_time_period')
->once()->with('confide.throttle_time_period')
->andReturn($ttl);

$cache->shouldReceive('put')
Expand Down
12 changes: 6 additions & 6 deletions tests/Confide/ConfideTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ public function testShouldDoLoginThrottling()
->passthru();

$config->shouldReceive('get')
->twice()->with('confide::throttle_limit')
->twice()->with('confide.throttle_limit')
->andReturn(19);

$loginThrottler->shouldReceive('throttleIdentity')
Expand Down Expand Up @@ -712,7 +712,7 @@ public function testShouldDoLoginThrottlingDelay()
->passthru();

$config->shouldReceive('get')
->twice()->with('confide::throttle_limit')
->twice()->with('confide.throttle_limit')
->andReturn(19);

$loginThrottler->shouldReceive('throttleIdentity')
Expand Down Expand Up @@ -961,17 +961,17 @@ public function testShouldMakeViews()
$app->shouldReceive('make')->with('view')->times(4)->andReturn($view);

$view->shouldReceive('make')
->once()->with('view.confide::login_form')
->once()->with('view.confide.login_form')
->andReturn($view);
$view->shouldReceive('make')
->once()->with('view.confide::signup_form')
->once()->with('view.confide.signup_form')
->andReturn($view);
$view->shouldReceive('make')
->once()->with('view.confide::forgot_password_form')
->once()->with('view.confide.forgot_password_form')
->andReturn($view);
$view->shouldReceive('make')
->once()->with(
'view.confide::reset_password_form',
'view.confide.reset_password_form',
['token'=>$token]
)
->andReturn($view);
Expand Down
6 changes: 3 additions & 3 deletions tests/Confide/EloquentPasswordServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,11 @@ public function testShouldSendEmail()
->andReturn('the-email-subject');

$config->shouldReceive('get')
->once()->with('confide::email_reset_password')
->once()->with('confide.email_reset_password')
->andReturn('view.name');

$config->shouldReceive('get')
->once()->with('confide::email_queue')
->once()->with('confide.email_queue')
->andReturn('sync');

/*
Expand Down Expand Up @@ -488,7 +488,7 @@ public function testShouldGetOldestValidDate()
->passthru();

$config->shouldReceive('get')
->once()->with('confide::confide.password_reset_expiration', 7)
->once()->with('confide.password_reset_expiration', 7)
->andReturn(14);

$carbon->shouldReceive('now')
Expand Down