Skip to content

Commit

Permalink
Merge branch 'release/3.4.5' into v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineAugusti committed May 14, 2015
2 parents 4636881 + 7567714 commit d3a7cfb
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 31 deletions.
10 changes: 5 additions & 5 deletions app/TeenQuotes/Auth/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private function registerAuthViewComposers()
$this->app['view']->composer([
'auth.signin',
'auth.signup'
], 'TeenQuotes\Tools\Composers\DeepLinksComposer');
], 'TeenQuotes\Tools\Composers\DeepLinksComposer');
}

private function registerReminderRoutes()
Expand All @@ -78,11 +78,11 @@ private function registerReminderViewComposers()
$this->app['view']->composer([
'password.reset'
], $this->getNamespaceComposers().'ResetComposer');

// For deeps link
$this->app['view']->composer([
'password.remind'
], 'TeenQuotes\Tools\Composers\DeepLinksComposer');
], 'TeenQuotes\Tools\Composers\DeepLinksComposer');
}

/**
Expand All @@ -92,8 +92,8 @@ private function registerReminderViewComposers()
private function getRouteGroupParams()
{
return [
'domain' => $this->app['config']->get('app.domain'),
'domain' => $this->app['config']->get('app.domainAccount'),
'namespace' => 'TeenQuotes\Auth\Controllers'
];
}
}
}
6 changes: 3 additions & 3 deletions app/TeenQuotes/Auth/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function postSignin()
$user->last_visit = Carbon::now()->toDateTimeString();
$user->save();

return Redirect::intended('/')->with('success', Lang::get('auth.loginSuccessfull', ['login' => $data['login']]));
return Redirect::intended(route('home'))->with('success', Lang::get('auth.loginSuccessfull', ['login' => $data['login']]));
}
// Maybe the user uses the old hash method
else
Expand All @@ -86,7 +86,7 @@ public function postSignin()

Auth::login($user, true);

return Redirect::intended('/')->with('success', Lang::get('auth.loginSuccessfull', ['login' => $data['login']]));
return Redirect::intended(route('home'))->with('success', Lang::get('auth.loginSuccessfull', ['login' => $data['login']]));
}

return Redirect::route('signin')->withErrors(array('password' => Lang::get('auth.passwordInvalid')))->withInput(Input::except('password'));
Expand All @@ -105,4 +105,4 @@ public function getLogout()

return Redirect::route('home')->with('success', Lang::get('auth.logoutSuccessfull', compact('login')));
}
}
}
4 changes: 2 additions & 2 deletions app/TeenQuotes/Users/Controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function store()
Auth::login($response->getOriginalData());

if (Session::has('url.intended'))
return Redirect::intended('/')->with('success', Lang::get('auth.signupSuccessfull', ['login' => $data['login']]));
return Redirect::intended(route('home'))->with('success', Lang::get('auth.signupSuccessfull', ['login' => $data['login']]));

return Redirect::route('users.show', $data['login'])->with('success', Lang::get('auth.signupSuccessfull', ['login' => $data['login']]));
}
Expand Down Expand Up @@ -514,4 +514,4 @@ private function redirectToDeleteAccount($login)
{
return Redirect::to(URL::route('users.edit', $login)."#delete-account");
}
}
}
29 changes: 23 additions & 6 deletions app/TeenQuotes/Users/UsersServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,20 @@ private function registerRoutes()

$this->app['router']->group($this->getRouteGroupParams(), function() use ($controller)
{
$this->app['router']->delete('users', ['as' => 'users.delete', 'before' => 'auth', 'uses' => $controller.'@destroy']);
$this->app['router']->get("signup", ["as" => "signup", "before" => "guest", "uses" => $controller."@getSignup"]);
$this->app['router']->get('user-{user_id}', ['uses' => $controller.'@redirectOldUrl'])->where('user_id', '[0-9]+');
$this->app['router']->get('users/{user_id}/{display_type?}', ['as' => 'users.show', 'uses' => $controller.'@show']);
$this->app['router']->post('users/loginvalidator', ['as' => 'users.loginValidator', 'uses' => $controller.'@postLoginValidator']);
$this->app['router']->any('users/{wildcard}', $this->getController().'@notFound');
});

$this->app['router']->group($this->getRouteGroupParamsAccount(), function() use ($controller)
{
$this->app['router']->delete('users', ['as' => 'users.delete', 'before' => 'auth', 'uses' => $controller.'@destroy']);
$this->app['router']->get('signup', ['as' => 'signup', 'before' => 'guest', 'uses' => $controller.'@getSignup']);
$this->app['router']->resource('users', $controller, ['only' => ['store', 'edit', 'update']]);
$this->app['router']->put('users/{user_id}/password', ['as' => 'users.password', 'uses' => $controller.'@putPassword']);
$this->app['router']->put('users/{user_id}/avatar', ['as' => 'users.avatar', 'uses' => $controller.'@putAvatar']);
$this->app['router']->put('users/{user_id}/settings', ['as' => 'users.settings', 'uses' => $controller.'@putSettings']);
$this->app['router']->post('users/loginvalidator', ['as' => 'users.loginValidator', 'uses' => $controller.'@postLoginValidator']);
$this->app['router']->resource('users', $controller, ['only' => ['store', 'edit', 'update']]);
$this->app['router']->any('users/{wildcard}', $this->getController().'@notFound');
});
}

Expand Down Expand Up @@ -126,6 +130,19 @@ private function getRouteGroupParams()
];
}

/**
* Get parameters for the account section
* @return array
*/
private function getRouteGroupParamsAccount()
{
$data = $this->getRouteGroupParams();
// Switch to the secure domain
$data['domain'] = $this->app['config']->get('app.domainAccount');

return $data;
}

