thyseus / yii-user-management

a user management module collection for the yii framework
186 stars 122 forks source link

Install Issue ... or maybe paths? #188

Open scribbly opened 10 years ago

scribbly commented 10 years ago

Sorry about this noob question, but I've installed fine, except I think I must have the paths wrong as I'm getting: Error 404 Unable to resolve the request "profile/profile/view/id/1".

When trying to view a profile.

scribbly commented 10 years ago

OK: I've started again and this time left the protected folder where it was created and reinstalled the module.

Now I'm getting "Alias "ProfileModule.controllers.YumProfileController" is invalid. Make sure it points to an existing directory or file." when clicking on the link in user/user/index.

and I'm getting a 403 when trying to access /user/user/admin after logging in as admin/admin

thyseus commented 10 years ago

This sounds like you forgot to 'mount' the profile submodule into your config/main.php 'modules' section. Did you follow the instructions in the README.md file?

scribbly commented 10 years ago

Thanks for your reply thyseus: appreciated!

To answer, well, I thought I followed the instructions, but obviously not understood correctly?

I believe I did add the modules correctly, from memory the install script gave the basics? I can post when I get back home if you like...

BTW: I did try and install with Composer, but I couldn't get the version required correct.

scribbly commented 10 years ago

OK, back home...

From README.md this is what I've done:

  1. Unpack and move modules into protected\modules (see below)
  2. Added 'user' array to modules array in protected\config\main.php
  3. Edit 'user' management module with YumWebUser
  4. Add application.modules.user.models.* to import array
  5. user/Install
  6. Log in with admin/admin
  7. user/user/admin fails with 403: "You are not authorized to perform this action."
  8. profile/profile/view/id/1 fails with "Alias "ProfileModule.controllers.YumProfileController" is invalid. Make sure it points to an existing directory or file."

protected\config\main.php looks like this:

    // autoloading model and component classes
    'import'=>array(
        'application.models.*',
        'application.components.*',
        'application.modules.user.models.*',
        'application.modules.user.components.*',
/*      'application.modules.profile.models.*',
        'application.modules.profile.components.*', */
    ),
    'modules'=>array(
        // uncomment the following to enable the Gii tool
        'gii'=>array(
            'class'=>'system.gii.GiiModule',
            'password'=>'local',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters'=>array('127.0.0.1','::1'),
        ),
        'user' => array(
            'debug' => true,
            'userTable' => 'tbl_user',
            'translationTable' => 'tbl_translation',
        ),
        'usergroup' => array(
            'usergroupTable' => 'tbl_usergroup',
            'usergroupMessageTable' => 'tbl_user_group_message',
        ),
        'membership' => array(
            'membershipTable' => 'tbl_membership',
            'paymentTable' => 'tbl_payment',
        ),
        'friendship' => array(
            'friendshipTable' => 'tbl_friendship',
        ),
        'profile' => array(
            'privacySettingTable' => 'tbl_privacysetting',
            'profileTable' => 'tbl_profile',
            'profileCommentTable' => 'tbl_profile_comment',
            'profileVisitTable' => 'tbl_profile_visit',
        ),
        'role' => array(
            'roleTable' => 'tbl_role',
            'userRoleTable' => 'tbl_user_role',
            'actionTable' => 'tbl_action',
            'permissionTable' => 'tbl_permission',
        ),
        'message' => array(
            'messageTable' => 'tbl_message',
        ),

    // application components
    'components'=>array(
        'user'=>array(
            'class' => 'application.modules.user.components.YumWebUser',
            // enable cookie-based authentication
            'allowAutoLogin'=>true,
            'loginUrl' => array('//user/user/login'),
        ),
    [...]

and I've got my protected\modules:

E:\xampp_1.8.3-3\htdocs\test\protected\modules\
    avatar
    friendship
    membership
    message
    profile
    registration
    role
    user
    usergroup
    yii-user-management-master
    README.md
sandipp commented 10 years ago

thanks @scribbly for pointing out, I am getting same error, please let me know if you get any solution.

scribbly commented 10 years ago

Unfortunately not yet @sandipp: it must be something super simple I'm not seeing :( but it doesn't lessen the frustration ;)

Vendict commented 10 years ago

Open file "ProfileModule.php" and change public variable $controllerMap to this:

  public $controllerMap=array(
    'comments'=>array(
      'class'=>'profile.controllers.YumProfileCommentController'),
    'privacy'=>array(
      'class'=>'profile.controllers.YumPrivacysettingController'),
    'profile'=>array(
      'class'=>'profile.controllers.YumProfileController'),
  );