├── .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 | 11 | 12 | 13 | ./tests/unit 14 | 15 | 16 | 17 | 18 | app/ 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes... 9 | RewriteRule ^(.*)/$ /$1 [L,R=301] 10 | 11 | # Handle Front Controller... 12 | RewriteCond %{REQUEST_FILENAME} !-d 13 | RewriteCond %{REQUEST_FILENAME} !-f 14 | RewriteRule ^ index.php [L] 15 | 16 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | Register The Auto Loader 12 | |-------------------------------------------------------------------------- 13 | | 14 | | Composer provides a convenient, automatically generated class loader for 15 | | our application. We just need to utilize it! We'll simply require it 16 | | into the script here so that we don't have to worry about manual 17 | | loading any of our classes later on. It feels nice to relax. 18 | | 19 | */ 20 | 21 | require __DIR__.'/../bootstrap/autoload.php'; 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Turn On The Lights 26 | |-------------------------------------------------------------------------- 27 | | 28 | | We need to illuminate PHP development, so let us turn on the lights. 29 | | This bootstraps the framework and gets it ready for use, then it 30 | | will load up this application so that we can run it and send 31 | | the responses back to the browser and delight our users. 32 | | 33 | */ 34 | 35 | $app = require_once __DIR__.'/../bootstrap/app.php'; 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Run The Application 40 | |-------------------------------------------------------------------------- 41 | | 42 | | Once we have the application, we can simply call the run method, 43 | | which will execute the request and send the response back to 44 | | the client's browser allowing them to enjoy the creative 45 | | and wonderful application we have prepared for them. 46 | | 47 | */ 48 | 49 | $kernel = $app->make('Illuminate\Contracts\Http\Kernel'); 50 | 51 | $response = $kernel->handle( 52 | $request = Illuminate\Http\Request::capture() 53 | ); 54 | 55 | $response->send(); 56 | 57 | $kernel->terminate($request, $response); 58 | -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/css/fonts.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: bariolThin; 3 | src: url('/packages/jacopo/laravel-authentication-acl/fonts/Bariol_Thin.otf'); 4 | } 5 | 6 | @font-face { 7 | font-family: bariolLight; 8 | src: url('/packages/jacopo/laravel-authentication-acl/fonts/Bariol_Light.otf'); 9 | } 10 | 11 | @font-face { 12 | font-family: bariolBold; 13 | src: url('/packages/jacopo/laravel-authentication-acl/fonts/Bariol_Bold.otf'); 14 | } 15 | 16 | .bariol-thin { 17 | font-family: bariolThin 18 | } 19 | 20 | .bariol-bold { 21 | font-family: bariolBold 22 | } 23 | 24 | .bariol-light { 25 | font-family: bariolLight 26 | } -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/css/landing-page.css: -------------------------------------------------------------------------------- 1 | html,body { 2 | height:100%; 3 | } 4 | .container-full { 5 | margin: 0 auto; 6 | width: 100%; 7 | min-height: 100%; 8 | background-color: #EAEAEA; 9 | overflow: hidden; 10 | } 11 | .v-center { 12 | margin-top:7%; 13 | } -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/css/mail-base.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | background-color: #EAEAEA; 4 | } 5 | a 6 | { 7 | color: #5bc0de; 8 | } 9 | a:hover 10 | { 11 | color: #4597AF; 12 | } -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/css/strength.css: -------------------------------------------------------------------------------- 1 | #pass-info{ 2 | width: 100%; 3 | height: 25px; 4 | border: 1px solid #DDD; 5 | border-radius: 4px; 6 | color: #829CBD; 7 | text-align: center; 8 | font: 12px/25px Arial, Helvetica, sans-serif; 9 | } 10 | #pass-info.weakpass{ 11 | border: 1px solid #FF9191; 12 | background: #FFC7C7; 13 | color: #94546E; 14 | text-shadow: 1px 1px 1px #FFF; 15 | } 16 | #pass-info.stillweakpass { 17 | border: 1px solid #FBB; 18 | background: #FDD; 19 | color: #945870; 20 | text-shadow: 1px 1px 1px #FFF; 21 | } 22 | #pass-info.goodpass { 23 | border: 1px solid #C4EEC8; 24 | background: #E4FFE4; 25 | color: #51926E; 26 | text-shadow: 1px 1px 1px #FFF; 27 | } 28 | #pass-info.strongpass { 29 | border: 1px solid #6ED66E; 30 | background: #79F079; 31 | color: #348F34; 32 | text-shadow: 1px 1px 1px #FFF; 33 | } 34 | #pass-info.vrystrongpass { 35 | border: 1px solid #379137; 36 | background: #48B448; 37 | color: #CDFFCD; 38 | text-shadow: 1px 1px 1px #296429; 39 | } 40 | -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/fonts/Bariol_Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/public/packages/jacopo/laravel-authentication-acl/fonts/Bariol_Bold.otf -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/fonts/Bariol_Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/public/packages/jacopo/laravel-authentication-acl/fonts/Bariol_Light.otf -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/fonts/Bariol_Thin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/public/packages/jacopo/laravel-authentication-acl/fonts/Bariol_Thin.otf -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/fonts/bariol-fonts-license.txt: -------------------------------------------------------------------------------- 1 | ---- LICENSE ---- 2 | This font family is freeware and can be used for personal and commercial works. 3 | You can use this font at a single home or business location on a maximum of 5 CPUs. 4 | You also may give a copy of this software to any service bureau which you hire to output your film, paper or color proofs, provided that they do not use the font software for any purpose other than outputing your work. 5 | They may keep the font on file for use with future jobs on your behalf. 6 | You may use the fonts to create images on any surface such as computer screens, paper, web pages, photographs, movie credits, printed material, T-shirts, and other surfaces where the image is a fixed size, ... with the following restrictions: 7 | - You may not sell this font without permission. 8 | _ You may not redistribute this font without permission. 9 | _ You may not modify, adapt, translate, reverse engineer, _ decompile, disassemble or create derivative works based _ on this font. Bariol font can be used with @font-face. 10 | atipo® give no warranty in relation to this font, and you use this at your own risk. atipo® shall not be liable for any direct, indirect, consequential, or incidental damages (including damages from loss of business profits, business interruption, loss of business information, and the like) arising out of the use of or inability to use the fonts. 11 | If you have further questions, please contact us: info@atipo.es 12 | -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/public/packages/jacopo/laravel-authentication-acl/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/public/packages/jacopo/laravel-authentication-acl/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/public/packages/jacopo/laravel-authentication-acl/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/images/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/public/packages/jacopo/laravel-authentication-acl/images/avatar.png -------------------------------------------------------------------------------- /public/packages/jacopo/laravel-authentication-acl/js/vendor/password_strength/strength.js: -------------------------------------------------------------------------------- 1 | function passwordStrengthCheck(password1, password2, passwordsInfo) 2 | { 3 | //Must contain 5 characters or more 4 | var WeakPass = /(?=.{6,}).*/; 5 | //Must contain lower case letters and at least one digit. 6 | var MediumPass = /^(?=\S*?[a-z])(?=\S*?[0-9])\S{5,}$/; 7 | //Must contain at least one upper case letter, one lower case letter and one digit. 8 | var StrongPass = /^(?=\S*?[A-Z])(?=\S*?[a-z])(?=\S*?[0-9])\S{5,}$/; 9 | //Must contain at least one upper case letter, one lower case letter and one digit. 10 | var VryStrongPass = /^(?=\S*?[A-Z])(?=\S*?[a-z])(?=\S*?[0-9])(?=\S*?[^\w\*])\S{5,}$/; 11 | 12 | $(password1).on('keyup', function(e) { 13 | if(VryStrongPass.test(password1.val())) 14 | { 15 | passwordsInfo.removeClass().addClass('vrystrongpass').html("Very Strong! (Please don't forget your pass now!)"); 16 | } 17 | else if(StrongPass.test(password1.val())) 18 | { 19 | passwordsInfo.removeClass().addClass('strongpass').html("Strong! (Enter special chars to make even stronger"); 20 | } 21 | else if(MediumPass.test(password1.val())) 22 | { 23 | passwordsInfo.removeClass().addClass('goodpass').html("Good! (Enter uppercase letter to make strong)"); 24 | } 25 | else if(WeakPass.test(password1.val())) 26 | { 27 | passwordsInfo.removeClass().addClass('stillweakpass').html("Still Weak! (Enter digits to make good password)"); 28 | } 29 | else 30 | { 31 | passwordsInfo.removeClass().addClass('weakpass').html("Very Weak! (Must be 6 or more chars)"); 32 | } 33 | }); 34 | 35 | $(password2).on('keyup', function(e) { 36 | 37 | if(password1.val() !== password2.val()) 38 | { 39 | passwordsInfo.removeClass().addClass('weakpass').html("Passwords do not match!"); 40 | }else{ 41 | passwordsInfo.removeClass().addClass('goodpass').html("Passwords match!"); 42 | } 43 | 44 | }); 45 | } 46 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/assets/less/app.less: -------------------------------------------------------------------------------- 1 | @import "bootstrap/bootstrap"; 2 | 3 | @btn-font-weight: 300; 4 | @font-family-sans-serif: "Roboto", Helvetica, Arial, sans-serif; 5 | 6 | body, label, .checkbox label { 7 | font-weight: 300; 8 | } 9 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissible alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 41 | .alert-dismissible { 42 | padding-right: (@alert-padding + 20); 43 | 44 | // Adjust close link position 45 | .close { 46 | position: relative; 47 | top: -2px; 48 | right: -21px; 49 | color: inherit; 50 | } 51 | } 52 | 53 | // Alternate styles 54 | // 55 | // Generate contextual modifier classes for colorizing the alert. 56 | 57 | .alert-success { 58 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 59 | } 60 | .alert-info { 61 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 62 | } 63 | .alert-warning { 64 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 65 | } 66 | .alert-danger { 67 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 68 | } 69 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | .btn-xs & { 32 | top: 0; 33 | padding: 1px 5px; 34 | } 35 | 36 | // Hover state, but only for links 37 | a& { 38 | &:hover, 39 | &:focus { 40 | color: @badge-link-hover-color; 41 | text-decoration: none; 42 | cursor: pointer; 43 | } 44 | } 45 | 46 | // Account for badges in navs 47 | .list-group-item.active > &, 48 | .nav-pills > .active > a > & { 49 | color: @badge-active-color; 50 | background-color: @badge-active-bg; 51 | } 52 | .list-group-item > & { 53 | float: right; 54 | } 55 | .list-group-item > & + & { 56 | margin-right: 5px; 57 | } 58 | .nav-pills > li > a > & { 59 | margin-left: 3px; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset and dependencies 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | @import "glyphicons.less"; 9 | 10 | // Core CSS 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | @import "tables.less"; 16 | @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "responsive-embed.less"; 39 | @import "wells.less"; 40 | @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | @import "modals.less"; 44 | @import "tooltip.less"; 45 | @import "popovers.less"; 46 | @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | visibility: hidden; 21 | 22 | &.in { display: block; visibility: visible; } 23 | tr&.in { display: table-row; } 24 | tbody&.in { display: table-row-group; } 25 | } 26 | 27 | .collapsing { 28 | position: relative; 29 | height: 0; 30 | overflow: hidden; 31 | .transition-property(~"height, visibility"); 32 | .transition-duration(.35s); 33 | .transition-timing-function(ease); 34 | } 35 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding (@jumbotron-padding / 2); 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | p { 17 | margin-bottom: (@jumbotron-padding / 2); 18 | font-size: @jumbotron-font-size; 19 | font-weight: 200; 20 | } 21 | 22 | > hr { 23 | border-top-color: darken(@jumbotron-bg, 10%); 24 | } 25 | 26 | .container &, 27 | .container-fluid & { 28 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 29 | } 30 | 31 | .container { 32 | max-width: 100%; 33 | } 34 | 35 | @media screen and (min-width: @screen-sm-min) { 36 | padding: (@jumbotron-padding * 1.6) 0; 37 | 38 | .container &, 39 | .container-fluid & { 40 | padding-left: (@jumbotron-padding * 2); 41 | padding-right: (@jumbotron-padding * 2); 42 | } 43 | 44 | h1, 45 | .h1 { 46 | font-size: (@font-size-base * 4.5); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media-right, 11 | .media > .pull-right { 12 | padding-left: 10px; 13 | } 14 | 15 | .media-left, 16 | .media > .pull-left { 17 | padding-right: 10px; 18 | } 19 | 20 | .media-left, 21 | .media-right, 22 | .media-body { 23 | display: table-cell; 24 | vertical-align: top; 25 | } 26 | 27 | .media-middle { 28 | vertical-align: middle; 29 | } 30 | 31 | .media-bottom { 32 | vertical-align: bottom; 33 | } 34 | 35 | // Reset margins on headings for tighter default spacing 36 | .media-heading { 37 | margin-top: 0; 38 | margin-bottom: 5px; 39 | } 40 | 41 | // Media list variation 42 | // 43 | // Undo default ul/ol styles 44 | .media-list { 45 | padding-left: 0; 46 | list-style: none; 47 | } 48 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | 18 | // Components 19 | @import "mixins/alerts.less"; 20 | @import "mixins/buttons.less"; 21 | @import "mixins/panels.less"; 22 | @import "mixins/pagination.less"; 23 | @import "mixins/list-group.less"; 24 | @import "mixins/nav-divider.less"; 25 | @import "mixins/forms.less"; 26 | @import "mixins/progress-bar.less"; 27 | @import "mixins/table-row.less"; 28 | 29 | // Skins 30 | @import "mixins/background-variant.less"; 31 | @import "mixins/border-radius.less"; 32 | @import "mixins/gradients.less"; 33 | 34 | // Layout 35 | @import "mixins/clearfix.less"; 36 | @import "mixins/center-block.less"; 37 | @import "mixins/nav-vertical-align.less"; 38 | @import "mixins/grid-framework.less"; 39 | @import "mixins/grid.less"; 40 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover { 6 | background-color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:hover, 12 | &:focus, 13 | &.focus, 14 | &:active, 15 | &.active, 16 | .open > .dropdown-toggle& { 17 | color: @color; 18 | background-color: darken(@background, 10%); 19 | border-color: darken(@border, 12%); 20 | } 21 | &:active, 22 | &.active, 23 | .open > .dropdown-toggle& { 24 | background-image: none; 25 | } 26 | &.disabled, 27 | &[disabled], 28 | fieldset[disabled] & { 29 | &, 30 | &:hover, 31 | &:focus, 32 | &.focus, 33 | &:active, 34 | &.active { 35 | background-color: @background; 36 | border-color: @border; 37 | } 38 | } 39 | 40 | .badge { 41 | color: @background; 42 | background-color: @color; 43 | } 44 | } 45 | 46 | // Button sizes 47 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 48 | padding: @padding-vertical @padding-horizontal; 49 | font-size: @font-size; 50 | line-height: @line-height; 51 | border-radius: @border-radius; 52 | } 53 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a& { 9 | color: @color; 10 | 11 | .list-group-item-heading { 12 | color: inherit; 13 | } 14 | 15 | &:hover, 16 | &:focus { 17 | color: @color; 18 | background-color: darken(@background, 5%); 19 | } 20 | &.active, 21 | &.active:hover, 22 | &.active:focus { 23 | color: #fff; 24 | background-color: @color; 25 | border-color: @color; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | .border-left-radius(@border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | .border-right-radius(@border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover { 6 | color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | 26 | // Modifier class for 16:9 aspect ratio 27 | &.embed-responsive-16by9 { 28 | padding-bottom: 56.25%; 29 | } 30 | 31 | // Modifier class for 4:3 aspect ratio 32 | &.embed-responsive-4by3 { 33 | padding-bottom: 75%; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | } 57 | -------------------------------------------------------------------------------- /resources/assets/less/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | "Passwords must be at least six characters and match the confirmation.", 17 | "user" => "We can't find a user with that e-mail address.", 18 | "token" => "This password reset token is invalid.", 19 | "sent" => "We have e-mailed your password reset link!", 20 | "reset" => "Your password has been reset!", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/views/admin/dashboard/default.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::admin.layouts.base-2cols') 2 | 3 | @section('title') 4 | Admin area: dashboard 5 | @stop 6 | 7 | @section('content') 8 |
9 |
10 |

