Showing 1-20 of 25 items.

How to login from different tables in Yii2

Created 8 years ago by AndroideLP AndroideLP, updated 6 years ago by lenovo lenovo. 7 comments

The Problem: Yii2 utilizes by default UserIdentity configured in config/web.php for connection, this object apply one table to authentication ('identityClass' => 'app\panel\models\User'). How to authentication from diferent tables? Solution: Create instances in web.php to uses UserIdentify. eg:

5 0
6
Viewed: 89 863 times
Version: 2.0
Category: How-tos

Yet another implementation of CPhpAuthManager.

Created 13 years ago by seenivasan seenivasan, updated 13 years ago by seenivasan seenivasan. 3 comments

In this wiki, I try to implement a simple authorization schema without putting much logic inside a file or into database table. We are constructing authorization hierarchy inside the controller. We are getting roles for the current user from database table and assigning only roles to user that are declared in the particular controller. We have brought down the work of loading of auth data at ma...

5 1
7
Viewed: 22 554 times
Version: 1.1
Category: How-tos

Kickstart development with Yii-App

Created 13 years ago by Chris83 Chris83, updated 13 years ago by Chris83 Chris83. 25 comments

I recently created a project called Yii-App on GitHub to kickstart my development of smaller Yii applications. The main goal of the project is to provide a ready-to-use application template that includes my bootstrap extension and many other useful extensions. After reading this article you will be able to use...

14 0
40
Viewed: 45 655 times
Version: 1.1
Category: How-tos

How to write secure Yii1 applications

Created 14 years ago by François Gannaz François Gannaz, updated 5 years ago by François Gannaz François Gannaz. 22 comments
  • Validate the user input (see below for details).
  • Protect (escape) your application output according to context (see below for a few output types, mostly HTML and SQL).
  • Test your application in debug mode.
    Set the constant YII_DEBUG to true (by default, it is defined in index.php) and put alongside error_reporting(E_ALL);. Then errors and warnings will stop the execution an...
80 0
114
Viewed: 339 204 times
Version: 1.1
Category: How-tos

Authenticating against phpass hashes with Yii

Created 14 years ago by Da:Sourcerer Da:Sourcerer, updated 12 years ago by Da:Sourcerer Da:Sourcerer. 18 comments
  • iteration_count_log2 controls the number of iterations for key stretching. A setting of 8 means the hash algorithm will be applied 2^8 = 256 times. This setting should be kept between 4 and 31.
  • portable_hashes controls whether portable hashes should be used or not. Portable hashes are salted MD5 hashes prefixed by $P$.
22 0
28
Viewed: 45 580 times
Version: 1.1
Category: How-tos