Yii Framework Forum: [Module] Yii User Management Module - Yii Framework Forum

Jump to content

  • (30 Pages)
  • +
  • « First
  • 17
  • 18
  • 19
  • 20
  • 21
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[Module] Yii User Management Module Discussion, Bug Reports and Feature Requests for the User Management Rate Topic: ***** 5 Votes

#361 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 708
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 23 December 2011 - 04:16 PM

View Postthyseus, on 23 December 2011 - 03:34 PM, said:

Imehesz: thats a good question. I don´t like automatic login upon successful registration for security reasons;
but there should be a (default off) option in Yum! Good idea! Already any ideas why your code does not work?
Nevertheless i will implement this feature and release a new version. More and more people are interested in yum, thats great! Time for a (at least) bug-free "stable" release... ;)


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
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#362 User is offline   thyseus 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 300
  • Joined: 18-April 09
  • Location:Leipzig, Germany

Posted 23 December 2011 - 06:03 PM

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.c...ce/detail?r=419
and
http://code.google.c...ce/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() )
0

#363 User is offline   Michel Kogan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 28-February 11

Posted 03 January 2012 - 01:13 PM

How can I assign email addresses as unique in registration process ? It's not unique for me !
0

#364 User is offline   thyseus 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 300
  • Joined: 18-April 09
  • Location:Leipzig, Germany

Posted 03 January 2012 - 02:40 PM

Take a look at the CUniqueValidator: http://www.yiiframew...UniqueValidator
It is also used for username unique validation. Easy and simple ;)
0

#365 User is offline   Sampa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 173
  • Joined: 18-December 11
  • Location:Stockholm,Sweden

Posted 04 January 2012 - 02:53 AM

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).
0

#366 User is offline   Michel Kogan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 28-February 11

Posted 04 January 2012 - 08:42 AM

View Postthyseus, on 03 January 2012 - 02:40 PM, said:

Take a look at the CUniqueValidator: http://www.yiiframew...UniqueValidator
It is also used for username unique validation. Easy and simple ;)


Thanks, how can i assign 2 validation method for a field ? EmailVadidator and UniqueValidator together ?
0

#367 User is offline   Joshua Conner 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 07-November 11
  • Location:Flagstaff, AZ

Posted 04 January 2012 - 08:11 PM

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!
0

#368 User is offline   PrplHaz4 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 108
  • Joined: 28-September 09
  • Location:Boston, MA

Posted 04 January 2012 - 09:04 PM

View PostMichel Kogan, on 04 January 2012 - 08:42 AM, said:

Thanks, how can i assign 2 validation method for a field ? EmailVadidator and UniqueValidator together ?


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
		);
	}


1

#369 User is offline   Michel Kogan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 28-February 11

Posted 05 January 2012 - 05:08 AM

View PostPrplHaz4, on 04 January 2012 - 09:04 PM, said:

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 !
0

#370 User is offline   Ashutosh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 21-December 11

Posted 09 January 2012 - 06:57 AM

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!!!
0

#371 User is offline   Agile Ace 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 09-January 12

Posted 09 January 2012 - 09:44 AM

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!
0

#372 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 363
  • Joined: 23-July 09

Posted 14 January 2012 - 12:56 AM

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?
We were all once expert at....... nothing.

yii-language-behavior

My Blog
0

#373 User is offline   vision 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 14-May 11
  • Location:Berlin / Germany

Posted 14 January 2012 - 01:08 PM

Attached File  table_names.png (150.72K)
Number of downloads: 19

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
0

#374 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 363
  • Joined: 23-July 09

Posted 14 January 2012 - 06:23 PM

View Postvision, on 14 January 2012 - 01:08 PM, said:

Attachment table_names.png

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?

Word Of Warning!

If you already have other modules in your application, expect them to disappear when you install this... thats just insane!
We were all once expert at....... nothing.

yii-language-behavior

My Blog
0

#375 User is offline   Backslider 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 363
  • Joined: 23-July 09

Posted 15 January 2012 - 12:10 AM

View PostJoshua Conner, on 04 January 2012 - 08:11 PM, said:

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!


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).
We were all once expert at....... nothing.

yii-language-behavior

My Blog
0

#376 User is offline   thyseus 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 300
  • Joined: 18-April 09
  • Location:Leipzig, Germany

Posted 16 January 2012 - 04:16 AM

@Backslider:

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.yiiframew...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.c...ser-management. Just drop me a line and you get svn commit access ;)
0

#377 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 708
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 17 January 2012 - 09:40 PM

View Postthyseus, on 23 December 2011 - 06:03 PM, said:

Hi imehesz,

after playing around a little i came to this conclusion:
...



sorry, I just realized I haven't answered your question ... your solution is working, thank you :)

--iM
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#378 User is offline   NetDabbler 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 17-January 12

Posted 20 January 2012 - 07:27 AM

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

0

#379 User is offline   thyseus 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 300
  • Joined: 18-April 09
  • Location:Leipzig, Germany

Posted 20 January 2012 - 09:07 AM

thanks NetDabbler, i added your workaround to the FAQ.
0

#380 User is offline   Hoss 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 30-January 12

Posted 30 January 2012 - 02:18 PM

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?
0

Share this topic:


  • (30 Pages)
  • +
  • « First
  • 17
  • 18
  • 19
  • 20
  • 21
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users