Ejemplo n.º 1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function getEdit($id)
 {
     $roles = Role::all()->lists('display_name', 'id');
     $offices = Office::all()->lists('name', 'id');
     $user = User::with('roles.perms')->findOrFail($id);
     return view('admin.users.edit_user', compact('user', 'roles', 'offices'));
 }
Ejemplo n.º 2
0
        }
    }
    return redirect('admin');
});
// Helper routes
/**
*Image manipulation
*/
Route::get('img/{path}', function (League\Glide\Server $server, \Illuminate\Http\Request $request) {
    $server->outputImage($request);
})->where('path', '.*');
/**
*
*/
Route::get('roles', function () {
    return \App\C21\Users\Acl\Role::all();
});
/**
*
*/
Route::get('permissions', function () {
    return \App\C21\Users\Acl\Permission::all();
});
/**
*
*/
Route::get('phpinfo', function () {
    phpinfo();
});
Route::get('admin/pdf', 'TestController@pdf');
Route::get('mail/test', function () {
Ejemplo n.º 3
0
 public function run()
 {
     DB::table('roles')->truncate();
     DB::table('role_user')->truncate();
     DB::table('permissions')->truncate();
     DB::table('permission_role')->truncate();
     $roles = [['name' => 'admin', 'display_name' => 'Site Administrator', 'description' => ''], ['name' => 'company_admin', 'display_name' => 'Company Administrator', 'description' => ''], ['name' => 'lead_router_admin', 'display_name' => 'LeadRouter Admin', 'description' => ''], ['name' => 'manager', 'display_name' => 'Office Manager', 'description' => ''], ['name' => 'recruiter', 'display_name' => 'LeadRouter Admin', 'description' => '']];
     $permissions = [['name' => 'can_view_dashboard', 'display_name' => 'View Admin Dashboard', 'description' => 'User can view the admin dashboard'], ['name' => 'can_access_leadrouter', 'display_name' => 'Access LeadRouter', 'description' => 'Full Access to LeadRouter'], ['name' => 'can_access_recruiting', 'display_name' => 'Access Recruiting', 'description' => 'Full access to recruiting'], ['name' => 'can_access_reporting', 'display_name' => 'Can Access Reporting', 'description' => ''], ['name' => 'can_send_text', 'display_name' => 'Can Send Text Message', 'description' => ''], ['name' => 'can_manage_users', 'display_name' => 'Can Manage Users', 'description' => 'This is user can change user permissions and add/delete users.']];
     foreach ($roles as $role) {
         \App\C21\Users\Acl\Role::create($role);
     }
     foreach ($permissions as $permission) {
         \App\C21\Users\Acl\Permission::create($permission);
     }
     $admin = \App\C21\Users\Acl\Role::where('id', 1)->first();
     $admin->attachPermissions(array(1, 2, 3, 4, 5, 6));
     $manager = \App\C21\Users\Acl\Role::where('id', 4)->first();
     $manager->attachPermissions(array(3));
     $lead_Router = \App\C21\Users\Acl\Role::where('id', 3)->first();
     $lead_Router->attachPermissions(array(2));
     $recruiter = \App\C21\Users\Acl\Role::where('id', 5)->first();
     $recruiter->attachPermissions(array(1, 3, 4));
     $company_admin = \App\C21\Users\Acl\Role::where('id', 2)->first();
     $company_admin->attachPermissions(array(1, 2, 3, 4, 5));
     $user = User::find(1)->first();
     $user->attachRole(1);
     $phone = new \App\C21\Helpers\PhoneFormater();
     $importer = new RecruitImporter($phone);
     $importer->import();
 }