Dashboard

11 |
12 |
13 |
14 |
{!! $registered !!} 15 |
Total users
16 |
{!! $active !!} 17 |
Active users
18 |
{!! $pending !!} 19 |
Pending users
20 |
{!! $banned !!} 21 |
Banned users
22 |
23 |
24 | @stop -------------------------------------------------------------------------------- /resources/views/admin/group/groups-table.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | Add New 4 |
5 |
6 | @if( ! $groups->isEmpty() ) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | @foreach($groups as $group) 16 | 17 | 18 | 28 | 29 | @endforeach 30 | 31 |
Group nameOperations
{!! $group->name !!} 19 | @if(! $group->protected) 20 | 21 | 22 | 23 | @else 24 | 25 | 26 | @endif 27 |
32 | @else 33 |
No results found.
34 | @endif 35 |
36 | {!! $groups->appends($request->except(['page']) )->render() !!} 37 |
-------------------------------------------------------------------------------- /resources/views/admin/group/list.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::admin.layouts.base-2cols') 2 | 3 | @section('title') 4 | Admin area: Groups list 5 | @stop 6 | 7 | @section('content') 8 | 9 |
10 |
11 |
12 | {{-- print messages --}} 13 | 14 | @if( isset($message) ) 15 |
{!! $message !!}
16 | @endif 17 | {{-- print errors --}} 18 | @if($errors && ! $errors->isEmpty() ) 19 | @foreach($errors->all() as $error) 20 |
{!! $error !!}
21 | @endforeach 22 | @endif 23 |
24 |
25 |

