[Module] Yii User Management Module

Thank you, waiting for this :)

I found some suggestions. Changed short php tag to long tag in UserModule.php

Now i dont get this error, but i have new error:

Fatal error: Class ‘YumInstallController’ not found in C:\xampp\yii\framework\YiiBase.php on line 206

Maybe there is a problem with short tags

See some of the solutions in this thread:

Don’t be afraid to search around for some of the answers - the issues and docs in the github repository have lots of info.

elnina: make sure you have short tags enabled on your server - it will be less of a headache than editing them out of YUM.

[size="5"]step by step print screens:[/size]

3762

capture.JPG

3753

Capturar2.JPG

now go in webbrowser to:

http://localhost/<WE…hp/user/install

or

http://localhost/<WE…?r=user/install

3754

Capturar3.JPG

3755

Capturar4.JPG

3756

Capturar5.JPG

3757

Capturar6.JPG

3758

Capturar7.JPG

[color="#FF0000"]pay attention to this step its very important add this line, if not add…[/color]

3759

Capturar8.JPG

[color="#FF0000"]then you will have errors like this one [/color];)

3760

Capturar9.JPG

3761

Capturar10.JPG

my folder structure:

3764

folders.JPG

my bd after install:

3763

bd.JPG

my config/main.php


<?php


// uncomment the following to define a path alias

// Yii::setPathOfAlias('local','path/to/local-folder');


// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

	'name'=>'My Web Application',


	// preloading 'log' component

	'preload'=>array('log'),


	// autoloading model and component classes

	'import'=>array(

    	'application.modules.user.models.*',

		'application.models.*',

		'application.components.*',

	),


	'modules' => array(

		'user' => array(

  			'debug' => false,

          	'userTable' => 'user',

          	'translationTable' => 'translation',

			),

        	'usergroup' => array(

          	'usergroupTable' => 'usergroup',

          	'usergroupMessageTable' => 'user_group_message',

        	),

        	'membership' => array(

          	'membershipTable' => 'membership',

          	'paymentTable' => 'payment',

        	),

        	'friendship' => array(

          	'friendshipTable' => 'friendship',

        	),

        	'profile' => array(

          	'privacySettingTable' => 'privacysetting',

          	'profileFieldTable' => 'profile_field',

          	'profileTable' => 'profile',

          	'profileCommentTable' => 'profile_comment',

          	'profileVisitTable' => 'profile_visit',

        	),

        	'role' => array(

          	'roleTable' => 'role',

          	'userRoleTable' => 'user_role',

          	'actionTable' => 'action',

          	'permissionTable' => 'permission',

        	),

        	'message' => array(

          	'messageTable' => 'message',

        	),

		// uncomment the following to enable the Gii tool

		/*

		'gii'=>array(

			'class'=>'system.gii.GiiModule',

			'password'=>'Enter Your Password Here',

			// If removed, Gii defaults to localhost only. Edit carefully to taste.

			'ipFilters'=>array('127.0.0.1','::1'),

		),

		*/

	),


	// application components

	'components' => array(

			'cache' => array('class' => 'system.caching.CDummyCache'),

         'user'=>array(

        	'class' => 'application.modules.user.components.YumWebUser',

        	'allowAutoLogin'=>true,

        	'loginUrl' => array('//user/user/login'),

  	),

		// uncomment the following to enable URLs in path-format

		/*

		'urlManager'=>array(

			'urlFormat'=>'path',

			'rules'=>array(

				'<controller:\w+>/<id:\d+>'=>'<controller>/view',

				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

			),

		),

		*/

		/*'db'=>array(

			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',

		),*/

		// uncomment the following to use a MySQL database


		'db'=>array(

			'connectionString' => 'mysql:host=localhost;dbname=test',

			'emulatePrepare' => true,

			'username' => 'root',

			'password' => '',

			'charset' => 'utf8',

			// prior to yum0.8rc7 tablePrefix is not necessary anymore, but it can not hurt

			'tablePrefix' => '',

		),


		'errorHandler'=>array(

			// use 'site/error' action to display errors

			'errorAction'=>'site/error',

		),

		'log'=>array(

			'class'=>'CLogRouter',

			'routes'=>array(

				array(

					'class'=>'CFileLogRoute',

					'levels'=>'error, warning',

				),

				// uncomment the following to show log messages on web pages


				array(

					'class'=>'CWebLogRoute',

				),


			),

		),

	),


	// application-level parameters that can be accessed

	// using Yii::app()->params['paramName']

	'params'=>array(

		// this is used in contact page

		'adminEmail'=>'webmaster@example.com',

	),

);

