Saturday 15 September 2012

php - Laravel 4 - Dynamic Routing/Views -


I have a user login system that includes two steps:

  1. User login < Ol>
  2. Try to lock the user into AD (this is the LDAP certificate module)
  3. If the user can log in via AD, check that the user exists in the user table Or not
  4. If the user is not present in the user table, Add - Only "Username" and "Good Name"
    1. If users have been added, they will not be related to any team and notified to contact their manager to continue the account. Load the user column in Laravel session credentials - Now we have the AD login name, "Good" name (last first), selected Team ID, etc. There is no password because the user has been certified.
    2. Team selection - Table userTame pivot table.
    3. Root user for Team Dashboard

      Right now, I have this route:

        // This group user logs in Does the forces to; Auth () will check whether the user has selected a team and ensures that the team is present. Root :: Group (array '(first' = '' 'auth'), function () {// handle team - will be url / dashboard - team controller 'team user' table on team user table $ team user = php_sapi_name () == "cli" tap: @TeamUser :: Search (session :: find ('credentials.team'); if (empty ($ Team Users)) {$ team = ucfirst (strtolower ($ Team User- & Gt; teams () -> first () -> watch_name); root :: controller ('dashboard', 'team'. $ Team. 'Controller')}} // index root :: controller '/', 'Index controller');});   

      However, I do not think this is a very beautiful solution - mostly because I can not reverse routing this method.

      Any suggestions or suggestions?

      I personally want to put this argument in my own filter instead of the root group, because what you're doing They use just 'filtering' users for different routes depending on the variable (the same thing filters an athlete).

      Update

        Root :: Filters ('whatever', function () {$ teamUser = php_sapi_name () == "cli" ? Null: @TeamUser :: Search (Get Session :: Receive ('credentials.team')); If (empty ($ Team Users)) Redirect: route ('index controller');}); Root :: Group (array ('first' = & gt; 'auth | whatever', function) (root :: controller ('some controller'); root: controller ('/', 'index controller');} ));    

No comments:

Post a Comment