{!! $request->all() ? 'Search results:' : 'Groups' !!}

26 |
27 |
28 | @include('laravel-authentication-acl::admin.group.groups-table') 29 |
30 |
31 |
32 |
33 | @include('laravel-authentication-acl::admin.group.search') 34 |
35 |
36 |
37 | @stop 38 | 39 | @section('footer_scripts') 40 | 45 | @stop -------------------------------------------------------------------------------- /resources/views/admin/group/search.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Group search

4 |
5 |
6 | {!! Form::open(['route' => 'groups.list','method' => 'get']) !!} 7 | 8 |
9 | {!! Form::label('name','Name:') !!} 10 | {!! Form::text('name', null, ['class' => 'form-control', 'placeholder' => 'group name']) !!} 11 |
12 | {!! $errors->first('name') !!} 13 | {!! Form::submit('Search', ["class" => "btn btn-info pull-right"]) !!} 14 | {!! Form::close() !!} 15 |
16 |
-------------------------------------------------------------------------------- /resources/views/admin/layouts/base-1cols.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::admin.base') 2 | 3 | @section('container') 4 |
5 | @yield('content') 6 |
7 | @stop -------------------------------------------------------------------------------- /resources/views/admin/layouts/base-2cols.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::admin.layouts.base') 2 | 3 | @section('container') 4 |
5 | 8 |
9 | @yield('content') 10 |
11 |
12 | @stop -------------------------------------------------------------------------------- /resources/views/admin/layouts/base.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Layout base admin panel --}} 2 | 3 | 4 | 5 | 6 | @yield('title') 7 | 8 | 9 | 10 | 11 | 12 | 13 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/bootstrap.min.css') !!} 14 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/style.css') !!} 15 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/baselayout.css') !!} 16 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/fonts.css') !!} 17 | {!! HTML::style('//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css') !!} 18 | 19 | @yield('head_css') 20 | {{-- End head css --}} 21 | 22 | 23 | 27 | 28 | 29 | 30 | {{-- navbar --}} 31 | @include('laravel-authentication-acl::admin.layouts.navbar') 32 | 33 | {{-- content --}} 34 |
35 | @yield('container') 36 |
37 | 38 | {{-- Start footer scripts --}} 39 | @yield('before_footer_scripts') 40 | 41 | {!! HTML::script('packages/jacopo/laravel-authentication-acl/js/vendor/jquery-1.10.2.min.js') !!} 42 | {!! HTML::script('packages/jacopo/laravel-authentication-acl/js/vendor/bootstrap.min.js') !!} 43 | 44 | @yield('footer_scripts') 45 | {{-- End footer scripts --}} 46 | 47 | -------------------------------------------------------------------------------- /resources/views/admin/layouts/baseauth.blade.php: -------------------------------------------------------------------------------- 1 | {{-- Layout base used for authentication --}} 2 | 3 | 4 | 5 | @yield('title') 6 | 7 | 8 | 9 | 10 | 11 | 12 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/bootstrap.min.css') !!} 13 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/style.css') !!} 14 | {!! HTML::style('//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css') !!} 15 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/fonts.css') !!} 16 | 17 | @yield('head_css') 18 | {{-- End head css --}} 19 | 20 | 21 | 25 | 26 | 27 | 28 | {{-- content --}} 29 |
30 | @yield('container') 31 |
32 | 33 | {{-- Start footer scripts --}} 34 | {!! HTML::script('packages/jacopo/laravel-authentication-acl/js/vendor/jquery-1.10.2.min.js') !!} 35 | {!! HTML::script('packages/jacopo/laravel-authentication-acl/js/vendor/bootstrap.min.js') !!} 36 | 37 | -------------------------------------------------------------------------------- /resources/views/admin/layouts/partials/avatar.blade.php: -------------------------------------------------------------------------------- 1 | @if(isset($logged_user) && $logged_user->user_profile()->count()) 2 | 3 | @else 4 | 5 | @endif -------------------------------------------------------------------------------- /resources/views/admin/layouts/sidebar.blade.php: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /resources/views/admin/mail/registration-activated-client.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/mail-base.css') !!} 7 | {!! HTML::style('//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css') !!} 8 | 9 | 10 |