[size="4"]ps: i have used last release of YII and YUM, with my win apache 2.4.2 (easyphp), php version 5.4.6, mysql 5.5.27 and you need to enable shorttags in php.ini, you need to find short_open_tag, unncomment if needs( remove the ; from start ) and set to on, like this -> [b]short_open_tag = on

[size=“6”]Add +1 [size=“6”]if i can help :D[/size][/size]

[/b][/size]

Thank you, that was where i am looking for :)

I changed all short tags manually…Then i installed without problem.

@ I-NOZex

Thanks for great tutorial and giving your time, i will look all of them if i missed anything.Currently i installed after change all short tags…So i can turn 1.1.13 i guess :)

I also have had questions, and I liked when someone has helped me, only reciprocate them, after all, is how a community works (;

Hey guys,

if tested to change the Baselayout …




Yii::setPathOfAlias('Layout' , dirname(Yii::app()->theme->baseUrl));

...

class UserModule extends CWebModule {

...

public $baseLayout = 'Layout.views.layouts.main';



But this isn’t working. Already searched the Forums but haven’t found a working Solution :(

Thanks!

Cheers

if you want aplly the base layout of active theme, edit this in your YII config


	'modules'=>array(

		(...)

        	'user' => array(

              	(...)

              	'baseLayout' => 'webroot.themes.THEME_NAME.views.layouts.main',

Guys,

I am following the install_tutorial.txt and I thought I was going nice but when I run testdrive/index.php?r=user/install I got an exception:

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

I´ve already googled it, found some tips but nothing worked. I´m a Yii newbie so probably I´m doing some stupid mistake. The other possibility is a compatibility problem… Please help !

Windows 7

Apache 2.4.2

PHP 5.4.3

Yii 1.1.13

User Management 0.8

<?php

// uncomment the following to define a path alias

// Yii::setPathOfAlias(‘local’,‘path/to/local-folder’);

// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

'basePath'=&gt;dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


'name'=&gt;'My Web Application',





// preloading 'log' component


'preload'=&gt;array('log'),





// autoloading model and component classes


'import'=&gt;array(


	'application.models.*',


	'application.components.*',


),





'modules'=&gt;array(


	// uncomment the following to enable the Gii tool


	/*


	'gii'=&gt;array(


		'class'=&gt;'system.gii.GiiModule',


		'password'=&gt;'Enter Your Password Here',


		// If removed, Gii defaults to localhost only. Edit carefully to taste.


		'ipFilters'=&gt;array('127.0.0.1','::1'),


	),


	*/





	'user' =&gt; array(


		'debug' =&gt; true,


		),


	


),





// application components


'components'=&gt;array(

‘user’=>array(

// enable cookie-based authentication

‘class’ => ‘application.modules.user.components.YumWebUser’,

‘allowAutoLogin’=>true,

‘loginUrl’ => array(’//user/user/login’),

),

‘import’=>array(

‘application.modules.user.models.*’,

),

	// uncomment the following to enable URLs in path-format


	/*


	'urlManager'=&gt;array(


		'urlFormat'=&gt;'path',


		'rules'=&gt;array(


			'&lt;controller:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/view',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;/&lt;id:&#092;d+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


			'&lt;controller:&#092;w+&gt;/&lt;action:&#092;w+&gt;'=&gt;'&lt;controller&gt;/&lt;action&gt;',


		),


	),


	*/


	'db'=&gt;array(


		'connectionString' =&gt; 'sqlite:'.dirname(__FILE__).'/&#46;&#46;/data/testdrive.db',


	),


	// uncomment the following to use a MySQL database


	


	'db'=&gt;array(


		'connectionString' =&gt; 'mysql:host=localhost;dbname=testdrive',


		'emulatePrepare' =&gt; true,


		'username' =&gt; 'root',


		'password' =&gt; 'orion0112358',


		'charset' =&gt; 'utf8',


	),


	


	'errorHandler'=&gt;array(


		// use 'site/error' action to display errors


		'errorAction'=&gt;'site/error',


	),


	'log'=&gt;array(


		'class'=&gt;'CLogRouter',


		'routes'=&gt;array(


			array(


				'class'=&gt;'CFileLogRoute',


				'levels'=&gt;'error, warning',


			),


			// uncomment the following to show log messages on web pages


			/*


			array(


				'class'=&gt;'CWebLogRoute',


			),


			*/


		),


	),


),





// application-level parameters that can be accessed


// using Yii::app()-&gt;params['paramName']


'params'=&gt;array(


	// this is used in contact page


	'adminEmail'=&gt;'webmaster@example.com',


),

);

Regards,

Gustavo.

Make sure you have php short tags enabled. It would be easier to troubleshoot if you mentioned some of the steps you’ve already tried.

Please read my install tutorial carefully ;)

I did ! The problem is in my case it fails in step 3 (when I run user/install). I´ve already set short tags. Anyway, I will reinstall all the environment from scratch and try again.

like i said, carefully :b

so, you need to join the two "import" block in just one, like my example:


	'import'=>array(

		'application.models.*',

		'application.components.*',

        	'application.modules.user.models.*',

	),

and must be set, before the “user” configuration, off course ;)

say if it works

Hi

i am using YUM 0.6 for my site to managing users. Now my client want to integrate Facebook and Google log in with the site. i have tried some extensions found here but was not successful. Does any one have any suggestion for the extensions which can be used with YUM 0.6

Thanks you.

Never used it, but from what I know, I think that YUM has native support for login through Facebook, Twitter, and Google i think

Hi

I have same problem, I want use facebook and twitter login with this extension but I not find a way to put it working…

If you find a solution please share

thanks

what is your real problem?

errors, any code to help find what its going wrong…

i think for facebook its just create the facebook app, setting up the configuration and enable in main.php the login method by facebook

Hi all, I have built the majority of an application and used YUM from the beginning - overall it is a great extension, however I have run into a problem.

I really want to use the Yii RBAC system for authorization - rather than YUM’s roles.

The reason for this is I cant see a way to specify custom business rules in YUM roles - these are critical to my project.

fixes I have tried:

removing the checkAccess() override from YumWebUser,

altering the checkAccess() override in YumWebUser to always return its parent method (ie the Yii checkAccess() method,

removing ‘roles’ from my config/main.php,

setting $useYiiCheckAccess = true in the RoleModule.php file,

None of these work & I am a bit lost, I really need to find a solution to this - even if that means using the roles system that comes with YUM.

Is there a YUM roles tutorial anywhere? or an example? f I can see how to provision business rules or something similar using YUM roles I might just go with that solution

thanks in advance!

Hi, i am trying to install the module,

i created a folder "modules" in ../protected and put the plugin into it.

add the code to config/main.php

i am getting The table "users" for active record class "User" cannot be found in the database.


<?php


// uncomment the following to define a path alias

// Yii::setPathOfAlias('local','path/to/local-folder');


// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(

	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

	'name'=>'My Web Application',


	// preloading 'log' component

	'preload'=>array('log'),


	// autoloading model and component classes

	'import'=>array(

		'application.modules.user.models.*',

		'application.models.*',

		'application.components.*',

	),


	'modules'=>array(

		// uncomment the following to enable the Gii tool

		/*

		'gii'=>array(

			'class'=>'system.gii.GiiModule',

			'password'=>'Enter Your Password Here',

			// If removed, Gii defaults to localhost only. Edit carefully to taste.

			'ipFilters'=>array('127.0.0.1','::1'),

		),

		*/

		'user' => array(

            'debug' => true,

        ),

	),


	// application components

	'components'=>array(

		'user'=>array(

			// enable cookie-based authentication

			'allowAutoLogin'=>true,

			'class' => 'User',

		),

		// uncomment the following to enable URLs in path-format

		/*

		'urlManager'=>array(

			'urlFormat'=>'path',

			'rules'=>array(

				'<controller:\w+>/<id:\d+>'=>'<controller>/view',

				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

			),

		),

		*/

		'db'=>array(

			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',

		),

		// uncomment the following to use a MySQL database

		

		'db'=>array(

			'connectionString' => 'mysql:host=localhost;dbname=yii',

			'emulatePrepare' => true,

			'username' => 'root',

			'password' => 'root',

			'charset' => 'utf8',

		),

		

		'errorHandler'=>array(

			// use 'site/error' action to display errors

			'errorAction'=>'site/error',

		),

		'log'=>array(

			'class'=>'CLogRouter',

			'routes'=>array(

				array(

					'class'=>'CFileLogRoute',

					'levels'=>'error, warning',

				),

				// uncomment the following to show log messages on web pages

				/*

				array(

					'class'=>'CWebLogRoute',

				),

				*/

			),

		),

	),


	// application-level parameters that can be accessed

	// using Yii::app()->params['paramName']

	'params'=>array(

		// this is used in contact page

		'adminEmail'=>'webmaster@example.com',

	),

);

you have 2 connections for the database…