private function registerCommands()
{
// Send birthday
Expand Down Expand Up @@ -155,4 +172,4 @@ private function getController()
{
return 'UsersController';
}
}
}
3 changes: 2 additions & 1 deletion app/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
'domainAPI' => 'api.teen-quotes.com',
'domainStories' => 'stories.teen-quotes.com',
'domainAdmin' => 'admin.teen-quotes.com',
'domainAccount' => 'account.teen-quotes.com',

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -284,4 +285,4 @@
'search.maxResultsPerCategory' => 10,

'stories.nbStoriesPerPage' => 5,
);
);
9 changes: 5 additions & 4 deletions app/config/local/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
*/

'debug' => true,

'users.avatarPath' => 'public/uploads/avatar',

'url' => 'http://dev.tq:8000',
'domain' => 'dev.tq',

'domainAPI' => 'api.dev.tq',
'domainStories' => 'stories.dev.tq',
'domainAdmin' => 'admin.dev.tq',
'domainAccount' => 'account.dev.tq',

'connections' => array(
'mysql' => array(
Expand All @@ -37,4 +38,4 @@
'unix_socket' => '/tmp/mysql.sock',
),
),
);
);
5 changes: 3 additions & 2 deletions app/config/staging/app.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php
return array(
return [
'url' => 'http://dev.teen-quotes.com',
'domain' => 'dev.teen-quotes.com',
'domainAPI' => 'api.teen-quotes.com',
'domainStories' => 'stories.dev.teen-quotes.com',
'domainAdmin' => 'admin.dev.teen-quotes.com',
);
'domainAccount' => 'account.dev.teen-quotes.com',
];
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ elixir(function(mix) {
.scripts([
'jquery-2.1.0.min.js',
'bootstrap.min.js',
'wow.min.js',
'mailgun-validator.js',
'app.js'
], outputJS + 'scripts.min.js', inputJSDir)
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/build/rev-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"assets/css/styles.min.css": "assets/css/styles.min-7631e3f0.css",
"assets/js/scripts.min.js": "assets/js/scripts.min-c1f17760.js"
"assets/js/scripts.min.js": "assets/js/scripts.min-5822e4e9.js"
}
4 changes: 1 addition & 3 deletions ressources/js/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
window.laravel = window.laravel || {};
var timeoutLoginSignup, timeoutPassword;

$('html, body').hide();
new WOW().init();

$(document).ready(function() {

Expand Down Expand Up @@ -318,8 +318,6 @@ $(document).ready(function() {
$('html, body').scrollTop(0).show();
jump();
}, 0);
} else {
$('html, body').show();
}

// The "getting started" guide on the user's profile
Expand Down
2 changes: 2 additions & 0 deletions ressources/js/wow.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d3a7cfb

Please sign in to comment.