Welcome to {!! Config::get('acl_base.app_name')!!}

11 |
12 |

Dear: {!! $body['email'] !!}

13 | Your email has been confirmed successfully. 14 | You can now login to the website using the 15 | Following link. 16 |
17 | 18 | 19 | -------------------------------------------------------------------------------- /resources/views/admin/mail/registration-confirmed-client.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {!! HTML::style('//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css') !!} 6 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/mail-base.css') !!} 7 | 8 | 9 |

Welcome to: {!! Config::get('acl_base.app_name') !!}

10 |
11 |

Dear: {!! $body['first_name'] !!}

12 | You account has been created. You can now login to the website using the 13 | Following link. 14 |
15 | Please find your account details below: 16 | 20 |
21 | 22 | -------------------------------------------------------------------------------- /resources/views/admin/mail/registration-waiting-client.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/mail-base.css') !!} 6 | {!! HTML::style('//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css') !!} 7 | 8 | 9 |

Registration request on: {!!Config::get('acl_base.app_name')!!}

10 |
11 |

Dear: {!!$body['first_name']!!}

12 | You account has been created. However, before you can use it you need to confirm your email address first by clicking the 13 | Following link 14 |
15 | Please find your account details below: 16 | 20 |
21 | 22 | -------------------------------------------------------------------------------- /resources/views/admin/mail/reminder.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/mail-base.css') !!} 6 | {!! HTML::style('//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css') !!} 7 | 8 | 9 |

Password recovery for {!! Config::get('acl_base.app_name') !!}

10 |
11 | We received a request to change your password, if you authorize it {!! $body !!}
12 | Otherwise ignore this email. 13 |
14 | 15 | -------------------------------------------------------------------------------- /resources/views/admin/permission/list.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::admin.layouts.base-2cols') 2 | 3 | @section('title') 4 | Admin area: permission list 5 | @stop 6 | 7 | @section('content') 8 | 9 |
10 |
11 | {{-- print messages --}} 12 | 13 | @if( isset($message) ) 14 |
{{$message}}
15 | @endif 16 | {{-- print errors --}} 17 | @if($errors && ! $errors->isEmpty() ) 18 | @foreach($errors->all() as $error) 19 |
{{$error}}
20 | @endforeach 21 | @endif 22 |
23 |
24 |

Permissions

25 |
26 |
27 | @include('laravel-authentication-acl::admin.permission.permission-table') 28 |
29 |
30 |
31 |
32 | @stop 33 | 34 | @section('footer_scripts') 35 | 40 | @stop -------------------------------------------------------------------------------- /resources/views/admin/permission/permission-table.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | Add New 4 |
5 |
6 | @if( ! $permissions->isEmpty() ) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | @foreach($permissions as $permission) 17 | 18 | 19 | 20 | 29 | 30 | @endforeach 31 | 32 |
Permission descriptionPermission nameOperations
{!! $permission->description !!}{!! $permission->permission !!} 21 | @if(! $permission->protected) 22 | 23 | 24 | @else 25 | 26 | 27 | @endif 28 |
33 | @else 34 |
No permissions found.
35 | @endif -------------------------------------------------------------------------------- /resources/views/admin/user/custom-profile.blade.php: -------------------------------------------------------------------------------- 1 |

Custom fields:

