Giter Site home page Giter Site logo

shawnclake / userextended Goto Github PK

View Code? Open in Web Editor NEW
23.0 9.0 12.0 712 KB

An extension to the existing RainLab.User plugin for OctoberCMS

Home Page: http://octobercms.com/plugin/clake-userextended

License: GNU General Public License v3.0

PHP 70.23% HTML 26.39% CSS 0.53% JavaScript 2.85%
friends demotion group-hierarchy users-timezone rainlab octobercms octobercms-plugin profiles friend-requests promotion

userextended's Introduction

User Extended

Project Status

  • This project has been taken over and is being maintained by Joshua Webb

Currently on version v2.2.00

New in v2.2.00

    * Avatar picker on update page. {% partial 'account::update' %}
    * Closing, Reopening, Suspending, Deleting accounts. (Currently not accessible in the frontend by default)
    * Reset Roles and Groups back to default from the Role Manager
    * Usernames are now unique, and nicknames have been added
    * Friend states now use a bin 2^n storage pattern. This may change to use a DB table in the future.
    * Route restrictions and access tracking
    * Added more field types including, but not limited to: number, color, date, email, password, file, url
    * Now possible to add, change, remove timezones from the application
    * You can now override the relation between two users.
    * The addition of the [Beta] Module Manager. Currently changing settings for a module has no effect.
    * Improved error/success feedback system for Backend and Frontend validation

Please see the Module manager in the backend to view a detailed changelog

Overview

User Extended provides simple components and User Utility functions for complex interactions with users.

User Extended currently offers friends lists, role management, and User Utilities.

Dependencies

Installation

Install this plugin and run

  php artisan october:up

Usage

  • Just add the components you require to a page and everything should work out of the box
  • You can create modules to interact with User Extended and other UE modules
  • Use the command: php artisan create:uemodule author.pluginname in order to scaffold a module class for your own plugins.

Check out the bug tracker and feature planner

Contributors

Feature List

  • Backend Role/Group management
  • Advanced page restriction using groups, roles, users, and IP addresses.
  • Modules can be used to inject user code or develop an user API for your plugin
  • Friends lists. You can send friend requests and block/delete/accept friends
  • User Utility functions which can be used across your own plugins
  • User profiles and a profile comment system
  • User search. Search for users by name, email or username
  • Timezone support! Use the '|timezonify' twig filter.
  • Use the '|relative' twig filter to get a textual relative time stamp (5 seconds ago, 2 months ago)
  • Timezonable trait which can be added to models to automagically convert times
  • Fields for users. Now you can easily add fields for phone numbers, addresses, pin codes, invite numbers etc.

Please see the help directory for more information

Planned Features

Check out the feature planner

Roadmap

View our road map

Details

User Extended is not trying to be a social network plugin. We are providing functionality for more complex user functions which have use cases outside of social networks.

Websites specializing in online games, forums, blogs, news etc. can all benefit from User Extended.

Event List

  • [Disabled] clake.ue.preregistration(post &$data) : halted. $data contains registration form data. Returning false will cancel registration.
  • [Disabled] clake.ue.postregistration(UserExtended &$user). $user contains the final user object before saving it and logging out the user to finalize registration.
  • clake.ue.login(User $user). $user contains the user object after authenticating.
  • clake.ue.logout(User $user). $user contains the user object after logging out.
  • clake.ue.settings.create(UserSettingsManager &$instance). After the user settings instance object has been created
  • clake.ue.settings.update(UserSettingsManager &$instance). After the user settings instance object has been created

userextended's People

Contributors

bkrajendra avatar controllernetwork avatar gergo85 avatar quinnbast avatar shawnclake avatar tohurtv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

userextended's Issues

Add logging of events

Log actions of events thrown by UserExtended.

These include, but aren't limited to:

  • Account changes
  • Registration
  • Login
  • Logout
  • Backend group/role/user management. (Promotions, demotions, added to role/group etc.)
  • When a user blocks or deletes another

Move core functions into the core module

Move core functions into the core module to reduce the 'built-in' feel of the current features.

Move:

  • More or less transfer all of the User Util functions into the core module.
  • Component and navigation registrations

