Download the PHP package c975l/user-files-bundle without Composer
On this page you can find all versions of the php package c975l/user-files-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download c975l/user-files-bundle
More information about c975l/user-files-bundle
Files in c975l/user-files-bundle
Package user-files-bundle
Short Description Simply add a layer over FOSUserBundle for navigating files
License MIT
Homepage https://github.com/975L/UserFilesBundle
Informations about the package user-files-bundle
UserFilesBundle
THIS BUNDLE HAS BEEN SET READ-ONLY AND REPLACED BY c975L/UserBundle
UserFilesBundle does the following:
- Uses FOSUserBundle to store users in database,
- Provides supplementary files (templates, Controllers, etc.) to manage those users,
- Adds fields as firstname, lastname, avatar, etc.
- Displays a "challenge" for registration
- Allows the possibility to disable registration (for registering only one or more users)
UserFiles Bundle dedicated web page.
Bundle installation
Step 1: Download the Bundle
Use Composer to install the library
Step 2: Enable the Bundles
Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:
Step 3: Configure the Bundles
Then, in the app/config.yml file of your project, define the following:
Then add the correct values in the app/parameters.yml
And finally in app/security.yml
Step 4: Create MySql table
Use /Resources/sql/user.sql to create the table user if not already existing. The DROP TABLE is commented to avoid dropping by mistake.
You can also create the table user_archives + stored procedure to archive the user when deleting account, for this copy/paste the code from file /Resources/sql/user.sql, then set config value archiveUser to true.
Step 5: Enable the Routes
Then, enable the routes by adding them to the app/config/routing.yml file of your project:
Overriding Templates
It is strongly recommended to use the Override Templates from Third-Party Bundles feature to integrate fully with your site.
For this, simply, create the following structure app/Resources/c975LUserFilesBundle/views/ in your app and then duplicate the file layout.html.twig in it, to override the existing Bundle files, then apply your needed changes.
You also have to override:
app/Resources/c975LUserFilesBundle/views/emails/layout.html.twigto set data related to your emails.app/Resources/c975LUserFilesBundle/views/fragments/registerAcceptanceInfo.html.twigto display links (Terms of use, Privacy policy, etc.) displayed in the register form.app/Resources/c975LUserFilesBundle/views/fragments/deleteAccountInfo.html.twigthat will list the implications, by deleting account, for user, displayed in the delete account page.app/Resources/c975LUserFilesBundle/views/fragments/dashboardActions.html.twigto add your own actions (or whatever) in the dashboard i.e.
You can add a navbar menu via {% include('@c975LUserFiles/fragments/navbarMenu.html.twig') %}. You can override it, if needed, or simply override /fragments/navbarMenuActions.html.twig to add actions above it.
Routes
The Routes are those used by FOSUserBundle + userfiles_dashboard, userfiles_signout and userfiles_delete_account.
Using HwiOauth (Social network sign in)
You can display links on the login page to sign in with social network/s. This bundle doesn't implement this functionality, it only displays button/s on the login page. You have to configure HWIOAuthBundle by your own.
If you use it, simply indicate in app/config/routing.yml
You also have to upload images on your website named web/images/signin-[network].png (width="200" height="50"), where network is the name defined in the config.yml file.
Overriding Entity
To add more fields (address, etc.) to the Entity User, you need to override it, but you MUST extend FOS\UserBundle\Model\User, NOT extend c975L/UserFilesBundle/Entity/User. It gives the following code:
Create the file src/UserFilesBundle/UserFilesBundle.php:
Copy/paste the file Entity/User.php in src/UserFilesBundle/Entity/
In app/config/config.yml change the user_class
Overridding Forms
To override Form, create the file src/UserFilesBundle/UserFilesBundle.php as explained above and duplicate the Form in src/UserFilesBundle/Form/[FormName]Type.php, (i.e. for Profile Form)
In app/config/services.yml add a service (i.e. for Profile Form):
In app/config/config.yml change the type linked to the form (i.e. for Profile Form)
Overriding Controller
To override Controller, create the file src/UserFilesBundle/UserFilesBundle.php as explained above and duplicate the Controller in src/UserFilesBundle/Controller/UserController.php
The two functions signoutUserFunction() and deleteAccountUserFunction() are here to easily allow adding functions for sign out and delete user. Simply Override them in the Controller as described above.
All versions of user-files-bundle with dependencies
symfony/framework-bundle Version ^3
sensio/framework-extra-bundle Version ^3
symfony/assetic-bundle Version ^2
friendsofsymfony/user-bundle Version ^2
c975l/email-bundle Version ^1
c975l/toolbar-bundle Version ^1