Basic User Management (BUM) module aims to be a simple and easy to use module, but in the same time a powerful one in managing users. The module does not intend to "reinvent the wheel", so whenever a task not related with user management is needed, it make use of other great modules (like yii-mail and/or RBAM). This module has a simple and intuitive administration panel and response to basic user administration needs. Enjoy it.
Feedback is welcomed. :)
Requirements ¶
- Require Yii 1.1 or above.
- yii-mail extension
What BUM has to offer ¶
- users login (using their user name or email address);
- facebook users login;
- twitter users login;
- associate facebook logIn to an existing user;
- associate twitter logIn to an existing user;
- user status code (block user access, facebook only, twitter only, normal, special...);
- activate/deactivate user (users may activate their account by email, clicking on an activate link );
- manage user (create/update/delete users);
- view all users (in two different ways);
- singUp;
- invite friends;
- user profile;
- user private profile;
- customize some settings (like: allow users to log in if they are not active; is signUp enabled; customise invitation email .... );
- password reset syste;
- resend activation link;
- associate many emails to an user account (with email verification);
Usage ¶
- Download and extract the extension package to protected/modules/bum directory of your application.
- See the documentation at :bum online documentation for more configuration options and a short installing tutorial.
- From v3 facebook login is enabled; insert facebook login button by using BUM widget:
$this->widget('facebook_app', array(
'appId'=>Yii::app()->getModule('bum')->fb_appId,
'secret'=>Yii::app()->getModule('bum')->fb_secret,
'text'=>'Sign in with <b>Facebook</b>',
'target'=>'_self',
));
in settings you may save your facebook appId and secret.
- twitter login is enabled; insert twitter login button by using BUM widget:
$this->widget('twitter_app', array(
'text'=>'Sign in with <b>Twitter</b>',
'target'=>'_self',
));
in settings you may save your twitter customer key and secret.
Resources ¶
- social demo page: http://social-test.infoprofessional.ro
demo page: http://bum.infoprofessional.ro (user name: admin password: admin and user name: demo password: demo)
Yii forum page at: http://www.yiiframework.com/forum/index.php/topic/38557-bum/
This extension is also available on github.com https://github.com/6firefly/BUM (starting with V2)
Change log ¶
2013-09-04
- twitter login button; DATABASE CHANGES
2013-09-02
- show if users enabled facebook logIn (on: Manage Users, View all Users and View Private Profile pages)
2013-08-29
- main update: add FACEBOOK login button DATABASE CHANGES
- other small updates...
2013-07-19
- add the possibility to customize email sent by this application (new button in settings area). see: DATABASE CHANGES
2013-06-03
- minor improvement: add a property that allows to update DATETIME statistical fields without the use of triggers;
- minor BUG fix: please in all tables where TIMESTAMP is defined as not null, ALTER table to make it default as NULL and with no ATTRIBUTES or EXTRA... (DATETIME fields are used just for statistical reasons so no harm if nothing is done);
2013-05-31
- fix script src links (to point at the last sql version; in install tutorial)
- focus on the user name in logIn page
2013-05-21
- add password reset capability; A user can reset his/hers password base on user name (or email address), a captcha and a verification email with secret a code. see: DATABASE CHANGES
2013-04-04
- fix "setting load" bug; (settings were not loaded form the database)
- add new column to the settings table; see [DATABASE CHANGES](http://bum.infoprofessional.ro/index.php?r=bum/install/upgrade&v2_to_v202 "DATABASE CHANGES")
2013-04-03
- Add password_change right: With this right user can change the password without knowing the old password.
- On install defaults operations/tasks/roles can now be updated, not only created! (This thing is useful if a new operation/task/role has been created.)
2013-03-05 - Version 2 is available; Major improvements: invitations, see demo pages..
2012-12-08 - Modify php code to be compatible with php versions older than 5.4.
Heads Up
Hi, just to let you know, your instructions are incorrect:
"Download and extract the extension package to protected/extensions/bum directory"
Should be protected/modules/bum
Also at install on clean latest Yii I get this error:
"Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\bum\protected\modules\bum\controllers\InstallController.php on line 126"
This looks interesting though, good luck.
bum update 001
Should be protected/modules/bum>
Thanks for feedback. The application should work now work.
Also some improvements were made in the way the system messages are displayed.
Can't unzip
Good morning. I'm on a Mac, OS X 10.6.8 (Snow Leopard). I downloaded the extension, but when I try to unzip it, I get an error:
"Unable to unarchive bum.001.u002.zip - Error 1, Operation not permitted".
Is this download only extractable on PC's?
Thanks in advance for any feedback!
MK
unzip
Hello mikeklon,
the zip file was compressed on a windows 7 machine, but should work on all OS. I downloaded the zip file and extract it, and it worked; I don't have a Mac, so I have no way to test it, but I searched the net and I found this:
well, try The Unarchiver and see if it's working...
TRIGGER Problem ?
Hi, I'm testing this module.
It's strange but the application hangs and didn't receive any message.
I restart Apache and /or Mysql and start again.
Could be the triggers ?
Why not using the beforeInsert method ?
Best regards
triggers
I think that triggers are faster and use less resources then beforeInsert event and anyway without triggers only some statistical datetime fields remain empty...
Have you respected all steps from the installation tutorial?
tutorial
There is no message in the runtime/application.log file?
hm... I have just discovered that on the tutorial page the link to the Mysql (and PostgreSQL) script file was pointing to the wrong file; it's updated now; please try now with the new script file and see if it's working (new MySQL script file)
good to know
How to redirect users to a certain URL after logIn?
please see this forum post:
BUM - redirect user after logIn
Thanks fireFly
Thanks, i'll try the new install sql file.
And to let you know that, yes, i run the install process several times and when I click on "Create User" the application hangs, Or never answer...
I DROP all the triggers ans start working, I'm using XAMPP 1.7.3,
-- mySQl:
Versión del servidor: 5.1.41
Versión del protocolo: 10
-- Apache:
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
now I'll try to ADD RIGHTS extension ... wish me luck !
Best regards
triggers
I have no idea why your application hangs when triggers are used... (maybe some MySQL rights or so), but anyway xNicox I have updated the extension so that the same behaviour is obtained without triggers, all you have to do is set db_triggers property to false; so in config/main.php:
// Basic User Management module; 'bum' => array( ... 'db_triggers'=>false, ),
If triggers are not used (db_triggers = false) then DATETIME fields are updated in beforeSave() method..
triggers
Thanks firefly, i'll give it a try !
Best Regards
integration with yii-Auth
hi, again, I'm trying to use this extension with Auth module.
But I have an issue on "user" component.
Both modules ( bum and Auth ) overrrides "User" class component, and when I configure it for Auth, BUM doesn't work , and when I configure it for BUM, Auth doesn't work.
This is Auth configuration:
'user' => array( 'class' => 'auth.components.AuthWebUser', 'admins' => array('admin', 'foo', 'bar'), // users with full access ),
This is BUM configuration:
'user'=>array( ... 'class' => 'BumWebUser', 'loginUrl' => array('//bum/users/login'), // required ... ),
Any suggestion ?
I don't know if ok if BumWebUser class extend AuthWebUser ? or viceversa ?
Best Regards
user permission extensions
1.
I see no problem in extending BumWebUser from AuthWebUser of Auth extension or the other way around, but at updates you should always be careful to do it again..
For now BumWebUsers has some methods: getStatus(), getPrimaryEmail(), getActive(), getStatusText(), loadUser() that are in no conflict with AuthWebUser class methods: getIsAdmin(), setIsAdmin(..), checkAccess(). So give it a try and tell me how it works..
2.
If you do not want to have problems with updates, you might try something like multiple inheritance and create your own User class..
3.
Or you could also try the RBAM extension, I'v tested BUM and RBAM and are working fine...
RE: user permission extensions
hi fireFly,
I extended Auth WebUserClass with to BWebUser and it work for now.
The reason I choose Auth extension is because is one that include a "Filter", so whenever I start to create controllers in my app, I just change template and and a line on filter method. And I have the authorization module ready to run !
I found two extension that have filter methods; Auth and Crudge.
Rights and RBAM, I think it don't have it.
Of RBAM I'll miss automatic auth generation.
Best regards
PS: Sorry for my english.
github
I am thinking to move the download files exclusively on github.com
see: https://github.com/6firefly/BUM
CDbCommand error on initial install
I downloaded and installed the module (bum.v3.02.zip) and then the yii-mail extension per the instructions on a fresh Yii installation, then ran the prescribed MySQL scripts. After modifying protected/config/main.php and protected/views/layouts/main.php as prescribed by the instructions, then trying to load the page, the following error is being thrown:
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xE2\x80\x8F' for column 'subject' at row 1. The SQL statement executed was: INSERT INTO site_emails_content (name, subject, body, available_variables, version) VALUES(:name, :subject, :body, :available_variables, :version)
I get the same error setting 'install' to both true or false.
MySQL version is 5.6.13
There are three entries in the site_emails_content table, namely sender_invitation, _signUp, and _registerNewEmail.
Is this coming from the yii-mail extension or the bum module? I've run out of ideas on what to try or where to look next. Did I download the correct file? Any help is appreciated.
Thanks, Mike K.
CDbCommand error
I suppose you don't have UTF-8 collation set for your tables in database. Check database default collation (should be UTF8), then table collation and collation of column "subject" in table "site_emails_content".
I hope this helps..
SuperAdmin roles
@firefly
Thank you for your suggestion on the CDbCommand error. Your solution seems to have cleared the CDbCommand error. From the error message, I would never have known to check the collation. How did you know the problem was there?
I'm now kind of stuck on step 4 - setting up the roles for SuperAdmin. Is that done in the accessRules method or somewhere else? Might there be step-by-step instructions for that?
Thank you again for all the help. Best regards,
Mike K.
roles, tasks and operations
@mikeklon
Step 4 should be easy; click on the "create/update role/tasks/operations" link, just at the end of step 4 paragraph. The required roles, tasks and operations would be automatically created by the application, vie an AJAX call. (install property should be set to true for this step to work.)
Same is true for step 5: if you click on "create default users" the default users would be automatically created (user: admin; password: admin as SuperAdmin and user: demo with password: demo as a regular user).
BUM does not aim to be a Role-Based Access Control Manager, but yii has a lot of extensions that are doing just this, in case you wish to customise your users rights.
As for CDbCommand error, I gooled for "\xE2\x80\x8F" :) and I found that in UTF-8 it is RIGHT-TO-LEFT MARK character, and I also found this post that treat the same problem :p ...
10x for feedback; hope that this extension will help you.
Step 4 and 5
@ firefly:
roles, tasks and operations
Thank you for the feedback on how to do Step 4 and 5. I must have unwittingly done just that because subsequent to posting my note, I was able to login as admin/demo and perform the expected operations. Bravo for including the links.
Just as feedback, it was not intuitive (at least for a rookie like me) as to what I was supposed to do on those steps. Perhaps update instructions:
Insert a new step 4 where you say: modify the main menu as shown in your example at the bottom of the page, then launch the site, www/webroot/<name of site>. Move the current step 4 to step 5, current step 5 to step 6, etc.
The real feedback here is that I didn't realize I was supposed to be running the links from my own web page, although in hind site -- duh! Maybe I'm being too picky! LOL
Thank you again for all your help! Bravo again. Good Luck!
Now I have the task to integrate this nice module with an existing app. Do you have any suggested reading or perhaps know of a step-by-step example or tutorial? I have been through the blog tutorial and User Auth stuff.
p.s. I thought I had posted this response previously on 10/1/13, but it never showed up so if this is a duplicate - I apologize.
Best regards,
Mike K.
Facebook & Twitter
I was able to get the BUM working. Its available at bum100.mikeklonecki.com if you want to see.
Now I know virtually nothing about Facebook and Twitter. When I click those buttons (on the login page), some weird results are displayed. Clicking the Facebook link returns:
unknown app ***.
Try the example at bum100.mikeklonecki.com
It just so happens that *** is what is entered for Facebook (and Twitter) on the Admin->Settings page (by default).
My question is what do I need to do to get those to work? Do I need to modify those fields and if so, what goes in?
Thanks again for helping out a rookie.
facebook & twitter
@mikeklon
Register to facebook, go to https://developers.facebook.com/apps, create a new app. After completing the required form, you will receive an "App ID/API Key" and a "App Secret". Insert those two in: Settings (bum/settings/batchUpdate) of BUM module, in "Facebook App ID" and "Facebook secret" fields.
For twitter: go to https://dev.twitter.com/apps, create a new application, and after completing the form, you will receive a "Customer key" and a "Consumer secret"; this should be inserted in: Settings (bum/settings/batchUpdate) of BUM module, in "Twitter Consumer key" and "Twitter customer secret" fields.
As for integrating this module with an existing application, I don't really understand your request; if you have successfully installed BUM with a fresh new yii app, then I suppose that you should follow the same steps for an existing application...
10x for feedback ;)
Integrating BUM
@firefly
Thank you very much for the FaceBook and Twitter explanation. Bravo once again.
Regrading my "integration" question -- the BUM module tables have specific fields for each user that can be updated by that individual user (password, name, email, etc). However I have an existing design with an existing user table and model with additional fields unknown to BUM. I would like a user to be able to update those as well.
Should I extend and/or modify the existing BUM class(es), modify the existing user_data table and model, or employ some sort of filter in the existing models/controllers to incorporate different table data with the BUM module. Is there existing documentation or tutorial for accomplishing this cleanly?
xNicox mentions extending Auth with BWebUser in post #13543. I wonder if s/he would share his/her procedure and or design thoughts?
Thank you again for all your help. You have been terrific!
Adding New Data to a User
@mikeklon
Does this article answer your question?
http://www.yiiframework.com/wiki/574/bum-add-additional-info-to-a-user/
Resend Confirmation / Reset Password Errors
@firefly
Thank you for the reply about Integrating BUM and for posting the "How-to". I was hoping for something different, but I think you answered my question about what is available. I'm going to put this issue on hold for a bit. I want to do some experimenting and research on my own and I'll give you feedback later. I don't know how fast that will come -- might be a while. I'll move this thread to the forum.
In the meantime, I tried to use the Resend Confirmation Email (on the SignUp form) and Reset Password (on the Login form) buttons. Both are giving unexpected results. See errors at:
User Registration Demo
(I will move the rest of this comment to the forum as well.)
new feature
After successfully signUp (on activation) a thank you email is sent to the new user.
In settings you may enable or disable this feature. (see last version on github: https://github.com/6firefly/BUM)
Transport Options
Hi,
Do I need to set transportOptions anywhere? I've followed your installation tutorial. If I try sending an invite (for example) I get the message "page at localhost says invitation sent" but nothing gets to gmail (that I'm using as the host).
I double checked by running yii-mail in isolation and it works fine, so I'm wondering if I'm missing anything?
Many Thanks
Transport Options
Well if you want to change the transportOption of yii-mail module, when include this module in your application (see step 3) just set this option as you like:
step 3:
// autoloading model and component classes 'import'=>array( ... 'ext.yii-mail.YiiMailMessage', // module yii-mail is required in order to sent confirmation email to the users 'application.modules.bum.models.*', 'application.modules.bum.components.*', ), ... 'modules'=>array( ... // Basic User Management module; 'bum' => array( // needs yii-mail extension.. 'install'=>true, // true just for installation mode, on develop or production mode should be set to false ), ... ); ... // application components 'components'=>array( ... 'user'=>array( ... 'class' => 'BumWebUser', 'loginUrl' => array('//bum/users/login'), // required ... ), ... 'authManager'=>array( 'class'=>'CDbAuthManager', 'connectionID'=>'db', ), ... // required by bum module 'mail' => array( 'class' => 'ext.yii-mail.YiiMail', // module yii-mail is required in order to sent confirmation emails to the users 'transportType' => 'php', 'transportOptions'=>array( 'host'=>'smtp.gmail.com', 'port_secure'=>true, 'enc_tls'=>true, 'username'=>'XXXXXXX', 'password'=>'XXXXXXX', 'port'=>587, ), 'viewPath' => 'bum.views.mail', 'logging' => false, 'dryRun' => false, ), ... ),
If you want to see how BUM is sending invitation emails, check the following code:
bum/controllers/InvitationsController.php line 156 sendInvitationEmail($model) and lines 122, 123 of actionAJAXCreate($processOutput = false).
The message displayed by bum module when email was successfully sent is: "Invitation sent!"; there is no "page at localhost says invitation sent" message.
Transport Options / Send Mail Error
Hey firefly, thanks for your fast response.
So I guess by the tone of your response that you don't normally get asked this question ... this leads me to think that I'm asking the wrong question (plus I've tried your suggestion and Bum still fails to successfully send mail).
Maybe I should rephrase it ... I've performed a normal install (as your guidelines) currently running on XAMPP which successfully passes SMTP mail onto gmail. What steps should I now take to try find the issue.
may thanks
invitation email
Dear Giles,
Sorry about the tone, it's just that I think that the problem is not related to BUM extension. Basically what configuration you have made to yii-mail in that separate project, the same configuration you have to do within BUM project.
I highlighted where BUM is using yii-mail (for sending invitation emails) in order to see if maybe you had a different approach and there is something that can be changed. I have tested the extension (and you can tested it as well at: ) and it's working.
Maybe you should double check XAMPP configuration. Locally, for example, in my development environment, emails are sent/printed in C:\xampp\mailoutput folder. (in php.ini see line:
; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:\xampp\mailoutput folder sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe"
)
Links are not working
Hi Friend, The links related to http://bum.infoprofessional.ro are not working. If you can, please fix it!
Tks
bum
Hi @Anibal,
Yes the site was offline with some problems, I have restored the main part, so now the installation guide is now online again: http://bum.infoprofessional.ro/index.php?r=bum/install but you do not have a demo user anymore on this sub-domain.
Anyway you may check http://social-test.infoprofessional.ro/ for testing....
User Identity
Hi,
I'm wondering how to add more information to Yii::app()->user.
For example, I have another table with a user_type parameter related to the authenticated user. I was using something like this:
http://www.yiiframework.com/wiki/6/how-to-add-more-information-to-yii-app-user/
Now I can't see where to put this kind of information. Does bum uses the UserIdentity class for authenticating?
Regards,
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.