2 | 3 | {{-- add fields --}} 4 | {!! Form::open(["route" => 'users.profile.addfield', 'class' => 'form-add-profile-field', 'role' => 'form']) !!} 5 |
6 |
7 | 8 | {!! Form::text('description','',['class' =>'form-control','placeholder' => 'Custom field name']) !!} 9 | {!! Form::hidden('user_id',$user_profile->user_id) !!} 10 |
11 |
12 | {!! Form::close() !!} 13 | 14 | {{-- delete fields --}} 15 | @foreach($custom_profile->getAllTypesWithValues() as $profile_data) 16 | {!! Form::open(["route" => 'users.profile.deletefield', 'name' => $profile_data->id, 'role' => 'form']) !!} 17 |
18 |
19 | 21 | {!! Form::text('profile_description', $profile_data->description, ['class' => 'form-control', 'readonly' => 'readonly']) !!} 22 | {!! Form::hidden('id', $profile_data->id) !!} 23 | {!! Form::hidden('user_id',$user_profile->user_id) !!} 24 |
25 |
26 | {!! Form::close() !!} 27 | @endforeach 28 | 29 | @section('footer_scripts') 30 | @parent 31 | 43 | @stop -------------------------------------------------------------------------------- /resources/views/admin/user/groups.blade.php: -------------------------------------------------------------------------------- 1 | {{-- add group --}} 2 | {!! Form::open(["route" => "users.groups.add", 'class' => 'form-add-group', 'role' => 'form']) !!} 3 |
4 |
5 | 6 | {!! Form::select('group_id', $group_values, '', ["class"=>"form-control"]) !!} 7 | {!! Form::hidden('id', $user->id) !!} 8 |
9 | {!! $errors->first('name') !!} 10 |
11 | {!! Form::hidden('id', $user->id) !!} 12 | @if(! $user->exists) 13 |
14 |
You need to create the user first.
15 |
16 | @endif 17 | {!! Form::close() !!} 18 | 19 | {{-- delete group --}} 20 | @if( ! $user->groups->isEmpty() ) 21 | @foreach($user->groups as $group) 22 | {!! Form::open(["route" => "users.groups.delete", "role"=>"form", 'name' => $group->id]) !!} 23 |
24 |
25 | 26 | {!! Form::text('group_name', $group->name, ['class' => 'form-control', 'readonly' => 'readonly']) !!} 27 | {!! Form::hidden('id', $user->id) !!} 28 | {!! Form::hidden('group_id', $group->id) !!} 29 |
30 |
31 | {!! Form::close() !!} 32 | @endforeach 33 | @elseif($user->exists) 34 |
There is no groups associated to the user.
35 | @endif 36 | 37 | @section('footer_scripts') 38 | @parent 39 | 50 | @stop -------------------------------------------------------------------------------- /resources/views/admin/user/list.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::admin.layouts.base-2cols') 2 | 3 | @section('title') 4 | Admin area: users list 5 | @stop 6 | 7 | @section('content') 8 |
9 |
10 |
11 | {{-- print messages --}} 12 | 13 | @if( isset($message) ) 14 |
{!! $message !!}
15 | @endif 16 | {{-- print errors --}} 17 | @if($errors && ! $errors->isEmpty() ) 18 | @foreach($errors->all() as $error) 19 |
{!! $error !!}
20 | @endforeach 21 | @endif 22 | {{-- user lists --}} 23 | @include('laravel-authentication-acl::admin.user.user-table') 24 |
25 |
26 | @include('laravel-authentication-acl::admin.user.search') 27 |
28 |
29 |
30 | @stop 31 | 32 | @section('footer_scripts') 33 | 38 | @stop -------------------------------------------------------------------------------- /resources/views/admin/user/partials/avatar_upload.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Avatar

4 |
5 | 6 |
7 |
8 |
9 | {!! Form::open(['route' => 'users.profile.changeavatar', 'method' => 'POST', 'files' => true]) !!} 10 | {!! Form::label('avatar',$user_profile->avatar ? 'Change avatar: ' : 'Upload avatar: ') !!} 11 |
12 | {!! Form::file('avatar', ['class' => 'form-control']) !!} 13 | {!! $errors->first('avatar') !!} 14 |
15 | {!! Form::hidden('user_id', $user_profile->user_id) !!} 16 | {!! Form::hidden('user_profile_id', $user_profile->id) !!} 17 |
18 | {!! Form::submit('Update avatar', ['class' => 'btn btn-info']) !!} 19 |
20 | {!! Form::close() !!} 21 |
22 |
-------------------------------------------------------------------------------- /resources/views/admin/user/partials/show_gravatar.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Avatar

4 |
5 | 6 |
7 |
8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /resources/views/admin/user/partials/sorting.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | {!!Form::label('Sorting: ') !!} 4 |
5 |
6 | {!!Form::select('', ["" => "select column", "first_name" => "First name", "last_name" => "Last name", "email" => "Email", "last_login" => "Last login", "activated" => "Active"], $request->get('order_by',''), ['class' => 'form-control form-validable', 'id' => 'order-by-select']) !!} 7 | 8 |
9 |
10 | {!!Form::select('', ["asc" => "Ascending", "desc" => "Descending"], $request->get('ordering','asc'), ['class' =>'form-control', 'id' => 'ordering-select']) !!} 11 |
12 |
13 | Add 14 |
15 | 16 | {!!Form::hidden('order_by',$request->get('order_by'),["id" => "order-by" ]) !!} 17 | {!!Form::hidden('ordering',$request->get('ordering'), ["id" => "ordering"]) !!} 18 |
19 | 20 | @section('footer_scripts') 21 | @parent 22 | {!! HTML::script('packages/jacopo/laravel-authentication-acl/js/custom-ordering.js') !!} 23 | @stop -------------------------------------------------------------------------------- /resources/views/client/auth/captcha-image.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/views/client/auth/change-password-success.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::client.layouts.base-fullscreen') 2 | @section ('title') 3 | Password recovery success 4 | @stop 5 | @section('content') 6 |
7 |
8 | 9 |

Password changed successfully

10 |

11 | Your password has been changed succesfully. Now you can login to our site. 12 | Go to homepage 13 |

14 |
15 |
16 | @stop -------------------------------------------------------------------------------- /resources/views/client/auth/changepassword.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::client.layouts.base') 2 | @section('title') 3 | Change password 4 | @stop 5 | @section('content') 6 |
7 |
8 |
9 |
10 |

Change your password to {!! Config::get('acl_base.app_name') !!}

11 |
12 | @if($errors && ! $errors->isEmpty() ) 13 | @foreach($errors->all() as $error) 14 |
{!! $error !!}
15 | @endforeach 16 | @endif 17 |
18 | {!! Form::open(array('url' => URL::route("user.reminder.process"), 'method' => 'post') ) !!} 19 |
20 |
21 |
22 | {!! Form::label('password', 'New password: ') !!} 23 |
24 | 25 | {!! Form::password('password', ['id' => 'password', 'class' => 'form-control', 'placeholder' => 'New password', 'required', 'autocomplete' => 'off']) !!} 26 |
27 |
28 |
29 |
30 | 31 | {!! Form::hidden('email',$email) !!} 32 | {!! Form::hidden('token',$token) !!} 33 | {!! Form::close() !!} 34 |
35 |
36 |
37 |
38 | @stop -------------------------------------------------------------------------------- /resources/views/client/auth/email-confirmation.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::client.layouts.base-fullscreen') 2 | @section ('title') 3 | Registration completed 4 | @stop 5 | @section('content') 6 |
7 |
8 | @if($errors->has('token')) 9 |

Oops, something went wrong: the token is invalid

10 | @elseif($errors->has('email')) 11 |

Oops, something went wrong: the email is invalid

12 | @else 13 |

Congratulations, you successfully registered to 14 | {!! Config::get('acl_base.app_name') !!}

15 |

Your email has been confirmed. 16 | Now you can login to the website using the {!! link_to('/login','Following link') !!}

17 | @endif 18 |
19 |
20 | @stop -------------------------------------------------------------------------------- /resources/views/client/auth/reminder-success.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::client.layouts.base-fullscreen') 2 | @section ('title') 3 | Password recovery 4 | @stop 5 | @section('content') 6 |
7 |
8 | 9 |

Request received

10 |

We sent you the information to recover your password. Please check your inbox.

11 |
12 |
13 | @stop -------------------------------------------------------------------------------- /resources/views/client/auth/reminder.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::client.layouts.base') 2 | @section ('title') 3 | Password recovery 4 | @stop 5 | @section('content') 6 |
7 |
8 |
9 |
10 |

Password recovery

11 |
12 | @if($errors && ! $errors->isEmpty() ) 13 | @foreach($errors->all() as $error) 14 |
{{$error}}
15 | @endforeach 16 | @endif 17 |
18 | {!! Form::open(array('url' => URL::route("user.reminder"), 'method' => 'post') ) !!} 19 |
20 |
21 |
22 | {!! Form::label('email','Email:') !!} 23 |
24 | 25 | {!! Form::email('email', '', ['id' => 'email', 'class' => 'form-control', 'placeholder' => 'Your account email', 'required', 'autocomplete' => 'off']) !!} 26 |
27 |
28 |
29 |
30 | 31 | {!! Form::close() !!} 32 |
33 |
34 | Back to login 35 |
36 |
37 |
38 |
39 |
40 |
41 | @stop -------------------------------------------------------------------------------- /resources/views/client/auth/signup-email-confirmation.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::client.layouts.base-fullscreen') 2 | @section ('title') 3 | Registration request received 4 | @stop 5 | @section('content') 6 |
7 |
8 | 9 |

Request received

10 |

You account has been created. However, before you can use it you need to confirm your email address.
11 | We sent you a confirmation email, please check your inbox.

12 |
13 |
14 | @stop -------------------------------------------------------------------------------- /resources/views/client/auth/signup-success.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::client.layouts.base-fullscreen') 2 | @section ('title') 3 | Registration completed 4 | @stop 5 | @section('content') 6 |
7 |
8 | 9 |

Congratulations, you successfully registered to {!! Config::get('acl_base.app_name') !!}

10 |

Your user has been registered succesfully. 11 | Now you can login to the website using the {!! link_to('/login','Following link') !!}

12 |
13 |
14 | @stop -------------------------------------------------------------------------------- /resources/views/client/exceptions/401.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::client.layouts.base-fullscreen') 2 | @section ('title') 3 | 401 4 | @stop 5 | @section('content') 6 |
7 |
8 | 9 |

401

10 |

11 | Sorry, you don't have permission to see this page 12 | Go to homepage 13 |

14 |
15 |
16 | @stop -------------------------------------------------------------------------------- /resources/views/client/exceptions/404.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::client.layouts.base-fullscreen') 2 | @section ('title') 3 | 404 4 | @stop 5 | @section('content') 6 |
7 |
8 | 9 |

404

10 |

11 | Sorry, this is not the page you were looking for. 12 | Go to homepage 13 |

14 |
15 |
16 | @stop -------------------------------------------------------------------------------- /resources/views/client/exceptions/500.blade.php: -------------------------------------------------------------------------------- 1 | @extends('laravel-authentication-acl::client.layouts.base-fullscreen') 2 | @section ('title') 3 | 500 4 | @stop 5 | @section('content') 6 |
7 |
8 | 9 |

500

10 |

11 | Sorry, there was an error. 12 | Go to homepage 13 |