Add:

  • Ability to create,delete user
  • Ability to programatically change a users role/group
  • Ability to render user settings

More to come soon

Add templated profile pages

Add templated profile pages which can be chosen via an added dropdown in the User component inspector.

Template examples:

  • Business
  • Portfolio
  • User
  • About (Staff Member)

Add Lang support

Add lang support across the plugin.

In order of priority:

  • Components
  • Controllers
  • Classes
  • Models
  • Everything else

The code has already been taken

Looks like this plugin has some issues as after installing it, it does not let you do anything with OCMS.
Can not install plugin, could not login or anything just throws error
"The code has already been taken"

Drop UsersGroups table on uninstall and recreate it

Attempt to fix that primary key issue by removing the UsersGroups table and recreating it as default on uninstall.

Remember, we can't just create our own table because then Rainlab.Users won't know what to do.

Create an extension class with overidable functions for registering and accessing other modules

The extension class (Called 'UserExtended') should be capable of:

  • Defining a name, description, author, and other meta data for a module
  • Defining an accessible flag for whether or not other modules should be able to interact with this module
  • Defining a way of injecting more components, navigation, and lang into UserExtended rather than creating separate sections for all. This will require a DB table.
  • Calling contracted functions from other modules via syntax: 'UserExtended::{moduleName}()->{functionName}(array params);
    * This can be used to programatically utilize a blog,thread,commenting system from another module without digging into their code. Just check their contracted functions.
    * This requires other module developers to create useful contracted functions such as a Forum module with the contracted function 'getUsersActivity()' which would return all of a users activity. Utilized like this: UserExtended::Forum()->getUsersActivity()
  • Implemented as a service provider
  • Functions to determine whether modules are installed and their versions.

Best usage practices:

  • Module name is formatted as {author}{ModuleName}. For example if my author name was dingle and I had a module named dongle, the extensible module name would be dingleDongle.

Database Migration Fails during installation

I get the following error while installing the plugin

"SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key (SQL: alter table `users_groups` drop primary key)" 

Add Documentation

Add documentation for:

  • User Settings
  • Timezonable
  • Searchable
  • The plugin in general
  • Components: Account, Friends, Users

Switch friend states to use a bin 2^n pattern

Switch friend states to use a 2^n state. This can then be converted to a binary string. For example if following = 2, friended = 4, and subscribed = 8, then we can store the number 14 which translates to binary as: 1110. Thus we can see the 3 1's correlate to our friend states. Now we can store multiple user relations rather than just 1.

Add better feedback when errors occur

Many errors can occur and currently do not return any feedback.

Add feedback to situations which can occur in:

  • Registration
  • Logging in
  • Logging out
  • Roles/Groups updating, creating
  • Profile visibility
  • Commenting
  • Setting changing

Create a status widget

Display stats such as:

  • Users registered
  • Currently active users
  • Inactive users
  • Newest user sign up
  • Tips/tricks

Add event hooks in classes, models and components.

Add event hooks to:

Components

Account
  • Pre Registration
  • Logging in
  • Logging out
  • Settings load
  • Settings update
  • Post registration
Friends
  • Add friend
  • Block friend
  • Remove friend
  • Send friend request
  • Accept friend request
  • Decline friend request
  • Remove friend
User
  • Profile viewed
  • Comment posted
  • Comment deleted
  • Post search
  • Pre search
  • Pre profile view

Models

Roles
  • On role removed
  • On role added

Classes

Role Manager
  • On promote
  • On demote
  • On set role

More complete list coming soon.

Add a backend sub page (A child [submenu] of the users tab) for managing modules.

The backend page will be called 'Module Manager' and contains the following features:

  • Enable/Disable a module
  • Display version and other module meta data.
  • Locking a modules version. This will disable the module if it updates.
  • Viewing module documentation [how-to] [overview] etc.
  • Enable/Disable specific injects for each module. On/off switch for each injection type. Defaults: true.

This will also require the creation of a module_manager table for storing the settings above.

Consolidate Friends

Combine components

  • ListFriendRequests
  • ListFriends

into the component:

  • Friends

