├── .env.example
├── .env.testing
├── .gitattributes
├── .gitignore
├── .travis.yml
├── app
├── Authentication
│ ├── AuthenticationServiceProvider.php
│ ├── Classes
│ │ ├── Captcha
│ │ │ ├── CaptchaValidator.php
│ │ │ ├── CaptchaValidatorInterface.php
│ │ │ └── GregWarCaptchaValidator.php
│ │ ├── CustomProfile
│ │ │ ├── Events
│ │ │ │ └── ProfilePermissionSubscriber.php
│ │ │ ├── Repository
│ │ │ │ └── CustomProfileRepository.php
│ │ │ └── customProfileFormHelper.php
│ │ ├── Images
│ │ │ └── ImageHelperTrait.php
│ │ ├── Menu
│ │ │ ├── MenuItemCollection.php
│ │ │ ├── SentryMenuFactory.php
│ │ │ └── SentryMenuItem.php
│ │ ├── SentryAuthenticator.php
│ │ └── Statistics
│ │ │ └── UserStatistics.php
│ ├── Commands
│ │ ├── CallWrapper.php
│ │ └── InstallCommand.php
│ ├── Composers
│ │ ├── dashboard.php
│ │ ├── menu.php
│ │ ├── others.php
│ │ ├── permissions.php
│ │ └── select_items.php
│ ├── Controllers
│ │ ├── AuthController.php
│ │ ├── Controller.php
│ │ ├── DashboardController.php
│ │ ├── GroupController.php
│ │ ├── PermissionController.php
│ │ └── UserController.php
│ ├── Events
│ │ └── EditableSubscriber.php
│ ├── Exceptions
│ │ ├── AuthenticationErrorException.php
│ │ ├── LoginRequiredException.php
│ │ ├── PermissionException.php
│ │ ├── ProfileNotFoundException.php
│ │ ├── TokenMismatchException.php
│ │ ├── UserExistsException.php
│ │ └── UserNotFoundException.php
│ ├── Helpers
│ │ ├── DbHelper.php
│ │ ├── FileRouteHelper.php
│ │ ├── FormHelper.php
│ │ └── SentryAuthenticationHelper.php
│ ├── Interfaces
│ │ ├── AuthenticateInterface.php
│ │ ├── AuthenticationHelperInterface.php
│ │ ├── AuthenticationRoutesInterface.php
│ │ ├── MenuCollectionInterface.php
│ │ ├── MenuInterface.php
│ │ └── PermissionProfileHelperInterface.php
│ ├── Middleware
│ │ ├── Config.php
│ │ ├── Interfaces
│ │ │ └── ConfigRepositoryInterface.php
│ │ └── Models
│ │ │ └── Config.php
│ ├── Models
│ │ ├── BaseModel.php
│ │ ├── Group.php
│ │ ├── Permission.php
│ │ ├── ProfileField.php
│ │ ├── ProfileFieldType.php
│ │ ├── User.php
│ │ └── UserProfile.php
│ ├── Presenters
│ │ ├── GroupPresenter.php
│ │ ├── Traits
│ │ │ └── PermissionTrait.php
│ │ ├── UserPresenter.php
│ │ └── UserProfilePresenter.php
│ ├── Repository
│ │ ├── EloquentPermissionRepository.php
│ │ ├── EloquentUserProfileRepository.php
│ │ ├── Interfaces
│ │ │ ├── UserProfileRepositoryInterface.php
│ │ │ └── UserRepositoryInterface.php
│ │ ├── SentryGroupRepository.php
│ │ ├── SentryUserRepository.php
│ │ └── UserRepositorySearchFilter.php
│ ├── Services
│ │ ├── ReminderService.php
│ │ ├── UserProfileService.php
│ │ └── UserRegisterService.php
│ ├── Validators
│ │ ├── GroupValidator.php
│ │ ├── PermissionValidator.php
│ │ ├── ReminderValidator.php
│ │ ├── UserProfileAvatarValidator.php
│ │ ├── UserProfileUserValidator.php
│ │ ├── UserProfileValidator.php
│ │ ├── UserSignupEmailValidator.php
│ │ ├── UserSignupValidator.php
│ │ └── UserValidator.php
│ ├── bootstrap.php
│ ├── composers.php
│ ├── subscribers.php
│ └── validators.php
├── Console
│ ├── Commands
│ │ └── Inspire.php
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
├── Http
│ ├── Kernel.php
│ ├── Middleware
│ │ ├── AdminLogged.php
│ │ ├── Ajax.php
│ │ ├── CanSee.php
│ │ ├── EncryptCookies.php
│ │ ├── HasPerm.php
│ │ └── VerifyCsrfToken.php
│ ├── Requests
│ │ └── Request.php
│ └── routes.php
├── Library
│ ├── Email
│ │ ├── MailerInterface.php
│ │ └── SwiftMailer.php
│ ├── Exceptions
│ │ ├── InvalidException.php
│ │ ├── JacopoExceptionsInterface.php
│ │ ├── MailException.php
│ │ ├── NotFoundException.php
│ │ └── ValidationException.php
│ ├── Form
│ │ ├── FormInterface.php
│ │ └── FormModel.php
│ ├── LibraryServiceProvider.php
│ ├── Presenters
│ │ ├── AbstractPresenter.php
│ │ ├── PresenterCollection.php
│ │ └── PresenterPagination.php
│ ├── Repository
│ │ ├── EloquentBaseRepository.php
│ │ └── Interfaces
│ │ │ └── BaseRepositoryInterface.php
│ ├── Validators
│ │ ├── AbstractValidator.php
│ │ └── ValidatorInterface.php
│ └── Views
│ │ └── Helper.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BroadcastServiceProvide.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
└── User.php
├── artisan
├── bootstrap
├── app.php
├── autoload.php
└── cache
│ └── .gitignore
├── composer.json
├── config
├── acl_base.php
├── acl_menu.php
├── acl_messages.php
├── acl_permissions.php
├── acl_sentry.php
├── app.php
├── auth.php
├── cache.php
├── cartalyst.sentry.php
├── compile.php
├── database.php
├── filesystems.php
├── image.php
├── mail.php
├── queue.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── migrations
│ ├── .gitkeep
│ ├── 2012_12_06_225988_migration_cartalyst_sentry_install_throttle.php
│ ├── 2014_02_19_095545_create_users_table.php
│ ├── 2014_02_19_095623_create_user_groups_table.php
│ ├── 2014_02_19_095637_create_groups_table.php
│ ├── 2014_02_19_160516_create_permission_table.php
│ ├── 2014_02_26_165011_create_user_profile_table.php
│ ├── 2014_05_06_122145_create_profile_field_types.php
│ ├── 2014_05_06_122155_create_profile_field.php
│ └── 2014_10_12_100000_create_password_resets_table.php
└── seeds
│ ├── .gitkeep
│ └── DatabaseSeeder.php
├── docs
├── images
│ ├── add_user.png
│ ├── admin_main.png
│ ├── dashboard.png
│ ├── edit_profile.png
│ ├── login.png
│ └── signup.png
└── index.md
├── gulpfile.js
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── favicon.ico
├── index.php
├── packages
│ └── jacopo
│ │ └── laravel-authentication-acl
│ │ ├── css
│ │ ├── baselayout.css
│ │ ├── bootstrap.min.css
│ │ ├── fonts.css
│ │ ├── landing-page.css
│ │ ├── mail-base.css
│ │ ├── strength.css
│ │ └── style.css
│ │ ├── fonts
│ │ ├── Bariol_Bold.otf
│ │ ├── Bariol_Light.otf
│ │ ├── Bariol_Thin.otf
│ │ ├── bariol-fonts-license.txt
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ └── glyphicons-halflings-regular.woff
│ │ ├── images
│ │ └── avatar.png
│ │ └── js
│ │ ├── custom-ordering.js
│ │ └── vendor
│ │ ├── bootstrap.min.js
│ │ ├── jquery-1.10.2.min.js
│ │ ├── password_strength
│ │ └── strength.js
│ │ └── slugit.js
└── robots.txt
├── readme.md
├── resources
├── assets
│ └── less
│ │ ├── app.less
│ │ └── bootstrap
│ │ ├── alerts.less
│ │ ├── badges.less
│ │ ├── bootstrap.less
│ │ ├── breadcrumbs.less
│ │ ├── button-groups.less
│ │ ├── buttons.less
│ │ ├── carousel.less
│ │ ├── close.less
│ │ ├── code.less
│ │ ├── component-animations.less
│ │ ├── dropdowns.less
│ │ ├── forms.less
│ │ ├── glyphicons.less
│ │ ├── grid.less
│ │ ├── input-groups.less
│ │ ├── jumbotron.less
│ │ ├── labels.less
│ │ ├── list-group.less
│ │ ├── media.less
│ │ ├── mixins.less
│ │ ├── mixins
│ │ ├── alerts.less
│ │ ├── background-variant.less
│ │ ├── border-radius.less
│ │ ├── buttons.less
│ │ ├── center-block.less
│ │ ├── clearfix.less
│ │ ├── forms.less
│ │ ├── gradients.less
│ │ ├── grid-framework.less
│ │ ├── grid.less
│ │ ├── hide-text.less
│ │ ├── image.less
│ │ ├── labels.less
│ │ ├── list-group.less
│ │ ├── nav-divider.less
│ │ ├── nav-vertical-align.less
│ │ ├── opacity.less
│ │ ├── pagination.less
│ │ ├── panels.less
│ │ ├── progress-bar.less
│ │ ├── reset-filter.less
│ │ ├── resize.less
│ │ ├── responsive-visibility.less
│ │ ├── size.less
│ │ ├── tab-focus.less
│ │ ├── table-row.less
│ │ ├── text-emphasis.less
│ │ ├── text-overflow.less
│ │ └── vendor-prefixes.less
│ │ ├── modals.less
│ │ ├── navbar.less
│ │ ├── navs.less
│ │ ├── normalize.less
│ │ ├── pager.less
│ │ ├── pagination.less
│ │ ├── panels.less
│ │ ├── popovers.less
│ │ ├── print.less
│ │ ├── progress-bars.less
│ │ ├── responsive-embed.less
│ │ ├── responsive-utilities.less
│ │ ├── scaffolding.less
│ │ ├── tables.less
│ │ ├── theme.less
│ │ ├── thumbnails.less
│ │ ├── tooltip.less
│ │ ├── type.less
│ │ ├── utilities.less
│ │ ├── variables.less
│ │ └── wells.less
├── lang
│ └── en
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
└── views
│ ├── admin
│ ├── auth
│ │ └── login.blade.php
│ ├── dashboard
│ │ └── default.blade.php
│ ├── group
│ │ ├── edit.blade.php
│ │ ├── groups-table.blade.php
│ │ ├── list.blade.php
│ │ ├── perm.blade.php
│ │ └── search.blade.php
│ ├── layouts
│ │ ├── base-1cols.blade.php
│ │ ├── base-2cols.blade.php
│ │ ├── base.blade.php
│ │ ├── baseauth.blade.php
│ │ ├── navbar.blade.php
│ │ ├── partials
│ │ │ └── avatar.blade.php
│ │ └── sidebar.blade.php
│ ├── mail
│ │ ├── registration-activated-client.blade.php
│ │ ├── registration-confirmed-client.blade.php
│ │ ├── registration-waiting-client.blade.php
│ │ └── reminder.blade.php
│ ├── permission
│ │ ├── edit.blade.php
│ │ ├── list.blade.php
│ │ └── permission-table.blade.php
│ └── user
│ │ ├── custom-profile.blade.php
│ │ ├── edit.blade.php
│ │ ├── groups.blade.php
│ │ ├── list.blade.php
│ │ ├── partials
│ │ ├── avatar_upload.blade.php
│ │ ├── show_gravatar.blade.php
│ │ └── sorting.blade.php
│ │ ├── perm.blade.php
│ │ ├── profile.blade.php
│ │ ├── search.blade.php
│ │ ├── self-profile.blade.php
│ │ └── user-table.blade.php
│ └── client
│ ├── auth
│ ├── captcha-image.blade.php
│ ├── change-password-success.blade.php
│ ├── changepassword.blade.php
│ ├── email-confirmation.blade.php
│ ├── login.blade.php
│ ├── reminder-success.blade.php
│ ├── reminder.blade.php
│ ├── signup-email-confirmation.blade.php
│ ├── signup-success.blade.php
│ └── signup.blade.php
│ ├── exceptions
│ ├── 401.blade.php
│ ├── 404.blade.php
│ └── 500.blade.php
│ └── layouts
│ ├── base-fullscreen.blade.php
│ └── base.blade.php
├── server.php
├── storage
├── .gitignore
├── app
│ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
└── tests
├── .gitkeep
└── unit
├── AuthControllerTest.php
├── CallWrapperTest.php
├── CaptchaValidatorTest.php
├── ClientLoggedFilterTest.php
├── CustomProfileRepositoryTest.php
├── DashboardControllerTest.php
├── DbHelperTest.php
├── DbSeederTest.php
├── DbTestCase.php
├── EditableSubscriberTest.php
├── EloquentPermissionRepositoryTest.php
├── EloquentUserProfileRepositoryTest.php
├── FileRouteHelperTest.php
├── FormHelperTest.php
├── FormModelTest.php
├── GregWarCaptchaValidatorTest.php
├── GroupPresenterTest.php
├── HasPermFilterTest.php
├── InstallCommandTest.php
├── MenuItemCollectionTest.php
├── ProfilePermissionSubscriberTest.php
├── ReminderServiceTest.php
├── SentryAuthenticationHelperTest.php
├── SentryAuthenticatorTest.php
├── SentryGroupRepositoryTest.php
├── SentryMenuFactoryTest.php
├── SentryUserRepositoryTest.php
├── Stubs
├── NullLogger.php
├── VoidRepository.php
└── VoidValidator.php
├── TestCase.php
├── Traits
├── AuthHelper.php
├── HourHelper.php
├── MailTracking.php
└── UserFactory.php
├── UserControllerTest.php
├── UserProfilePresenterTest.php
├── UserProfileServiceTest.php
├── UserProfileTest.php
├── UserRegisterServiceTest.php
├── UserRepositorySearchFilterTest.php
├── UserSignupEmailValidatorTest.php
├── UserSignupValidatorTest.php
├── UserStatisticsTest.php
└── Validators
└── UserValidatorTest.php
/.env.example:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/.env.example
--------------------------------------------------------------------------------
/.env.testing:
--------------------------------------------------------------------------------
1 | EMAIL_DRIVER=log
2 | APP_KEY=base64:Ctm7ecWQR5tquhaoNy0aZ1z9fRXRsCWXeRwGfDA3li0=
3 |
4 | # database
5 | DB_DEFAULT=sqlite
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor
2 | /node_modules
3 | .env
4 | composer.lock
5 | .idea
6 | TODO.md
7 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 |
3 | php:
4 | - 5.6
5 | - 7.0
6 | - 7.1
7 |
8 | before_script:
9 | - curl -s http://getcomposer.org/installer | php
10 | - php composer.phar install --dev
11 | - php composer.phar dump-autoload
12 |
13 | script: phpunit
14 |
15 |
--------------------------------------------------------------------------------
/app/Authentication/Classes/Captcha/CaptchaValidator.php:
--------------------------------------------------------------------------------
1 | getValue();
14 | }
15 |
16 | /**
17 | * @return mixed
18 | */
19 | public function getErrorMessage()
20 | {
21 | return $this->error_message;
22 | }
23 |
24 | abstract public function getValue();
25 |
26 | abstract public function getImageSrcTag();
27 | }
--------------------------------------------------------------------------------
/app/Authentication/Classes/Captcha/CaptchaValidatorInterface.php:
--------------------------------------------------------------------------------
1 | captcha_field = 'authentication_captcha_value'; }
19 |
20 | public static function getInstance()
21 | {
22 | if(static::$captcha_builder) return static::$captcha_builder;
23 |
24 | return static::newInstance();
25 | }
26 |
27 | public static function getCaptchaBuilder()
28 | {
29 | return static::$captcha_builder;
30 | }
31 |
32 | /**
33 | * @param mixed $captcha_builder
34 | */
35 | public static function setCaptchaBuilder($captcha_builder)
36 | {
37 | self::$captcha_builder = $captcha_builder;
38 | }
39 |
40 | protected static function newInstance()
41 | {
42 | static::$captcha_builder = new CaptchaBuilder();
43 | static::buildCaptcha();
44 |
45 | return static::$captcha_builder;
46 | }
47 |
48 | protected static function buildCaptcha()
49 | {
50 | static::getInstance()->build(static::$captcha_width, static::$captcha_height);
51 | }
52 |
53 | public function getValue()
54 | {
55 | return Session::get($this->captcha_field);
56 | }
57 |
58 | public function getImageSrcTag()
59 | {
60 | $captcha_builder = static::getInstance();
61 | $this->saveCaptchaValue($captcha_builder);
62 |
63 | return $captcha_builder->inline();
64 | }
65 |
66 | /**
67 | * @param $captcha_builder
68 | */
69 | protected function saveCaptchaValue($captcha_builder)
70 | {
71 | Session::put($this->captcha_field, $captcha_builder->getPhrase());
72 | }
73 | }
--------------------------------------------------------------------------------
/app/Authentication/Classes/CustomProfile/Events/ProfilePermissionSubscriber.php:
--------------------------------------------------------------------------------
1 | checkCustomProfileEditPermission() ) throw new PermissionException($this->permission_error_message);
21 | }
22 |
23 | /**
24 | * Register the various event to the subscriber
25 | *
26 | * @param \Illuminate\Events\Dispatcher $events
27 | * @return array
28 | */
29 | public function subscribe($events)
30 | {
31 | $events->listen('customprofile.creating', 'LaravelAcl\Authentication\Classes\CustomProfile\Events\ProfilePermissionSubscriber@checkProfileTypePermission');
32 | $events->listen('customprofile.deleting', 'LaravelAcl\Authentication\Classes\CustomProfile\Events\ProfilePermissionSubscriber@checkProfileTypePermission');
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/app/Authentication/Classes/CustomProfile/customProfileFormHelper.php:
--------------------------------------------------------------------------------
1 | custom_profile_repository = $custom_profile ? $custom_profile : new CustomProfileRepository();
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/app/Authentication/Classes/Images/ImageHelperTrait.php:
--------------------------------------------------------------------------------
1 | getRealPath();
19 | }
20 | else
21 | {
22 | throw new NotFoundException('File non found.');
23 | }
24 | }
25 |
26 | /**
27 | * Fetch an image given a path
28 | */
29 | public static function getBinaryData($size = 170, $input_name)
30 | {
31 | return Image::make(static::getPathFromInput($input_name))->fit($size)->encode();
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/app/Authentication/Classes/Menu/MenuItemCollection.php:
--------------------------------------------------------------------------------
1 | items = $items;
17 | }
18 |
19 | public function getItemList()
20 | {
21 | return $this->items;
22 | }
23 |
24 | /**
25 | * Obtain the menu items that the current user can access
26 | *
27 | * @return array
28 | */
29 | public function getItemListAvailable()
30 | {
31 | $valid_items = [];
32 | foreach ($this->items as $item)
33 | if($item->havePermission())
34 | $valid_items[] = $item;
35 |
36 | return $valid_items;
37 | }
38 |
39 | }
--------------------------------------------------------------------------------
/app/Authentication/Classes/Menu/SentryMenuFactory.php:
--------------------------------------------------------------------------------
1 | user_repository = App::make('user_repository');
15 | }
16 |
17 | public function getRegisteredUserNumber()
18 | {
19 | return $this->user_repository->all()->count();
20 | }
21 |
22 | public function getActiveUserNumber()
23 | {
24 | return $this->user_repository->all(["activated" => 1])->count();
25 | }
26 |
27 | public function getPendingUserNumber()
28 | {
29 | return $this->user_repository->all(["activated" => 0])->count();
30 | }
31 |
32 | public function getBannedUserNumber()
33 | {
34 | return $this->user_repository->all(["banned" => 1])->count();
35 | }
36 | }
--------------------------------------------------------------------------------
/app/Authentication/Commands/CallWrapper.php:
--------------------------------------------------------------------------------
1 | wrapped_obj = $wrapped_obj;
10 | }
11 |
12 | public function __call($name, $params)
13 | {
14 | return call_user_func_array([$this->wrapped_obj, $name], $params);
15 | }
16 | }
--------------------------------------------------------------------------------
/app/Authentication/Commands/InstallCommand.php:
--------------------------------------------------------------------------------
1 | call_wrapper = $call_wrapper ? $call_wrapper : new CallWrapper($this);
32 | $this->db_seeder = $db_seeder ? $db_seeder : new DatabaseSeeder();
33 | parent::__construct();
34 | }
35 |
36 | /**
37 | * Execute the console command.
38 | *
39 | * @return mixed
40 | */
41 | public function fire()
42 | {
43 | $this->call_wrapper->call('vendor:publish', ['force']);
44 |
45 | $this->call_wrapper->call('migrate');
46 | $this->db_seeder->run();
47 |
48 | $this->info('## Laravel Authentication ACL Installed successfully ##');
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/Authentication/Composers/dashboard.php:
--------------------------------------------------------------------------------
1 | getRegisteredUserNumber();
9 | $active = $user_statistics->getActiveUserNumber();
10 | $pending = $user_statistics->getPendingUserNumber();
11 | $banned = $user_statistics->getBannedUserNumber();
12 |
13 | $view->with(['registered' => $registered,"active" => $active,"pending" => $pending,"banned" => $banned]);
14 | });
--------------------------------------------------------------------------------
/app/Authentication/Composers/others.php:
--------------------------------------------------------------------------------
1 | with('app_name', Config::get('acl_app_name'));
8 | });
9 |
10 | /**
11 | * the logged user
12 | */
13 | View::composer('laravel-authentication-acl::*', function ($view)
14 | {
15 | $view->with('logged_user', App::make('authenticator')->getLoggedUser());
16 | });
17 |
18 | /**
19 | * if the site uses gravatar for avatar handling
20 | */
21 | View::composer(['laravel-authentication-acl::admin.user.profile', 'laravel-authentication-acl::admin.user.self-profile'], function ($view)
22 | {
23 | $view->with('use_gravatar', \Config::get('acl_config.use_gravatar'));
24 | });
--------------------------------------------------------------------------------
/app/Authentication/Composers/permissions.php:
--------------------------------------------------------------------------------
1 | checkCustomProfileEditPermission() ? true : false;
8 |
9 | $view->with(['can_add_fields' => $can_add_fields]);
10 | });
--------------------------------------------------------------------------------
/app/Authentication/Composers/select_items.php:
--------------------------------------------------------------------------------
1 | getSelectValuesPermission();
10 | $view->with('permission_values', $values_permission);
11 | });
12 | /**
13 | * group select
14 | */
15 | View::composer(['laravel-authentication-acl::admin.user.edit', 'laravel-authentication-acl::admin.group.edit',
16 | 'laravel-authentication-acl::admin.user.search'], function ($view)
17 | {
18 | $fh = new FormHelper();
19 | $values_group = $fh->getSelectValuesGroups();
20 | $view->with('group_values', $values_group);
21 | });
--------------------------------------------------------------------------------
/app/Authentication/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | {$this->editable_field} == true) throw new PermissionException;
19 | }
20 |
21 | /**
22 | * Register the various event to the subscriber
23 | *
24 | * @param \Illuminate\Events\Dispatcher $events
25 | * @return array
26 | */
27 | public function subscribe($events)
28 | {
29 | $events->listen('repository.deleting', 'LaravelAcl\Authentication\Events\EditableSubscriber@isEditable',10);
30 | $events->listen('repository.updating', 'LaravelAcl\Authentication\Events\EditableSubscriber@isEditable',10);
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/app/Authentication/Exceptions/AuthenticationErrorException.php:
--------------------------------------------------------------------------------
1 | repository_permission = $rp ? $rp : new PermissionRepository();
25 | $this->repository_groups = $rg ? $rg : new SentryGroupRepository();
26 | }
27 |
28 | public function getSelectValues($repo_name, $key_value, $value_value)
29 | {
30 | $all_objects = $this->{$repo_name}->all();
31 |
32 | if($all_objects->isEmpty()) return [];
33 |
34 | foreach($all_objects as $object) $array_values[$object->{$key_value}] = $object->{$value_value};
35 |
36 | return $array_values;
37 | }
38 |
39 | public function getSelectValuesPermission()
40 | {
41 | return $this->getSelectValues("repository_permission", 'permission', 'description');
42 | }
43 |
44 | public function getSelectValuesGroups()
45 | {
46 | return $this->getSelectValues("repository_groups", 'id', 'name');
47 | }
48 |
49 | /**
50 | * Prepares permission for sentry given the input
51 | *
52 | * @param array $input
53 | * @param $operation
54 | * @param $field_name
55 | * @return void
56 | */
57 | public function prepareSentryPermissionInput(array &$input, $operation, $field_name = "permissions")
58 | {
59 | $input[$field_name] = isset($input[$field_name]) ? [$input[$field_name] => $operation] : '';
60 | }
61 | }
--------------------------------------------------------------------------------
/app/Authentication/Interfaces/AuthenticateInterface.php:
--------------------------------------------------------------------------------
1 | "user_email", "password" => "user_password"]
9 | * @param boolean $remember
10 | * @return mixed
11 | */
12 | public function authenticate(array $credentials, $remember);
13 |
14 | /**
15 | * @param $user
16 | * @param $remember
17 | * @return mixed
18 | */
19 | public function loginById($id, $remember);
20 |
21 | /**
22 | * Logout
23 | *
24 | * @return mixed
25 | */
26 | public function logout();
27 |
28 | /**
29 | * @return mixed
30 | */
31 | public function getErrors();
32 |
33 | /**
34 | * Obtain the user with his email
35 | *
36 | * @param $email
37 | * @return mixed
38 | * @throws \LaravelAcl\Authentication\Exceptions\UserNotFoundException
39 | * @return mixed
40 | */
41 | public function getUser($email);
42 |
43 | /**
44 | * Gets the user activaction token
45 | *
46 | * @param $email
47 | * @return String
48 | */
49 | public function getActivationToken($email);
50 |
51 | /**
52 | * Obtains a user given his user id
53 | *
54 | * @param $id
55 | * @return mixed
56 | */
57 | public function getUserById($id);
58 |
59 | /**
60 | * Obtain the current logged user
61 | *
62 | * @return mixed
63 | */
64 | public function getLoggedUser();
65 |
66 | }
--------------------------------------------------------------------------------
/app/Authentication/Interfaces/AuthenticationHelperInterface.php:
--------------------------------------------------------------------------------
1 | attributes["permission"] = ($value[0] != "_") ? "_{$value}" : $value;
24 | }
25 | }
--------------------------------------------------------------------------------
/app/Authentication/Models/ProfileField.php:
--------------------------------------------------------------------------------
1 | belongsTo('LaravelAcl\Authentication\Models\ProfileFieldType','profile_field_type_id');
17 | }
18 |
19 | public function user_profile()
20 | {
21 | return $this->belongsTo('LaravelAcl\Authentication\Models\UserProfile','user_profile_id');
22 | }
23 | }
--------------------------------------------------------------------------------
/app/Authentication/Models/ProfileFieldType.php:
--------------------------------------------------------------------------------
1 | hasMany('LaravelAcl\Authentication\Models\ProfileField');
17 | }
18 | }
--------------------------------------------------------------------------------
/app/Authentication/Models/User.php:
--------------------------------------------------------------------------------
1 | {static::$loginAttribute})
28 | {
29 | throw new LoginRequiredException("A login is required for a user, none given.");
30 | }
31 |
32 | // Check if the user already exists
33 | $query = $this->newQuery();
34 | $persistedUser = $query->where($this->getLoginName(), '=', $login)->first();
35 |
36 | if ($persistedUser and $persistedUser->getId() != $this->getId())
37 | {
38 | throw new UserExistsException("A user already exists with login [$login], logins must be unique for users.");
39 | }
40 |
41 | return true;
42 | }
43 |
44 | public function user_profile()
45 | {
46 | return $this->hasMany('LaravelAcl\Authentication\Models\UserProfile');
47 | }
48 | }
--------------------------------------------------------------------------------
/app/Authentication/Models/UserProfile.php:
--------------------------------------------------------------------------------
1 | belongsTo('LaravelAcl\Authentication\Models\User', "user_id");
35 | }
36 |
37 | public function profile_field()
38 | {
39 | return $this->hasMany('LaravelAcl\Authentication\Models\ProfileField');
40 | }
41 |
42 | public function getAvatarAttribute()
43 | {
44 | return isset($this->attributes['avatar']) ? base64_encode($this->attributes['avatar']) : null;
45 | }
46 |
47 | public function presenter()
48 | {
49 | return new UserProfilePresenter($this);
50 | }
51 | }
--------------------------------------------------------------------------------
/app/Authentication/Presenters/GroupPresenter.php:
--------------------------------------------------------------------------------
1 | resource->permissions;
21 | if(! empty($permissions) ) foreach ($permissions as $permission => $status)
22 | {
23 | $objs[] = (! $model::wherePermission($permission)->get()->isEmpty()) ? $model::wherePermission($permission)->first() : null;
24 | }
25 | return $objs;
26 | }
27 | }
--------------------------------------------------------------------------------
/app/Authentication/Presenters/UserPresenter.php:
--------------------------------------------------------------------------------
1 | default_avatar = Config::get('acl_base.default_avatar_path');
19 | return parent::__construct($resource);
20 | }
21 |
22 | public function custom_avatar()
23 | {
24 | if(! $this->resource->avatar) return $this->default_avatar;
25 |
26 | return $this->getBase64ImageSrcHeader() .$this->resource->avatar;
27 | }
28 |
29 | /**
30 | * @return string
31 | */
32 | protected function getBase64ImageSrcHeader()
33 | {
34 | return "data:image/png;base64,";
35 | }
36 |
37 | public function gravatar($size = 30)
38 | {
39 | return "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $this->resource->user()->first()->email ) ) ) . "?s=" . $size;
40 |
41 | }
42 |
43 | public function avatar($size = 30)
44 | {
45 | $use_gravatar = Config::get('acl_base.use_gravatar');
46 |
47 | return $use_gravatar ? $this->gravatar($size) : $this->custom_avatar();
48 | }
49 |
50 |
51 |
52 | }
--------------------------------------------------------------------------------
/app/Authentication/Repository/Interfaces/UserProfileRepositoryInterface.php:
--------------------------------------------------------------------------------
1 | ["required"],
10 | );
11 |
12 | public function __construct()
13 | {
14 | Event::listen('validating', function($input)
15 | {
16 | static::$rules["name"][] = "unique:groups,name,{$input['id']}";
17 | });
18 | }
19 | }
--------------------------------------------------------------------------------
/app/Authentication/Validators/PermissionValidator.php:
--------------------------------------------------------------------------------
1 | ["required", "max:255"],
10 | "permission" => ["required", "max:255"],
11 | );
12 |
13 | public function __construct()
14 | {
15 | Event::listen('validating', function($input)
16 | {
17 | static::$rules["permission"][] = "unique:permission,permission,{$input['id']}";
18 | });
19 | }
20 | }
--------------------------------------------------------------------------------
/app/Authentication/Validators/ReminderValidator.php:
--------------------------------------------------------------------------------
1 | ["required", "min:6"],
9 | );
10 | }
--------------------------------------------------------------------------------
/app/Authentication/Validators/UserProfileAvatarValidator.php:
--------------------------------------------------------------------------------
1 | ['image','required', 'max:4000']
14 | ];
15 | }
--------------------------------------------------------------------------------
/app/Authentication/Validators/UserProfileUserValidator.php:
--------------------------------------------------------------------------------
1 | ["confirmed", "min:6"],
9 | );
10 | }
--------------------------------------------------------------------------------
/app/Authentication/Validators/UserProfileValidator.php:
--------------------------------------------------------------------------------
1 | "max:50",
10 | "last_name" => "max:50",
11 | "code" => "max:25",
12 | "phone" => "max:20",
13 | "vat" => "max:20",
14 | "state" => "max:20",
15 | "city" => "max:50",
16 | "country" => "max:50",
17 | "zip" => "max:20",
18 | "address" => "max:100",
19 | );
20 | }
--------------------------------------------------------------------------------
/app/Authentication/Validators/UserSignupEmailValidator.php:
--------------------------------------------------------------------------------
1 | findByLogin($value);
20 | }
21 | catch(UserNotFoundException $e)
22 | {
23 | return true;
24 | }
25 |
26 |
27 | if($user->activated)
28 | {
29 | return false;
30 | }
31 |
32 | // if email confirmation is disabled we dont send email again
33 | if(! Config::get('acl_base.email_confirmation') ) return false;
34 |
35 | // send email
36 |
37 | $this->resendConfirmationEmail();
38 | // set session message
39 | Session::flash('message', "We sent you again the mail confirmation. Please check your inbox.");
40 | return false;
41 | }
42 |
43 | /**
44 | */
45 | protected function resendConfirmationEmail()
46 | {
47 | $data = Request::all();
48 | $data['password'] = 'Cannot decipher password, please use password recovery after if it\'s needed.';
49 |
50 | App::make('register_service')->sendRegistrationMailToClient($data);
51 | }
52 | }
--------------------------------------------------------------------------------
/app/Authentication/Validators/UserSignupValidator.php:
--------------------------------------------------------------------------------
1 | "an user with that email already exists."
10 | ];
11 |
12 | protected static $rules = [
13 | "email" => ["required", "email", "mail_signup"],
14 | "password" => ["required", "min:6", "confirmed"],
15 | "first_name" => "max:255",
16 | "last_name" => "max:255",
17 | ];
18 |
19 | public function __construct()
20 | {
21 | $enable_captcha = Config::get('acl_base.captcha_signup');
22 | if($enable_captcha) $this->addCaptchaRule();
23 | }
24 |
25 | protected function addCaptchaRule()
26 | {
27 | static::$rules["captcha_text"] = "captcha";
28 | }
29 | }
--------------------------------------------------------------------------------
/app/Authentication/Validators/UserValidator.php:
--------------------------------------------------------------------------------
1 | ["required", "email"],
10 | "password" => ["confirmed"]
11 | ];
12 |
13 | public function __construct()
14 | {
15 | Event::listen('validating', function($input)
16 | {
17 | // check if the input comes form the correct form
18 | if(!isset($input['form_name']) || $input['form_name']!='user')
19 | return true;
20 |
21 | if(empty($input["id"]))
22 | {
23 | static::$rules["password"][] = "required";
24 | static::$rules["email"][] = "unique:users,email";
25 | }
26 | else
27 | {
28 | static::$rules["email"][] = "unique:users,email,{$input['id']}";
29 | }
30 | });
31 |
32 | // make unique keys for email and password
33 | static::$rules["email"] = array_unique(static::$rules["email"]);
34 | static::$rules["password"] = array_unique(static::$rules["password"]);
35 | }
36 |
37 | /**
38 | * User to reset static rules to default values
39 | */
40 | public static function resetStatic()
41 | {
42 | static::$rules = [
43 | "email" => ["required", "email"],
44 | "password" => ["confirmed"]
45 | ];
46 | }
47 | }
--------------------------------------------------------------------------------
/app/Authentication/bootstrap.php:
--------------------------------------------------------------------------------
1 | getErrorMessage() );
--------------------------------------------------------------------------------
/app/Console/Commands/Inspire.php:
--------------------------------------------------------------------------------
1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
26 | ->hourly();
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | [
24 | 'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
25 | 'Illuminate\Session\Middleware\StartSession',
26 | 'Illuminate\View\Middleware\ShareErrorsFromSession',
27 | 'LaravelAcl\Http\Middleware\VerifyCsrfToken',
28 | 'LaravelAcl\Http\Middleware\EncryptCookies',
29 | ],
30 | 'api' => [
31 | 'throttle:60,1',
32 | ],
33 | ];
34 |
35 | /**
36 | * The application's route middleware.
37 | *
38 | * @var array
39 | */
40 | protected $routeMiddleware = [
41 | // 5.2 laravel default middleware
42 | // 'auth' => \App\Http\Middleware\Authenticate::class,
43 | // 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
44 | // 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
45 | // 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
46 | 'admin_logged' => \LaravelAcl\Http\Middleware\AdminLogged::class,
47 | 'can_see' => \LaravelAcl\Http\Middleware\CanSee::class,
48 | 'has_perm' => \LaravelAcl\Http\Middleware\HasPerm::class,
49 | ];
50 | }
51 |
--------------------------------------------------------------------------------
/app/Http/Middleware/AdminLogged.php:
--------------------------------------------------------------------------------
1 | check()) return redirect($redirect_url);
15 |
16 | return $next($request);
17 | }
18 | }
--------------------------------------------------------------------------------
/app/Http/Middleware/Ajax.php:
--------------------------------------------------------------------------------
1 | hasPermForRoute(Route::currentRouteName())) App::abort('401');
17 |
18 | return $next($request);
19 | }
20 | }
--------------------------------------------------------------------------------
/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | hasPermission($permissions)) App::abort('401');
16 |
17 | return $next($request);
18 | }
19 | }
--------------------------------------------------------------------------------
/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 | send($template, ["body" => $body], function($message) use($to, $subject){
23 | $message->to($to)->subject($subject);
24 | });
25 | }
26 | catch( Swift_TransportException $e)
27 | {
28 | Log::error('Cannot send the email:'.$e->getMessage());
29 | return false;
30 | }
31 | catch( Swift_RfcComplianceException $e)
32 | {
33 | Log::error('Cannot send the email:'.$e->getMessage());
34 | return false;
35 | }
36 |
37 | return true;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Library/Exceptions/InvalidException.php:
--------------------------------------------------------------------------------
1 | bindMailer();
24 | $this->bindFormModel();
25 | }
26 |
27 | protected function bindMailer()
28 | {
29 | $this->app->bind('jmailer', function ()
30 | {
31 | return new SwiftMailer;
32 | });
33 | }
34 |
35 | protected function bindFormModel()
36 | {
37 | $this->app->bind('form_model', function ($app) {
38 | return new FormModel();
39 | });
40 | }
41 |
42 | /**
43 | * Register the service provider.
44 | *
45 | * @return void
46 | */
47 | public function register()
48 | {
49 | //
50 | }
51 |
52 | /**
53 | * Get the services provided by the provider.
54 | *
55 | * @return array
56 | */
57 | public function provides()
58 | {
59 | return array();
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/app/Library/Presenters/AbstractPresenter.php:
--------------------------------------------------------------------------------
1 | resource = $resource;
10 | }
11 |
12 | public function __get($name)
13 | {
14 | if (method_exists($this, $name))
15 | {
16 | return $this->{$name}();
17 | }
18 |
19 | return $this->resource->{$name};
20 | }
21 | }
--------------------------------------------------------------------------------
/app/Library/Presenters/PresenterCollection.php:
--------------------------------------------------------------------------------
1 | $resource)
10 | {
11 | $collection->put($key, new $presenter($resource));
12 | }
13 |
14 | $this->items = $collection->toArray();
15 | }
16 | }
--------------------------------------------------------------------------------
/app/Library/Presenters/PresenterPagination.php:
--------------------------------------------------------------------------------
1 | paginator = $paginator;
13 | $collection = new Collection();
14 | foreach($this->paginator as $key => $resource)
15 | {
16 | $collection->put($key, new $presenter($resource));
17 | }
18 |
19 | $this->items = $collection->toArray();
20 | }
21 |
22 | public function getLinks()
23 | {
24 | return $this->paginator->links();
25 | }
26 | }
--------------------------------------------------------------------------------
/app/Library/Repository/Interfaces/BaseRepositoryInterface.php:
--------------------------------------------------------------------------------
1 | fails())
27 | {
28 | $this->errors = $validator->messages();
29 |
30 | return false;
31 | }
32 |
33 | return true;
34 | }
35 |
36 | public function getErrors()
37 | {
38 | return $this->errors;
39 | }
40 |
41 | /**
42 | * @return array
43 | */
44 | public static function getRules()
45 | {
46 | return static::$rules;
47 | }
48 |
49 | }
--------------------------------------------------------------------------------
/app/Library/Validators/ValidatorInterface.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
17 | ];
18 |
19 | /**
20 | * Register any application authentication / authorization services.
21 | *
22 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate
23 | * @return void
24 | */
25 | public function boot(GateContract $gate)
26 | {
27 | $this->registerPolicies($gate);
28 |
29 | //
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvide.php:
--------------------------------------------------------------------------------
1 | id === (int) $userId;
24 | });
25 | }
26 | }
--------------------------------------------------------------------------------
/app/Providers/EventServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
17 | 'App\Listeners\EventListener',
18 | ],
19 | ];
20 |
21 | /**
22 | * Register any other events for your application.
23 | *
24 | * @param \Illuminate\Contracts\Events\Dispatcher $events
25 | * @return void
26 | */
27 | public function boot()
28 | {
29 | parent::boot();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | group(['namespace' => $this->namespace], function ($router) {
39 | require app_path('Http/routes.php');
40 | });
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/User.php:
--------------------------------------------------------------------------------
1 | make('Illuminate\Contracts\Console\Kernel');
32 |
33 | $status = $kernel->handle(
34 | $input = new Symfony\Component\Console\Input\ArgvInput,
35 | new Symfony\Component\Console\Output\ConsoleOutput
36 | );
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Shutdown The Application
41 | |--------------------------------------------------------------------------
42 | |
43 | | Once Artisan has finished running. We will fire off the shutdown events
44 | | so that any final work may be done by the application before we shut
45 | | down the process. This is the last thing to happen to the request.
46 | |
47 | */
48 |
49 | $kernel->terminate($input, $status);
50 |
51 | exit($status);
52 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | 'Illuminate\Contracts\Http\Kernel',
31 | 'LaravelAcl\Http\Kernel'
32 | );
33 |
34 | $app->singleton(
35 | 'Illuminate\Contracts\Console\Kernel',
36 | 'LaravelAcl\Console\Kernel'
37 | );
38 |
39 | $app->singleton(
40 | 'Illuminate\Contracts\Debug\ExceptionHandler',
41 | 'LaravelAcl\Exceptions\Handler'
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/bootstrap/autoload.php:
--------------------------------------------------------------------------------
1 | ["_superadmin", "_user-editor"],
15 | /*
16 | |--------------------------------------------------------------------------
17 | | Edit custom profile type permission
18 | |--------------------------------------------------------------------------
19 | |
20 | | List of 'permission name' needed to edit the custom profile types.
21 | |
22 | */
23 | "edit_custom_profile" => ["_superadmin", "_profile-editor"]
24 | ];
--------------------------------------------------------------------------------
/config/compile.php:
--------------------------------------------------------------------------------
1 | [
17 |
18 | realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'),
19 | realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'),
20 | realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'),
21 |
22 | ],
23 |
24 | /*
25 | |--------------------------------------------------------------------------
26 | | Compiled File Providers
27 | |--------------------------------------------------------------------------
28 | |
29 | | Here you may list service providers which define a "compiles" function
30 | | that returns additional files that should be compiled, providing an
31 | | easy way to get common files from any packages you are utilizing.
32 | |
33 | */
34 |
35 | 'providers' => [
36 | //
37 | ],
38 |
39 | ];
40 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | 'local',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Default Cloud Filesystem Disk
23 | |--------------------------------------------------------------------------
24 | |
25 | | Many applications store files both locally and in the cloud. For this
26 | | reason, you may specify a default "cloud" driver here. This driver
27 | | will be bound as the Cloud disk implementation in the container.
28 | |
29 | */
30 |
31 | 'cloud' => 's3',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Filesystem Disks
36 | |--------------------------------------------------------------------------
37 | |
38 | | Here you may configure as many filesystem "disks" as you wish, and you
39 | | may even configure multiple disks of the same driver. Defaults have
40 | | been setup for each driver as an example of the required options.
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path().'/app',
49 | ],
50 |
51 | 's3' => [
52 | 'driver' => 's3',
53 | 'key' => 'your-key',
54 | 'secret' => 'your-secret',
55 | 'region' => 'your-region',
56 | 'bucket' => 'your-bucket',
57 | ],
58 |
59 | 'rackspace' => [
60 | 'driver' => 'rackspace',
61 | 'username' => 'your-username',
62 | 'key' => 'your-key',
63 | 'container' => 'your-container',
64 | 'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
65 | 'region' => 'IAD',
66 | ],
67 |
68 | ],
69 |
70 | ];
71 |
--------------------------------------------------------------------------------
/config/image.php:
--------------------------------------------------------------------------------
1 | 'gd'
19 |
20 | );
21 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => '',
19 | 'secret' => '',
20 | ],
21 |
22 | 'mandrill' => [
23 | 'secret' => '',
24 | ],
25 |
26 | 'ses' => [
27 | 'key' => '',
28 | 'secret' => '',
29 | 'region' => 'us-east-1',
30 | ],
31 |
32 | 'stripe' => [
33 | 'model' => 'User',
34 | 'secret' => '',
35 | ],
36 |
37 | ];
38 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | realpath(base_path('resources/views'))
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => realpath(storage_path().'/framework/views'),
32 |
33 | ];
34 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/database/migrations/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/database/migrations/.gitkeep
--------------------------------------------------------------------------------
/database/migrations/2012_12_06_225988_migration_cartalyst_sentry_install_throttle.php:
--------------------------------------------------------------------------------
1 | increments('id');
35 | $table->integer('user_id')->unsigned()->nullable();
36 | $table->string('ip_address')->nullable();
37 | $table->integer('attempts')->default(0);
38 | $table->boolean('suspended')->default(0);
39 | $table->boolean('banned')->default(0);
40 | $table->timestamp('last_attempt_at')->nullable();
41 | $table->timestamp('suspended_at')->nullable();
42 | $table->timestamp('banned_at')->nullable();
43 |
44 | // We'll need to ensure that MySQL uses the InnoDB engine to
45 | // support the indexes, other engines aren't affected.
46 | $table->engine = 'InnoDB';
47 | $table->index('user_id');
48 | });
49 | }
50 |
51 | /**
52 | * Reverse the migrations.
53 | *
54 | * @return void
55 | */
56 | public function down()
57 | {
58 | Schema::drop('throttle');
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/database/migrations/2014_02_19_095545_create_users_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
19 | $table->string('email');
20 | $table->string('password');
21 | $table->text('permissions')->nullable();
22 | $table->boolean('activated')->default(0);
23 | $table->boolean('banned')->default(0);
24 | $table->string('activation_code')->nullable();
25 | $table->timestamp('activated_at')->nullable();
26 | $table->timestamp('last_login')->nullable();
27 | $table->string('persist_code')->nullable();
28 | $table->string('reset_password_code')->nullable();
29 | $table->boolean('protected')->default(0);
30 | $table->timestamps();
31 | // setup index
32 | $table->unique('email');
33 | $table->index('activation_code');
34 | $table->index('reset_password_code');
35 | });
36 | }
37 |
38 | /**
39 | * Reverse the migrations.
40 | *
41 | * @return void
42 | */
43 | public function down()
44 | {
45 |
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/database/migrations/2014_02_19_095623_create_user_groups_table.php:
--------------------------------------------------------------------------------
1 | integer('user_id')->unsigned();
19 | $table->integer('group_id')->unsigned();
20 | // setup index
21 | $table->primary(array('user_id', 'group_id'));
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 |
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/database/migrations/2014_02_19_095637_create_groups_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
19 | $table->string('name');
20 | $table->text('permissions')->nullable();
21 | $table->boolean('protected')->default(0);
22 | $table->timestamps();
23 | // setup index
24 | $table->unique('name');
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 |
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/database/migrations/2014_02_19_160516_create_permission_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
19 | $table->string('description');
20 | $table->string('permission');
21 | $table->boolean('protected')->default(0);
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::drop('permission');
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/database/migrations/2014_02_26_165011_create_user_profile_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
19 | $table->integer('user_id')->unsigned();
20 | $table->string('code',25)->nullable();
21 | $table->string('vat',20)->nullable();
22 | $table->string('first_name',50)->nullable();
23 | $table->string('last_name',50)->nullable();
24 | $table->string('phone',20)->nullable();
25 | $table->string('state',20)->nullable();
26 | $table->string('city',50)->nullable();
27 | $table->string('country',50)->nullable();
28 | $table->string('zip',20)->nullable();
29 | $table->string('address',100)->nullable();
30 | $table->binary('avatar')->nullable();
31 | $table->timestamps();
32 | // foreign keys
33 | $table->foreign('user_id')
34 | ->references('id')->on('users')
35 | ->onUpdate('cascade')
36 | ->onDelete('cascade');
37 | });
38 | }
39 |
40 | /**
41 | * Reverse the migrations.
42 | *
43 | * @return void
44 | */
45 | public function down()
46 | {
47 | Schema::dropIfExists('user_profile');
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/database/migrations/2014_05_06_122145_create_profile_field_types.php:
--------------------------------------------------------------------------------
1 | increments('id');
19 | $table->string('description');
20 | $table->timestamps();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | *
27 | * @return void
28 | */
29 | public function down()
30 | {
31 | Schema::drop('profile_field_type');
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/database/migrations/2014_05_06_122155_create_profile_field.php:
--------------------------------------------------------------------------------
1 | increments('id');
19 | $table->integer('profile_id')->unsigned();
20 | $table->integer('profile_field_type_id')->unsigned();
21 | $table->string('value');
22 | // relations
23 | $table->foreign('profile_id')
24 | ->references('id')->on('user_profile')
25 | ->onUpdate('cascade')
26 | ->onDelete('cascade');
27 | $table->foreign('profile_field_type_id')
28 | ->references('id')->on('profile_field_type')
29 | ->onUpdate('cascade')
30 | ->onDelete('cascade');
31 | // indexes
32 | $table->unique(['profile_id','profile_field_type_id']);
33 | $table->timestamps();
34 | });
35 | }
36 |
37 | /**
38 | * Reverse the migrations.
39 | *
40 | * @return void
41 | */
42 | public function down()
43 | {
44 | Schema::drop('profile_field');
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
19 | $table->string('token')->index();
20 | $table->timestamp('created_at');
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | *
27 | * @return void
28 | */
29 | public function down()
30 | {
31 | Schema::drop('password_resets');
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/database/seeds/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/database/seeds/.gitkeep
--------------------------------------------------------------------------------
/docs/images/add_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/docs/images/add_user.png
--------------------------------------------------------------------------------
/docs/images/admin_main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/docs/images/admin_main.png
--------------------------------------------------------------------------------
/docs/images/dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/docs/images/dashboard.png
--------------------------------------------------------------------------------
/docs/images/edit_profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/docs/images/edit_profile.png
--------------------------------------------------------------------------------
/docs/images/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/docs/images/login.png
--------------------------------------------------------------------------------
/docs/images/signup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/docs/images/signup.png
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | var elixir = require('laravel-elixir');
2 |
3 | /*
4 | |--------------------------------------------------------------------------
5 | | Elixir Asset Management
6 | |--------------------------------------------------------------------------
7 | |
8 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks
9 | | for your Laravel application. By default, we are compiling the Less
10 | | file for our application, as well as publishing vendor resources.
11 | |
12 | */
13 |
14 | elixir(function(mix) {
15 | mix.less('app.less');
16 | });
17 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "devDependencies": {
3 | "gulp": "^3.8.8",
4 | "laravel-elixir": "*"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |