Yii Framework Forum: [Module] Account - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Module] Account Secure accounts for your application Rate Topic: ***** 1 Votes

#1 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 05 June 2014 - 05:35 AM

Hey All,

Account, a brand new module form the Nord Software team is here.

If you are using the yii-user module you might want to upgrade to use the account module instead because it offers more security.

You can require it through Composer, download it from extensions or clone it from GitHub:


Feel free to leave your thoughts below.
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#2 User is offline   Tenshimitsu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 05-June 14

Posted 05 June 2014 - 03:45 PM

Hello;

First of all, big big thank you for this extension, I'm a fan of your awesome work :)

Second - a question: will it be difficult to convert it to bootstrap 2? I'm currently developing an application that uses Yiistrap with Bootstrap 2, I'm happy with this version of Bootstrap and don't want to change it yet...
0

#3 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 05 June 2014 - 06:16 PM

View PostTenshimitsu, on 05 June 2014 - 03:45 PM, said:

Hello;

First of all, big big thank you for this extension, I'm a fan of your awesome work :)

Second - a question: will it be difficult to convert it to bootstrap 2? I'm currently developing an application that uses Yiistrap with Bootstrap 2, I'm happy with this version of Bootstrap and don't want to change it yet...

It's actually really easy. Simply override the module views with your own that uses Bootstrap 2 (put them under either themes/[YOUR-THEME]/views/account or views/account - both should work).
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#4 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 06 June 2014 - 06:27 AM

I just released version 1.1.0 with some additional security features, check it out on the extension page.
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#5 User is offline   Tenshimitsu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 05-June 14

Posted 07 June 2014 - 06:26 PM

Great, thank you very much for an answer :)

---

One more thing: since I'm still quite new to Yii, what would be the best approach to extend this module?

Right now my user table has a field "alias", which is used as a param to generate an url username.mysite.com (used to display the "view" action). It also has many other fields, I wonder what's the best way to merge these two models.
0

#6 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 10 June 2014 - 02:16 AM

View PostTenshimitsu, on 07 June 2014 - 06:26 PM, said:

Great, thank you very much for an answer :)

---

One more thing: since I'm still quite new to Yii, what would be the best approach to extend this module?

Right now my user table has a field "alias", which is used as a param to generate an url username.mysite.com (used to display the "view" action). It also has many other fields, I wonder what's the best way to merge these two models.

Easiest way to "merge" your user model is to add the required fields to that model and configure the module to use your model instead (you can set it in the $classMap property in the Module class). You also want to copy the password behavior to your user model in order to support proper password encryption (see Account model).

I will write a guide on how to extend the module soon. I'll post here once I'm done.
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#7 User is offline   yiijco 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 03-September 12

Posted 10 June 2014 - 08:40 AM

wow...sound like wonderful extension, I follow install with composer but I still don't get it.. I've got files and folder: vendor, composer.json, composer.lock.. so where folder of yii-account?

thanks bro
0

#8 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 11 June 2014 - 02:32 AM

View Postyiijco, on 10 June 2014 - 08:40 AM, said:

wow...sound like wonderful extension, I follow install with composer but I still don't get it.. I've got files and folder: vendor, composer.json, composer.lock.. so where folder of yii-account?

thanks bro

Composer places dependencies under vendor so the extension can be found under vendor/nordsoftware/yii-account after you have ran composer require.
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#9 User is offline   Chris83 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 440
  • Joined: 27-February 10
  • Location:Helsinki, Finland

Posted 11 June 2014 - 02:35 AM

I finished the "Extending" section in the README yesterday, it can be found here: https://github.com/n...count#extending

Please read it carefully if you plan on extending the extension with your own functionality.
Best regards,
Chris

My contribution to the Yii community:
Account | Yiistrap | Auth | Bootstrap | NordCms | Rights | LESS | SEO | Img

Follow me:
Twitter | GitHub | Bitbucket
0

#10 User is offline   Tenshimitsu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 05-June 14

Posted 12 June 2014 - 03:39 PM

Thank you very, very much! :) I'm reading it right away :)
0

#11 User is offline   Patrick Bos Kessen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 17-June 14

Posted 17 June 2014 - 05:11 AM

Hi,

I'm trying to install the first extension for my first Yii project and am running into some trouble.

What am I doing wrong here?

Attached File(s)


0

#12 User is offline   Bruno Piaui 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 18-October 10

Posted 30 June 2014 - 08:58 PM

Hi cris,
congratulations for the your work!!
I'm trying to configure the extension, but not getting to.
I did download the following packages:

yii-account https://github.com/n...are/yii-account
Yiistrap http://github.com/crisu83/yiistrap
YiiPassword https://github.com/phpnode/yiipassword
RandomLib https://github.com/ircmaxell/RandomLib
SecurityLib https://github.com/i...ell/SecurityLib

put everything in the Extensions folder

and my 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',
        'aliases'=>array(
                'bootstrap'=>realpath(__DIR__ . '/../extensions/bootstrap'),
                '\nordsoftware\yii_account'=>__DIR__ . '/../extensions/yii-account/src',
                '\YiiPassword'=>__DIR__ . '/../extensions/yiipassword/src',
                '\RandomLib'=>__DIR__ . '/../extensions/randomlib/lib',
                '\SecureLib'=>__DIR__ . '/../extensions/securelib/lib',
        ),

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
                'bootstrap.helpers.TbHtml',
	),

	'modules'=>array(
		'gii'=>array(
                        'generatorPaths'=>array('bootstrap.gii'),
			'class'=>'system.gii.GiiModule',
			'password'=>'*****',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
                'account'=>array(
                        'class'=>'\nordsoftware\yii_account\Module',
                ),
	),

	// application components
	'components'=>array(
                'cache'=>array('class'=>'system.caching.CFileCache'),
                'bootstrap'=>array(
                        'class'=>'bootstrap.components.TbApi',   
                ),
		'user'=>array(
                        'class'=>'\nordsoftware\yii_account\components\WebUser',
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		'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'=>'mysql:host=localhost;dbname=paintball',
			'emulatePrepare'=>true,
			'username'=>'root',
			'password'=>'',
			'charset'=>'utf8',
                        'enableParamLogging'=>true,                        
                        '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',
				),
				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',
	),
);


is giving the following error: "Alias "nordsoftware.yii_account.components" is invalid. Make sure it points to an existing directory or file."

can you help me?

Thanks,
Bruno Piaui
0

#13 User is offline   Vicente Russo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 22-February 11
  • Location:Londrina, Brazil

Posted 23 July 2014 - 05:50 PM

Same problem from Bruno Piaui and Patrick Bos Kessen.

Tried composer, no success.
Tried manually, no success.

Alias "nordsoftware.yii_account" is invalid. Make sure it points to an existing directory or file.
The king is the man who can.
www.codare.com.br | @vicenterusso
0

#14 User is offline   Tracy 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 23-July 13

Posted 07 January 2015 - 10:27 PM

Chris,

I'm trying to get yii-account working on a DB other than MySQL (in my case SQL Server). I've been able to get everything working by making my own migration script and overriding all the models to add in a beforeSave() method to update the createdAt fields. However, there is one thing I can't get around that I was wondering if you had any idea about how to configure.

The Helper::sqlNow() function is used in several places that is not easy to override and it is very MySQL centric. I'm currently using Composer for the dependency management and would prefer to not go to installing and modifying your extension, but I can't seem to find anyway around it in SQL Server (I was even trying to configure a now() function but it can't be called without "dbo." in front of it so it didn't work either).

The only way around it that I could come up with is to add a "nowSQL" property to the module and, from the Module.init(), set a static variable in the Helper for the SQL to use in the call. That allows the SQL to be specified in the configuration. This works, but it would require me to modify your code to put it in place (and I couldn't find a way of subclassing all the other classes that require it without it).

Any help in getting around this would be appreciated.

Tracy
0

#15 User is offline   cheng.li 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 29-April 12

Posted 10 March 2015 - 02:25 AM

View PostVicente Russo, on 23 July 2014 - 05:50 PM, said:

Same problem from Bruno Piaui and Patrick Bos Kessen.

Tried composer, no success.
Tried manually, no success.

Alias "nordsoftware.yii_account" is invalid. Make sure it points to an existing directory or file.


I have found the solution at http://www.yiilearni...unt-is-invalid/
0

Share this topic:


Page 1 of 1
  • 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