14 |
15 |
16 | @stop -------------------------------------------------------------------------------- /resources/views/client/layouts/base-fullscreen.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @yield('title') 5 | 6 | 7 | 8 | 9 | 10 | 11 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/bootstrap.min.css') !!} 12 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/landing-page.css') !!} 13 | {!! HTML::style('//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css') !!} 14 | 15 | @yield('head_css') 16 | {{-- End head css --}} 17 | 18 | 19 | 23 | 24 | 25 | 26 |
27 | @yield('content') 28 |
29 | 30 | -------------------------------------------------------------------------------- /resources/views/client/layouts/base.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @yield('title') 5 | 6 | 7 | 8 | 9 | 10 | 11 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/bootstrap.min.css') !!} 12 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/style.css') !!} 13 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/baselayout.css') !!} 14 | {!! HTML::style('packages/jacopo/laravel-authentication-acl/css/fonts.css') !!} 15 | {!! HTML::style('//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css') !!} 16 | 17 | @yield('head_css') 18 | {{-- End head css --}} 19 | 20 | 21 | 25 | 26 | 27 | 28 |
29 | @yield('content') 30 |
31 | 32 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | 9 | $uri = urldecode( 10 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 11 | ); 12 | 13 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 14 | // built-in PHP web server. This provides a convenient way to test a Laravel 15 | // application without having installed a "real" web server software here. 16 | if ($uri !== '/' and file_exists(__DIR__.'/public'.$uri)) 17 | { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/.gitignore: -------------------------------------------------------------------------------- 1 | laravel.log -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | compiled.php 4 | services.json 5 | events.scanned.php 6 | routes.scanned.php 7 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrip/laravel-authentication-acl/f25474daf1e139503721c19ffb1bcdeac2eaf6dd/tests/.gitkeep -------------------------------------------------------------------------------- /tests/unit/CallWrapperTest.php: -------------------------------------------------------------------------------- 1 | shouldReceive('call') 19 | ->once() 20 | ->with($argument) 21 | ->getMock(); 22 | $wrapper = new CallWrapper($mock_called); 23 | $wrapper->call($argument); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/unit/ClientLoggedFilterTest.php: -------------------------------------------------------------------------------- 1 | 'admin_logged', 'uses' => function(){return '';}]); 14 | Route::get('check_custom', ['middleware' => "admin_logged:{$this->custom_url}", 'uses' => function(){return '';}]); 15 | } 16 | 17 | public function tearDown() 18 | { 19 | m::close(); 20 | } 21 | 22 | /** 23 | * @test 24 | **/ 25 | public function permitAccessToLoggedUsers() 26 | { 27 | $this->authCheck(true); 28 | 29 | $this->call('GET', 'check'); 30 | } 31 | 32 | /** 33 | * @test 34 | **/ 35 | public function redirectToLoginAnonymousUsers() 36 | { 37 | $this->authCheck(true); 38 | 39 | $response = $this->get('check'); 40 | 41 | $response->assertRedirect('/login'); 42 | } 43 | 44 | /** 45 | * @test 46 | **/ 47 | public function redirectToCustomUrlAnonymousUsers() 48 | { 49 | $this->authCheck(true); 50 | 51 | $response = $this->call('GET', 'check_custom'); 52 | 53 | $response->assertRedirect($this->custom_url); 54 | } 55 | 56 | /** 57 | * @param $true 58 | */ 59 | private function authCheck($true) 60 | { 61 | $auth_success = m::mock('StdClass'); 62 | $auth_success->shouldReceive('check')->andReturn($true); 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /tests/unit/DashboardControllerTest.php: -------------------------------------------------------------------------------- 1 | initializeUserHasher(); 16 | } 17 | 18 | public function tearDown() 19 | { 20 | m::close(); 21 | } 22 | 23 | /** 24 | * @test 25 | **/ 26 | public function canShowDashboardPage() 27 | { 28 | $this->loginAnUser(); 29 | 30 | $response = $this->get(route('dashboard.default')); 31 | 32 | $response->assertStatus(200); 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /tests/unit/EditableSubscriberTest.php: -------------------------------------------------------------------------------- 1 | protected = false; 19 | 20 | $sub = new EditableSubscriber(); 21 | $sub->isEditable($model); 22 | } 23 | 24 | /** 25 | * @test 26 | * @expectedException \LaravelAcl\Authentication\Exceptions\PermissionException 27 | **/ 28 | public function it_check_if_es_editable_and_throw_new_exception() 29 | { 30 | $model = new \StdClass; 31 | $model->protected = true; 32 | 33 | $sub = new EditableSubscriber(); 34 | $sub->isEditable($model); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/unit/GroupPresenterTest.php: -------------------------------------------------------------------------------- 1 | permissions = ["perm"]; 27 | $presenter = new GroupPresenter($resource_stub); 28 | 29 | $names = $presenter->permissions_obj($perm); 30 | $this->assertEquals("name", $names[0]); 31 | } 32 | } 33 | 34 | class PermissionStub 35 | { 36 | protected static $a = 1; 37 | 38 | public static function wherePermission() 39 | { 40 | $mock_first = m::mock('StdClass')->shouldReceive('first')->andReturn('name')->getMock(); 41 | $mock_empty = m::mock('StdClass')->shouldReceive('isEmpty')->andReturn(false)->getMock(); 42 | $mock_get = m::mock('StdClass')->shouldReceive('get')->andReturn($mock_empty)->getMock(); 43 | 44 | if(static::$a == 1) 45 | { 46 | static::$a = 2; 47 | return $mock_get; 48 | } 49 | return $mock_first; 50 | } 51 | } -------------------------------------------------------------------------------- /tests/unit/InstallCommandTest.php: -------------------------------------------------------------------------------- 1 | shouldReceive('call') 26 | ->once() 27 | ->with('vendor:publish', ['force']) 28 | ->shouldReceive('call') 29 | ->once() 30 | ->with('migrate') 31 | ->getMock(); 32 | 33 | $mock_seeder = m::mock('LaravelAcl\Database\DbSeeder') 34 | ->shouldReceive('run') 35 | ->once() 36 | ->getMock(); 37 | 38 | $installCommand = new InstallCommand($mock_call, $mock_seeder); 39 | $installCommand->setLaravel($this->app); 40 | $command = new CommandTester($installCommand); 41 | $command->execute([]); 42 | 43 | $this->assertEquals("## Laravel Authentication ACL Installed successfully ##\n", $command->getDisplay()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/unit/MenuItemCollectionTest.php: -------------------------------------------------------------------------------- 1 | shouldReceive('havePermission')->andReturn(true)->getMock(); 24 | $item_without_permission = m::mock('StdClass')->shouldReceive('havePermission')->andReturn(false)->getMock(); 25 | 26 | $collection = new MenuItemCollection([$item_with_permission, $item_without_permission]); 27 | $item_valid = $collection->getItemListAvailable(); 28 | 29 | $this->assertCount(1, $item_valid); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/unit/ProfilePermissionSubscriberTest.php: -------------------------------------------------------------------------------- 1 | shouldReceive('checkCustomProfileEditPermission') 24 | ->andReturn(true) 25 | ->getMock(); 26 | App::instance('authentication_helper', $has_edit_profile_permssion); 27 | 28 | $subscriber = new ProfilePermissionSubscriber(); 29 | $subscriber->checkProfileTypePermission(); 30 | } 31 | 32 | /** 33 | * @test 34 | * @expectedException \LaravelAcl\Authentication\Exceptions\PermissionException 35 | **/ 36 | public function throwsExceptionIfTypePermissionFails() 37 | { 38 | $subscriber = new ProfilePermissionSubscriber(); 39 | 40 | $subscriber->checkProfileTypePermission(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /tests/unit/Stubs/VoidRepository.php: -------------------------------------------------------------------------------- 1 | useNullLogger(); 18 | } 19 | 20 | public function useNullLogger() 21 | { 22 | // Mail::setLogger(new NullLogger()); 23 | // Mail::pretend(); 24 | 25 | } 26 | 27 | protected function getNowDateTime() 28 | { 29 | return Carbon::now()->toDateTimeString(); 30 | } 31 | 32 | /** 33 | * @param $class 34 | */ 35 | protected function assertHasErrors($class) 36 | { 37 | $this->assertFalse($class->getErrors()->isEmpty()); 38 | } 39 | 40 | /** 41 | * Creates the application. 42 | * 43 | * @return \Illuminate\Foundation\Application 44 | */ 45 | public function createApplication() 46 | { 47 | $app = require __DIR__.'/../../bootstrap/app.php'; 48 | 49 | $app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 50 | 51 | $app['env'] = getenv('APP_ENV'); 52 | 53 | return $app; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /tests/unit/Traits/AuthHelper.php: -------------------------------------------------------------------------------- 1 | current_user = $this->getFakeUser(); 12 | $this->loginUser($this->current_user); 13 | } 14 | 15 | public function loginAnAdmin() 16 | { 17 | $this->current_user = $this->getFakeAdmin(); 18 | $this->loginUser($this->current_user); 19 | } 20 | 21 | public function loginUser($user) { 22 | App::make('sentry')->login($user); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /tests/unit/Traits/HourHelper.php: -------------------------------------------------------------------------------- 1 | assertEquals(Carbon::createFromFormat("Y-m-d H:i:s", $last_login)->format('H'), 14 | $expected_last->format('H'), 'The two hours doesn\'t match'); 15 | } 16 | } -------------------------------------------------------------------------------- /tests/unit/Traits/UserFactory.php: -------------------------------------------------------------------------------- 1 | $this->faker->email(), 14 | "password" => $this->faker->text(10), 15 | "activated" => 1 16 | ]; 17 | } 18 | 19 | protected function getAdminStub() 20 | { 21 | return array_merge($this->getUserStub(), ['permissions' => ['_superadmin' => 1]]); 22 | } 23 | 24 | protected function getFakeUser() 25 | { 26 | $this->current_user = new User($this->getUserStub()); 27 | return $this->current_user; 28 | } 29 | 30 | protected function getFakeAdmin() 31 | { 32 | $this->current_user = new User($this->getAdminStub()); 33 | return $this->current_user; 34 | } 35 | 36 | protected function getUserProfileStub(User $user) 37 | { 38 | return [ 39 | 'user_id' => $user->id, 40 | 'vat' => $this->faker->text('20'), 41 | 'first_name' => $this->faker->firstName(), 42 | 'last_name' => $this->faker->lastName(), 43 | 'phone' => $this->faker->phoneNumber(), 44 | 'state' => $this->faker->text(20), 45 | 'city' => $this->faker->citySuffix(), 46 | 'country' => $this->faker->country(), 47 | 'zip' => $this->faker->numberBetween(10000, 99999), 48 | 'address' => $this->faker->streetAddress() 49 | ]; 50 | } 51 | 52 | protected function getModelStub() 53 | { 54 | return $this->getUserStub(); 55 | } 56 | 57 | protected function initializeUserHasher() 58 | { 59 | User::setHasher(App::make('sentry.hasher')); 60 | return $this; 61 | } 62 | 63 | } -------------------------------------------------------------------------------- /tests/unit/UserProfileTest.php: -------------------------------------------------------------------------------- 1 | profile_model = new UserProfile(); 19 | } 20 | 21 | /** 22 | * @test 23 | **/ 24 | public function itEncodeProfileAvatarWithGet() 25 | { 26 | $data = $this->createBigRandomNumber(); 27 | $expected_data = base64_encode($data); 28 | 29 | $this->profile_model->avatar = $data; 30 | 31 | $this->assertEquals($expected_data, $this->profile_model->avatar); 32 | 33 | } 34 | 35 | /** 36 | * @return int 37 | */ 38 | protected function createBigRandomNumber() 39 | { 40 | $data = rand(10000, 100000); 41 | return $data; 42 | } 43 | 44 | /** 45 | * @test 46 | **/ 47 | public function canGetPresenter() 48 | { 49 | $profile_presenter = $this->profile_model->presenter(); 50 | 51 | $this->assertInstanceOf('LaravelAcl\Authentication\Presenters\UserProfilePresenter', $profile_presenter); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /tests/unit/UserSignupValidatorTest.php: -------------------------------------------------------------------------------- 1 | captcha_field = "captcha_text"; 19 | } 20 | 21 | /** 22 | * @test 23 | **/ 24 | public function canReadConfigurationAndDisableCaptchaRule() 25 | { 26 | UserSignupValidatorStub::cleanCaptchaRule(); 27 | $this->disableCaptchaCheck(); 28 | $validator = new UserSignupValidatorStub(); 29 | $rules = $validator->getRules(); 30 | 31 | $this->assertFalse(array_key_exists($this->captcha_field, $rules) ); 32 | } 33 | 34 | /** 35 | * @test 36 | **/ 37 | public function canReadConfigurationAndEnableCaptchaRule() 38 | { 39 | UserSignupValidatorStub::cleanCaptchaRule(); 40 | $this->enableCaptchaCheck(); 41 | $validator = new UserSignupValidatorStub(); 42 | $rules = $validator->getRules(); 43 | 44 | $this->assertTrue(array_key_exists($this->captcha_field, $rules) ); 45 | } 46 | 47 | protected function disableCaptchaCheck() 48 | { 49 | Config::set('acl_base.captcha_signup', false); 50 | } 51 | 52 | protected function enableCaptchaCheck() 53 | { 54 | Config::set('acl_base.captcha_signup', true); 55 | } 56 | 57 | } 58 | 59 | class UserSignupValidatorStub extends UserSignupValidator 60 | { 61 | public static function cleanCaptchaRule() 62 | { 63 | unset(static::$rules['captcha_text']); 64 | } 65 | } -------------------------------------------------------------------------------- /tests/unit/Validators/UserValidatorTest.php: -------------------------------------------------------------------------------- 1 | validator = new UserValidator(); 17 | $this->validator->resetStatic(); 18 | $this->initializeUserHasher(); 19 | } 20 | 21 | /** 22 | * @test 23 | **/ 24 | public function canValidateUniqueEmailOnUpdate() 25 | { 26 | $user_created = $this->make('LaravelAcl\Authentication\Models\User', $this->getUserStub()); 27 | 28 | $input = [ 29 | "id" => 1, 30 | "form_name" => "user", 31 | "email" => $user_created[0]->email 32 | ]; 33 | 34 | $this->assertTrue($this->validator->validate($input)); 35 | } 36 | 37 | /** 38 | * @test 39 | **/ 40 | public function canValidateUniqueEmailOnCreate() 41 | { 42 | $user_created = $this->make('LaravelAcl\Authentication\Models\User', $this->getUserStub()); 43 | 44 | $input = [ 45 | "form_name" => "user", 46 | "email", $user_created[0]->email, 47 | "password" => 'password', 48 | "password_confirmation" => 'password', 49 | ]; 50 | 51 | $this->assertFalse($this->validator->validate($input)); 52 | 53 | $input = $this->setUnusedEmail($input); 54 | $this->assertTrue($this->validator->validate($input)); 55 | } 56 | 57 | /** 58 | * @param $input 59 | * @return mixed 60 | */ 61 | protected function setUnusedEmail($input) 62 | { 63 | $input["email"] = "other@email.com"; 64 | return $input; 65 | } 66 | } 67 | --------------------------------------------------------------------------------