diff --git a/app/TeenQuotes/Auth/AuthServiceProvider.php b/app/TeenQuotes/Auth/AuthServiceProvider.php index 478cd1d1..c27838fd 100644 --- a/app/TeenQuotes/Auth/AuthServiceProvider.php +++ b/app/TeenQuotes/Auth/AuthServiceProvider.php @@ -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() @@ -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'); } /** @@ -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' ]; } -} \ No newline at end of file +} diff --git a/app/TeenQuotes/Auth/Controllers/AuthController.php b/app/TeenQuotes/Auth/Controllers/AuthController.php index 08fe50ed..dd32c2e1 100644 --- a/app/TeenQuotes/Auth/Controllers/AuthController.php +++ b/app/TeenQuotes/Auth/Controllers/AuthController.php @@ -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 @@ -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')); @@ -105,4 +105,4 @@ public function getLogout() return Redirect::route('home')->with('success', Lang::get('auth.logoutSuccessfull', compact('login'))); } -} \ No newline at end of file +} diff --git a/app/TeenQuotes/Users/Controllers/UsersController.php b/app/TeenQuotes/Users/Controllers/UsersController.php index 2ffcd23c..b9904ee8 100644 --- a/app/TeenQuotes/Users/Controllers/UsersController.php +++ b/app/TeenQuotes/Users/Controllers/UsersController.php @@ -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']])); } @@ -514,4 +514,4 @@ private function redirectToDeleteAccount($login) { return Redirect::to(URL::route('users.edit', $login)."#delete-account"); } -} \ No newline at end of file +} diff --git a/app/TeenQuotes/Users/UsersServiceProvider.php b/app/TeenQuotes/Users/UsersServiceProvider.php index c3acc841..0dc0d463 100644 --- a/app/TeenQuotes/Users/UsersServiceProvider.php +++ b/app/TeenQuotes/Users/UsersServiceProvider.php @@ -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'); }); } @@ -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 @@ -155,4 +172,4 @@ private function getController() { return 'UsersController'; } -} \ No newline at end of file +} diff --git a/app/config/app.php b/app/config/app.php index 6acbdb75..6350e9a4 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -33,6 +33,7 @@ 'domainAPI' => 'api.teen-quotes.com', 'domainStories' => 'stories.teen-quotes.com', 'domainAdmin' => 'admin.teen-quotes.com', + 'domainAccount' => 'account.teen-quotes.com', /* |-------------------------------------------------------------------------- @@ -284,4 +285,4 @@ 'search.maxResultsPerCategory' => 10, 'stories.nbStoriesPerPage' => 5, -); \ No newline at end of file +); diff --git a/app/config/local/app.php b/app/config/local/app.php index a8077ea9..4175f2ba 100644 --- a/app/config/local/app.php +++ b/app/config/local/app.php @@ -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( @@ -37,4 +38,4 @@ 'unix_socket' => '/tmp/mysql.sock', ), ), -); \ No newline at end of file +); diff --git a/app/config/staging/app.php b/app/config/staging/app.php index 684ee316..186afb7d 100644 --- a/app/config/staging/app.php +++ b/app/config/staging/app.php @@ -1,8 +1,9 @@ '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', -); \ No newline at end of file + 'domainAccount' => 'account.dev.teen-quotes.com', +]; diff --git a/gulpfile.js b/gulpfile.js index fe364d7a..8b131bc4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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) diff --git a/public/build/assets/js/scripts.min-c1f17760.js b/public/build/assets/js/scripts.min-5822e4e9.js similarity index 72% rename from public/build/assets/js/scripts.min-c1f17760.js rename to public/build/assets/js/scripts.min-5822e4e9.js index 26d3bdb5..a1211bee 100644 --- a/public/build/assets/js/scripts.min-c1f17760.js +++ b/public/build/assets/js/scripts.min-5822e4e9.js @@ -1,4 +1,5 @@ -function run_validator(t,e){if(t){if(t.length>512)return error_message="Stream exceeds maxiumum allowable length of 512.",void(e&&e.error?e.error(error_message):console.log(error_message));e&&e.in_progress&&e.in_progress(),e&&void 0==e.api_key&&console.log("Please pass in api_key to mailgun_validator.");var n=!1;$.ajax({type:"GET",url:"https://api.mailgun.net/v2/address/validate?callback=?",data:{address:t,api_key:e.api_key},dataType:"jsonp",crossDomain:!0,success:function(t){n=!0,e&&e.success&&e.success(t)},error:function(){n=!0,error_message="Error occurred, unable to validate address.",e&&e.error?e.error(error_message):console.log(error_message)}}),setTimeout(function(){error_message="Error occurred, unable to validate address.",n||(e&&e.error?e.error(error_message):console.log(error_message))},3e4)}}function doNothing(){}function validationSuccess(t){var e=t.did_you_mean,n=t.is_valid;$("#email-error").remove(),n?($("#respect-privacy").html(''+laravel.mailAddressValid),ga("send","event","signup","fill-email","valid-email")):e?($("#respect-privacy").html(laravel.didYouMean+""+e+"?"),ga("send","event","signup","fill-email","suggested-email")):($("#respect-privacy").html(''+laravel.mailAddressInvalid),ga("send","event","signup","fill-email","wrong-email"))}function hasFileUploadSupport(){var t,e=!0;try{t=document.createElement("input"),t.type="file",t.style.display="none",document.getElementsByTagName("body")[0].appendChild(t),t.disabled&&(e=!1)}catch(n){e=!1}finally{t&&t.parentNode.removeChild(t)}return ga("send","event","support-file-upload","browser-has-feature",e),e}function doneTypingLoginSignup(){if(timeoutLoginSignup){timeoutLoginSignup=null;var t="fa fa-thumbs-up";$.ajax({type:"post",cache:!1,crossDomain:!0,url:laravel.urlLoginValidator,dataType:"json",data:{login:$("input#login-signup").val()},success:function(e){e.success===!1?(t="fa fa-meh-o",$("#login-validator").html(""+e.message),$("#login-validator i.fa").removeClass("green").addClass("black"),$("#login-error").remove(),$("#login-validator").removeClass("green").addClass("orange").fadeIn(500),ga("send","event","signup","fill-login",{reason:"wrong-login",rule:e.failed})):($("#login-validator").html(""+e.message),$("#login-validator i.fa").removeClass("black").addClass("green"),$("#login-error").remove(),$("#login-validator").removeClass("orange").addClass("green").fadeIn(500),ga("send","event","signup","fill-login","right-login"))},error:function(t,e,n){console.log(t),console.log(e),console.log(n),console.log(t.responseText),alert("Something went to wrong. Please try again later.")}})}}function doneTypingLoginPassword(){timeoutPassword&&(timeoutPassword=null,$("#submit-form").removeClass("animated fadeInUp").addClass("animated shake"))}if(!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function n(t){var e=t.length,n=te.type(t);return"function"===n||te.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}function i(t,e,n){if(te.isFunction(e))return te.grep(t,function(t,i){return!!e.call(t,i,t)!==n});if(e.nodeType)return te.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(ae.test(e))return te.filter(e,t,n);e=te.filter(e,t)}return te.grep(t,function(t){return X.call(e,t)>=0!==n})}function o(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function r(t){var e=he[t]={};return te.each(t.match(pe)||[],function(t,n){e[n]=!0}),e}function s(){K.removeEventListener("DOMContentLoaded",s,!1),t.removeEventListener("load",s,!1),te.ready()}function a(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=te.expando+Math.random()}function l(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(xe,"-$1").toLowerCase(),n=t.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:be.test(n)?te.parseJSON(n):n}catch(o){}ye.set(t,e,n)}else n=void 0;return n}function u(){return!0}function c(){return!1}function d(){try{return K.activeElement}catch(t){}}function f(t,e){return te.nodeName(t,"table")&&te.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function p(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function h(t){var e=He.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function g(t,e){for(var n=0,i=t.length;i>n;n++)ve.set(t[n],"globalEval",!e||ve.get(e[n],"globalEval"))}function m(t,e){var n,i,o,r,s,a,l,u;if(1===e.nodeType){if(ve.hasData(t)&&(r=ve.access(t),s=ve.set(e,r),u=r.events)){delete s.handle,s.events={};for(o in u)for(n=0,i=u[o].length;i>n;n++)te.event.add(e,o,u[o][n])}ye.hasData(t)&&(a=ye.access(t),l=te.extend({},a),ye.set(e,l))}}function v(t,e){var n=t.getElementsByTagName?t.getElementsByTagName(e||"*"):t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&te.nodeName(t,e)?te.merge([t],n):n}function y(t,e){var n=e.nodeName.toLowerCase();"input"===n&&Te.test(t.type)?e.checked=t.checked:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}function b(e,n){var i=te(n.createElement(e)).appendTo(n.body),o=t.getDefaultComputedStyle?t.getDefaultComputedStyle(i[0]).display:te.css(i[0],"display");return i.detach(),o}function x(t){var e=K,n=We[t];return n||(n=b(t,e),"none"!==n&&n||(Me=(Me||te("