Add additional features:

  • Add friend
  • Delete friend
  • View friend (profile?)
  • Block user

Add Generic User Settings

Add features:

  • Config based settings template
  • A JSON column on the user table for settings
  • Hook into register, update for Accounts

Add better lang support

Add lang support for role/group names/descriptions etc. Utilize a lang importer by creating a separate backend page for creating and using lang.

More to come soon.

Add UserExtended settings

Add a backend settings tab including:

  • Validation rules for username/password
  • Profiles feature (on/off)
  • Friends feature (on/off)
  • Groups/Roles feature (on/off)

Consolidate User

Combine components:

  • UserGroups
  • UserList
  • UserSearch
  • UserUI

into component:

  • User

Add additional features:

  • List a single user by ID

Complete Roles

Add additional features:

  • Create groups
  • Edit group
  • Add users to role
  • Add users to group
  • Add user promotion/demotion
  • User list pagination

Cleanup the controller code.

Create a user analytics backend page

This would also link from the role manager.

This would display stats such as:

  • Users registered
  • Currently active users
  • Inactive users
  • Newest user sign up
  • Tips/tricks.
  • User timezone and location stats.
  • Most and least used roles/groups

Provide suggestions for cleaning up old users, inactive users, inactive groups/roles.

Create email templates and utilize them

Create & use email templates during the following events:

  • Register
  • Received friend request
  • Received profile comment
  • On group or role changed/added/removed

Create a Scaffolding command for modules

Create a scaffolding command in artisan in order to create UserExtended module classes.

Syntax:

  • php artisan create:uemodule clake.userextended

This creates a UeModule.php class in the plugins home directory. It will also set the module $name property to clakeUserextended.

It will auto generate the following:

  • Class definition
  • Properties: name, author, description, version
  • Injections: injectComponents, injectNavigation, injectLang
  • Trait: use StaticFactoryTrait;
  • Use and Namespace if possible.

Feature Push Back List

Pushed back features:

  • User list pagination in the backend->RoleManager
  • General plugin documentation #12
  • Component usage examples documentation #25
  • Finishing off the plugin settings implementation. Its really only half baked so far. #13
  • Split long unwieldy code into proper functions without changing any functionality.
  • Many of the classes are too loose. Improve encapsulation by utilizing private/protected where possible. #16
  • Prepare the plugin for unit testing #17
  • Add event hooks #18
  • Add a method of setting a default role for each group for when users are added to a group. #71
  • Add a method of adding users to a group other than going to the user backend and checking off their check boxes. #71
  • Use Lang #71
  • Also, on user create, add a tab to create user settings which are marked as createable. #31
  • Make injected bond states effect the application. #37
  • Add permission nodes for accessing and managing backend model interfaces. #81
  • Use Soft deletes when removing a user from a group. #34

Add soft deletes and timestamps to UsersGroups

Add soft deletes, created_at, updated_at, and deleted_at to UsersGroups.

Utilize this when removing a user from a group. Also utilize this information in Role Manager to display when a user was added to a role via 'updated_at' as well as a users group history by utilizing soft delete time stamps.

Allow other modules to inject user_settings.yaml

Add an injectUserSettings function which will import and merge another module's user_settings.yaml if it returns true. Get an array of all config options and then throw them into a merge rather than trying to merge the files.

** This must be able to be turned off on a per-module basis inside of the Module Manager page in the backend **

Have a problem with clake userextended and last october release 3.9.6

Hi,

i've installed this usefull plugin on my local machine with vagrant environment.
But when i click on Role Manager have this error:

syntax error, unexpected 'for' (T_FOR) ../plugins/clake/userextended/controllers/roles.php line 57
The line:
$groupRoles = RoleManager::for($this->vars['selectedGroup']->code);

Bye
gab

Add support for Clake.Pusher

Add support for Clake.Pusher by adding a module to the pusher plugin.

From user extended we can detect whether or not pusher is loaded as a module and if it is, utilize it to send real time notifications.

Add exceptions to User Extended

Throw exceptions at key points in the operation of UserExtended.

Key points which can't fail (but not limited to):

  • Module registration
  • User registration
  • User login

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.