the problem is, it works for me and about 80% of the people but for some, it just doesn’t do the auto-login, so it’s really hard to debug. I’ll place some trace or log calls around it and see what’s going on
thanks anyway,
–iM
the problem is, it works for me and about 80% of the people but for some, it just doesn’t do the auto-login, so it’s really hard to debug. I’ll place some trace or log calls around it and see what’s going on
thanks anyway,
–iM
Hi imehesz,
after playing around a little i came to this conclusion:
YumUserIdentity:
// Authenticate the user. When without_password is set to true, the user
// gets authenticated without providing a password. This is used for
// the option 'loginAfterSuccessfulActivation'
public function authenticate($without_password = false)
...
if($without_password)
$this->credentialsConfirmed($user);
function credentialsConfirmed($user) {
$this->id = $user->id;
$this->setState('id', $user->id);
$this->username = $user->username;
$this->errorCode=self::ERROR_NONE;
}
and in the YumRegistrationController:
if($status instanceof YumUser) {
if(Yum::module('registration')->loginAfterSuccessfulActivation) {
$login = new YumUserIdentity($status->username, false);
$login->authenticate(true);
Yii::app()->user->login($login);
}
$this->render(Yum::module('registration')->activationSuccessView);
}
else
$this->render(Yum::module('registration')->activationFailureView, array(
'error' => $status));
You can watch these new function in action at
http://code.google.com/p/yii-user-management/source/detail?r=419
and
http://code.google.com/p/yii-user-management/source/detail?r=420
Please let me know if it works for you this way - thx in advance
Is this a security risk? i THINK not, but i am not 100% sure. Please tell me if i am doing something very wrong here !!!
(please note that the user gets logged in after ACTIVATION automatically, not after REGISTRATION!..
But if you dont need activation you simply move the code block to actionRegistration() instead of actionActivation() )
How can I assign email addresses as unique in registration process ? It’s not unique for me !
Take a look at the CUniqueValidator: http://www.yiiframework.com/doc/api/1.1/CUniqueValidator
It is also used for username unique validation. Easy and simple
First of all, Thank you Thyseus for a really great and usefull extension.
On my site I have 4 roles representing 4 levels of access.
My dilemma is that currently i have to do:
if(Yii::app()->user->hasRole('Moderator')||Yii::app()->user->hasRole('Owner')||
Yii::app()->user->hasRole('author')||Yii::app()->user->hasRole('publisher')){
echo *link to controller/create*;
}
Then add another if(){} for the link to controller/update and a third for controller/delete (removing one role for update and 2 for delete)… and I have currently 5 places I would have to do this check…It will be alot of code for something that simple.
So I’ve been trying to make Yum and Rights work together for the last 4 days. I’ve managed to get both of them working by themselves, but never together completely.
So I would appreciate any help I can get on how to configurate Yum to make it work with the rights rbac module.
This is the only thing I’ve managed to trace down myself, Yum wants me to use this setting:
'components'=>array(
'user'=>array(
'class' => 'application.modules.user.components.YumWebUser',
But rights demands that I use ‘class’=>‘RWebUser’;
I suspect there is more things that has to be modified but I’m not experienced enough to figure it out,only used yii for a couple of weeks, don’t know so much about how it works.
I’ve heard about people using both so I know it is Possible but cannot find a step-for-step guide, only solutions for one or two problems.
(it would be so amazing with a blog demo with both installed).
Thanks, how can i assign 2 validation method for a field ? EmailVadidator and UniqueValidator together ?
Hello,
I can’t seem to figure out how to delete profiles. There’s no ‘delete’ action for profiles (which is probably a good thing, as you wouldn’t want someone to delete a profile that still has a user associated with it), and deleting a user doesn’t do anything to that user’s profile either. There’s a boolean ‘status’ column in the profile table, but it never seems to be set to anything but 1. Am I missing something?
Thanks!
In the model rules you can define two validators…one on each "line" (as separate array members)…
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('email', 'EmailValidator'),
array('email', 'UniqueValidator'),
///....etc
);
}
I know that , but in the database and table "profile_fields" there is only one column with name "other_validator" and I set it to CEmailValidator. BTW I add unique rule manually in the YumProfile.php !
Hello,
I tried, YUM module with facebook connect from google code. code works fine! I got the button, but after clicking on button i got the error
SiteController does not have a method named "creatUrl".
my sitecontroller dosent have any createUrl method… and according to code, it will redirect to createUrl method with parameter ‘user/auth/login’ .I dont understand what exactly going on … Plz anyone can help!!!
Thanks in advance!!!
Hi all,
I’m VERY new to the YII framework. And, apologies if this questions has been asked before.
My application already has a table in the database, where I store the accounts for my application users. Is it at all possible to have the YII User Module to interface to my existing table, for authentication, etc?
Thanks!
Very simple question: Why are these modules so difficult to get to run?
First, what’s with all the {{table_name}}? they all throw a “table not found” error. Yes, I did include ‘tablePrefix’ => ‘’, in my db config.
The standard Yii code is:
public function tableName()
{
return 'table_name';
}
Thats it!
remove the above nonsense and then we get errors like:
YumProfileController cannot find the requested view "application.modules.messages.views.messages.new_messages".
Error upon error upon error, far too many to try and list. Followed install docs to the letter.
Really, could you please package a WORKING version of this?
2442
there is a missmatch in some table names after install. look in models and change table names in mysql
naming like the attached schema will work
also look if here are all tables and correctly filled with data
then it run
Yeah, I got it running… but its a pain when such simple things are wrong.
Next question is: Why the **** do we have plain stupid URLs like this?
index.php?r=registration/registration/registration
Why does this module not correctly redirect to the requested page after login?
Don’t get me wrong, its a very useful module, just seriously needs to be forked.
edit Just looked at your PNG of the database structure… man! Why do we have INT(10) and INT(11) ID columns?? Wouldn’t you suppose that if I am serious I may well want foreign keys?
[size="6"]Word Of Warning![/size]
If you already have other modules in your application, expect them to disappear when you install this… thats just insane!
Joshua - probably the simplest solution is to add some foreign keys to your tables, then when you delete a user everything else that should be deleted is done so by MySQL (assuming you are using MySQL).
Deleting a user sets its status to ‘removed’. This function can be overridden in the module configuration.
The option is called ‘trulyDelete’ (UserModule.php):
// Set this to true to really remove users instead of setting the status
// to -2 (YumUser::REMOVED)
public $trulyDelete = false;
The Urls can also be configured in the application configuration, see
http://www.yiiframework.com/doc/guide/1.1/en/topics.url
for example
‘registrierung’ => ‘//registration/registration/registration’
this long url is a product of the default yii url schema <module>/<controller>/<action>
I will create a new package of the current svn state today. Much has been fixed (for example the table name mismatch mentioned by vison), and
Gravatar support has been coded into the avatar submodule.
Oh, and if you want to fork yum - no problem. But i would prefer if you would contribute to the yum svn at http://code.google.com/p/yii-user-management. Just drop me a line and you get svn commit access
sorry, I just realized I haven’t answered your question … your solution is working, thank you
–iM
Hi everyone,
Windflaw reported on the extension page the following installation error when trying to create the user_group table:
General error: 2014 Cannot execute queries while other unbuffered queries are active
I had the same problem and tried several tips recommended on this site and stackoverflow.com. Nothing worked and I thought I’d check the previous SQL command. I discovered the INSERT into the translation table was not completed - I had 1680 rows when it should have been 2275 rows.
I commented the folowing lines in YumInstallController.php
// $sql = file_get_contents(Yii::getPathOfAlias('application.modules.user.docs') . '/yum_translation.sql');
// $db->createCommand($sql)->execute();
and the extension installed successfully. I then inserted the translation data manually in a cmd window as:
mysql -u yourusername -p testyum < yum_translation.sql
thanks NetDabbler, i added your workaround to the FAQ.
I’m trying to install this module and I can’t get past step 5, when I do the index.php?r=user/install nothing happens. I’m using yii-user-management_0.8rc5 with Yii 1.1.9 - any ideas?