[Module] Yii User Management Module

It fixed the problem for this field but now there is the same error for a different field:

CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field ‘hint’ doesn’t have a default value

there has to be some strictness option in your sql configuration. Installation still runs fine.

I added some more ‘Default …’ lines to the installation controller. Maybe it works now.

I’m afraid there is a new error :




CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB/TEXT column 'hint' can't have a default value


C:\xampp\htdocs\new_base_yii\protected\modules\user\controllers\YumInstallController.php(382): [b]CDbCommand[/b]->[b]execute[/b]()							    

377                         	`related_field_name` varchar(255) DEFAULT NULL,378                         	PRIMARY KEY  (`id`),

379                         	KEY `varname` (`varname`,`visible`)

380	                             ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; ";

381 

382                     	$db->createCommand($sql)->execute();

383 

384                     	// Create Profiles Table

385                     	$sql = "CREATE TABLE IF NOT EXISTS `" . $profileTable . "` (

386                         	`id` int unsigned NOT NULL auto_increment,

387                         	`user_id` int unsigned NOT NULL,



please try to install using the user/docs/fresh_installation.sql file. This is a dump of a installed

yii-user-management. I extracted this directly from phpmyadmin so it really should work!

The SQL file worked, thank you.

The application still looks like it looked before the installation (attached a screen shot), is it suppose to be that way?

how do users register, where do I menage the profiles and so on?

Thanks

replace the site/login with user/auth or user/login in the URL and there you go.

the site/login link needs to be replaced in the views/layouts/main.php file so the button also works.

same goes for the logout function.

demo/demo and admin/admin are the default demo users, like before.

for everything else, see the docs/ directory or ask here ;)

Hello everyone,

i’m testing and trying yum but i ran into a problem about the avatar upload.

The thing is that it seems to me like the EPhotoValidator->validateFile() is being called twice when i try to upload an image avatar.

First time it goes okay, second time it fails as


$info = @getimagesize($file->getTempName()); 

is returning false (temp file doesen’t exist anymore as it has been already moved).

I can’t figure it out why it is being called twice, any help would be greatly appreciated.

Thanks in advance!!

Hi all,

i think a found the solution to the problem previously submitted:

in YumAvatarController on line 37:


if($model->validate()) {

triggers the validation of the model, then on line 44:


if($model->save()) {

triggers that validation again. It fires an error as i explained in the previous post.

Changing that to


if($model->save(false)) {

solved the problem.

I’m still intrested in knowing if i missed something or if you find something wrong in the way i proceded.

Thanks!

Did you get a response to this error?

I traced it to activeLabelEx() call in /modules/user/views/user/profile-edit.php line 42.

I see the profile view, but can not edit it.

Thanks.

Thank you. Fixed my problem. I wonder why the bug is still in the code?

On the login screen, if you click on ‘lost password?’ link, enter an email address, and click restore. You’ll get an error message: Error 500 Table “users” does not have a column named “email”.

The trace indicates an error in /protected/modules/user/models/YumUserRecoveryForm.php(41):

The current code @line 41 is




$user = YumUser::model()->findByAttributes(array(

	'email'=>$this->login_or_email));



The email field in in the profile table, to fix the error, I made the following change:




$profile = YumProfile::model()->findByAttributes(array(

       'email'=>$this->login_or_email));

$user = YumUser::model()->findByPk($profile->user_id);



It worked for me.

Hi, thyseus,

i faced with the task to embed your module userd admin section into my module.

I think about two ways: the first is about to make yii-user-management a submodule, i mean insert your module into my backend module, and the other way is to embed your module admin interface into my backend while yii-user-management will be top level module as my backend. The second way is closer for me.

But i’m looking for ways to realize this idea, don’t know from where to start.

Hi, i’ve got the error after latest checkout, when trying to open statistics page:

include(YumRole.php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory

hey serzzhio,

at the moment i am moving all the "functionality" of yum out of the core into submodules. Please read

the new docs/install_tutorial.txt on how this works. Yum is -->bloated<–, and this is an effort

to handle all this dozens of features.

You can pick which submodules you need in your application, and simply deactiveate/remove the others.

If this "movement out of the core" is "done", i will prepacke a 0.8rc2. If this has no serious bugs, i

will consider it stable and release the 0.8. A fresh, new forum thread will come with that… already

page 14 here, whoah!

@seed: thanks for reporting, watch the latest SVN to see all these bugs fixed ;)

Hi, thank for a long waited response :)

I’ve noticed a few bugs at some files. As example - absence of:

1._isset() function at YumModule.php,

  1. some $enableXxxxxx properties at YumModule.php,

  2. tableName() functions in few modules (i think that there should be an universal tableNameResolver like bahaviour)

P.S.: after latest checkout all my auth algorithms broken down

Hi,

Thanks for module.

I am getting problem in using the data of current user

I have tried


Yii::app()->getModule('user')->user()

to get the details of current user but fail.

It gives the error that this method is not defined in Yum.

Got it using




Yii::app()->user->data()



You should update documentation while updating your code.

Anyway

Nice ext.

Thanks

Hi,

Really like the look of this module/modules and think it has great potential but at the minute its just practically unusable with so many bugs. Now im definately not claiming i could do any better and am willing to help fix the bugs i find (although im still learning Yii). Should i submit the bugs on the google svn site or on here? Heres the ones ive found already with the 0.8rc2 version. These are my suggested initial fixes and im sure arent the best way to do it but i just hate complaining without at least giving suggestions! My main worry with just replacing them locally is that they will get overwritten again when i update.

ISSUE 1: If tables are prefixed with tbl_ then Users>Adminstration gives

The relation "roles" in active record class "YumUser" is not specified correctly: the join table "user_has_role" given in the foreign key cannot be found in the database.

FIX 1: YumUser.php


'roles' => array(self::MANY_MANY, 'YumRole', 'tbl_user_has_role(user_id, role_id)'),

ISSUE 2: Viewing the profile for demo account (and others) /profile/profile/view/id/2 clicking on Add as a friend gives error 404

FIX 2: ??

ISSUE 3: Profiles>Show Profile Visits gives: Property "YumProfile.profile_id" is not defined.

FIX 3: Change id in the profiles table to profile_id or change the field in YumProfile.

ISSUE 4: Messages>Send Message Notifier Email YumMessagesController cannot find the requested view "send_digest".

FIX 4: Create view in modules.messages.views.messages.send_digest.php

ISSUE 5: Module Text Settings generates text_registration_header missing error

FIX 5: I ran in the fresh_installation.sql rather than running the install script. Think this needs added to modules.user.controllers.YumInstallController

ISSUE 6: MISC>Upload Avatar for Admin ERROR 404

FIX 6: Change modules.user.components.YumAdminMenu.php from


array('label' => 'Upload avatar for admin', 'url' => array('//user/avatar/editAvatar'))

,

to


array('label' => 'Upload avatar for admin', 'url' => array('//avatar/avatar/editAvatar')),

ISSUE 7: There doesnt seem to be any foreign key constraints defined in the tables at all. Is this intentional? Seems unusual.

Like i said happy to help if you like. :)

Alternate Table Names…

I just installed the latest release from yesterday. Seems that no matter what changes I make within the module or in my main config file I can not get it to recognize my alternate table names that I defined during the install.

Can someone point me in the right direction here to using custom table names?

Dropdownlist…

Using create profile field, I tried creating a profile field with a dropdownlist. This causes an error when trying to render the page.


include(<new field name>.php): failed to open stream: No such file or directory 

Thanks

Hello,

I really like the user management module, Thank you Thyseus! I am having trouble trying to add a DropDownList to the profile fields although I am still new to Yii and am trying to get the hang of it. In the Create Profile Field page it says to see the documentation about DropDownList but I could not find it in the documentation. So here is what I did: I am trying to add a simple gender option, Male or Female. I created a new table in the database with id, gender, and user_id FK references users ‘id’ and made my CRUD and Model generator in Gii using this and then moved those files to the yii user management extension. I am able to create the field on Create Profile Field page but when I go to update a user data, the drop down list is blank. Any suggestions? Thank you.