[Module] Yii User Management Module

Hi Shoeb,

I’ve not used permissions, but since no one else is here I’ll try to help. It looks like you might call


Yii::app()->user->can('actionName');

Incidentally, I had a difficult time with the unit tests shipped with YUM. Since I find it easier to explore how things work with unit tests, I struggled with this a bit. I found that adding




Yum::module('registration')->enableCaptcha = false;



into the RegistrationTest.php file allowed me to use the file on the module.

You can then explore the permissions system with code like




 $this->assertFalse(Yii::app()->user->can('save'));



HTH!

many thks but i also don’t fix this error .

regards.

Hi,

I have installed yii user management module, and its working fine,

I am able to register, send activation mail and activate account.

However, I tried to set the firstVisit Parameter in User.module to the membership order page. But when I login for the first time after activating my account, I am still getting redirected to the home page, rather than the membership page.

I was trying to trace it from the YumAuthController redirect function, by adding logs:


 public function redirectUser($user) {

     Yii::log('----------Redirecting User---');

     $user->lastvisit = time();

     $user->save(true, array('lastvisit'));

     Yii::log('----------set last visit time ---');

 

     Yii::app()->user->setState('first_login', true);

     Yii::log('----------set state  first login ---');

     if(isset($_POST) && isset($_POST['returnUrl']))

       $this->redirect(array($_POST['returnUrl']));

     Yii::log('----------return url test for admin  ---');

 

     if ($user->superuser && Yum::module()->returnAdminUrl)

       $this->redirect(Yum::module()->returnAdminUrl);

 

     Yii::log('----------return url test for user  ---');

     if(isset(Yii::app()->user->returnUrl))

       $this->redirect(Yii::app()->user->returnUrl);

 

     Yii::log('----------pwd expired---');

     if ($user->isPasswordExpired())

       $this->redirect(array('passwordexpired'));

 

     Yii::log('----------return url not set for user  ---');

     if (Yum::module()->returnUrl !== '')

       $this->redirect(Yum::module()->returnUrl);

     else

       $this->redirect(Yii::app()->user->returnUrl);

     Yii::log('----------now redirect to first vist---');

     $this->redirect(Yum::module()->firstVisitUrl);

   }



The trace file shows the following trace:




2013/05/25 17:50:23 [info] [application] ----------Redirecting User---

2013/05/25 17:50:23 [trace] [system.caching.CFileCache] Serving "yum_translations_en_us_yum" from cache 

2013/05/25 17:50:23 [trace] [system.caching.CFileCache] Serving "yum_translations_en_us_yum" from cache 

2013/05/25 17:50:23 [trace] [system.caching.CFileCache] Serving "yum_translations_en_us_yum" from cache 

2013/05/25 17:50:23 [trace] [system.base.CModule] Loading "avatar" module

2013/05/25 17:50:23 [trace] [system.db.ar.CActiveRecord] YumUser.update()

2013/05/25 17:50:23 [trace] [system.db.ar.CActiveRecord] YumUser.updateByPk()

2013/05/25 17:50:23 [trace] [system.db.CDbCommand] Executing SQL: UPDATE `user` SET `lastvisit`=:yp0 WHERE `user`.`id`='21'

2013/05/25 17:50:23 [trace] [system.base.CModule] Loading "profile" module

2013/05/25 17:50:23 [trace] [system.db.CDbCommand] Querying SQL: SHOW COLUMNS FROM `privacysetting`

2013/05/25 17:50:23 [trace] [system.db.CDbCommand] Querying SQL: SHOW CREATE TABLE `privacysetting`

2013/05/25 17:50:23 [trace] [system.db.ar.CActiveRecord] YumPrivacysetting.findByPk()

2013/05/25 17:50:23 [trace] [system.db.CDbCommand] Querying SQL: SELECT * FROM `privacysetting` `t` WHERE `t`.`user_id`='21' LIMIT 1

2013/05/25 17:50:23 [trace] [system.db.ar.CActiveRecord] writing MANY_MANY data for YumUser

2013/05/25 17:50:23 [trace] [system.caching.CFileCache] Serving "yum_user_relations" from cache

2013/05/25 17:50:23 [info] [application] ----------set last visit time ---

2013/05/25 17:50:23 [info] [application] ----------set state  first login ---

2013/05/25 17:50:23 [info] [application] ----------return url test for admin  ---

2013/05/25 17:50:23 [info] [application] ----------return url test for user  ---



Please let me know why am I not able to transfer to the membership page.

Thanks and Regards,

Hi, when install on default modules application folder i got yii user module work out.

But when i try to install to common/lib/vendor/

i got


CException


Property "YumWebUser.0" is not defined. 

yiisoft\yii\framework\web\auth\CWebUser.php(160)


  public function __set($name,$value)

  {

     if($this->hasState($name))

         $this->setState($name,$value);

     else

        parent::__set($name,$value);

    }

enable short_open_tag = on; in php.ini and restart apache.

Its working fine

hi how do work Roles / Access control i see

role Demo user_admin

role Demo user_create

but demo user can not user_create and admin it

Hi,

I downloaded the package from Github as a ZIP file and implemented it, but got error message below when click ‘Privacy Setting’. Should I download the r0.8 from here?

include(YumProfileField.php): failed to open stream: No such file or directory

After install modules

Try Login /index.php/user/auth/login

admin

admin

Answer:

??!!

I completed the installation of Yii User management Module. Now I Can login as admin/admin, but can not see anyway to extend user/profile fields as there is no profile_field table created.

Any help on this issue will be appreciated.

I have problems uploading avatar. I get a password error.

Below is a screenshot.

5070

Yii_Error.jpg

So I commented out line 69 in protected/modules/avatar/controllers/YumAvatarController.php


if($model->validate()) {

and also the ending brace in line 84.

Then I got an error that directory ‘images’ does not exist. So I created the directory in YiiRoot.

Now it gives off the same password error but still uploads the images.

Please what can I do about this?

Thanks

is your password less than 16chars?

can you show the avatar configuration you have in main.php?

Yes, my password is less than 16 characters but more than 6. But I set minLength to 6 in my main.php. Below is part of my main.php config file


		'user' => array(

			'debug' => false,

			'userTable' => 'user',

			'translationTable' => 'translation',

			'enableRestfulApi' => false,

			'passwordRequirements' => array(

				'minLen' => 6,

				'maxLen' => 16,

				'minDigits' => 1,

			)

		),

		'avatar' => array(

//			'enableGravatar' => true,

		),

The funny thing is if I should comment out maxLen, I get no error and the image is uploaded.

uhm, im tryed and i got the same error…

i will see where is the error and then i will try help you

In line 70, of YumAvatarController.php, change what you have, for this:


f($model->validate(array('avatar'))) { 

(sorry for my poor english, i hope help ;) for me, that solves the problem)

Hey there, I just cant get hybridauth working.

Im still getting




Error 403

Permission denied



after a successful login. Could anyone help me out here?

never used the hybrid auth…

Your English is okay :D

But your solution does not work. The only thing that works for me is if I disable maxLen in main.php.

I notice the password error even when I try to update other user fields, such as name, not just avatar alone.

I have another question.

How can I use drop down lists and date picker in the profile edit/update views?

Thanks.

Hi,

Is there a way to use yum avatar in personal pages outside yum profil page with a userid ?

ex : yum::getAvatar(userid)

Thanks by advance,

Jok


Yii::app()->user->data()->getAvatar(true);

(the param is true for thumbnail, and nothing or false for full size image ;)