background preloader

YII framework

Facebook Twitter

Yii_Framework_By_Honey Ppt Presentation. How to write secure Yii applications | Wiki | Yii Framework. Warning: While this security guide tries to be quite complete, is not exhaustive. If security matters for you, you ought to check several other references. General principles ¶ 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);. Validating the user input ¶ How it works ¶ If a user can add its birth date to its profile, you have to make sure he gives a valid date. Client-side validation ¶ Validating a form with JavaScript has absolutely no impact on the security! The HTML restriction are the same. <input type="hidden" name="id" value="1" /><input type="text" name="date" size="10" /><select name="list"><option>1</option><option>2</option></select> The data received in the PHP application can contain anything.

How Yii can help ¶ Yii how to register jQuery UI’s JavaScript and CSS | Code for Thought. Accessing data in a join table with the related models. Sometimes the right place to store application data is in a join table. For example, movie viewers either like or don’t like the movies they watched. Movie viewers ¶ CREATE TABLE viewer ( id INT NOT NULL PRIMARY KEY, name VARCHAR(45)) CREATE TABLE movie ( id INT NOT NULL PRIMARY KEY, title VARCHAR(45)) CREATE TABLE viewer_watched_movie ( viewer_id INT NOT NULL, movie_id INT NOT NULL, liked TINYINT(1), PRIMARY KEY (viewer_id, movie_id), CONSTRAINT fk_viewer_watched FOREIGN KEY (movie_id) REFERENCES movie (id) CONSTRAINT fk_movie_watched_by FOREIGN KEY (viewer_id) REFERENCES viewer (id)) So I need a Viewer model class and a Movie model class.

Movie and Viewer are related n:m, i.e. many-to-many. Property liked goes in the join table. This is correct relational DB design for data that belong to the relationship between the related entities—liked belongs to neither Movie nor Viewer. Accessing join table properties ¶ Using it like this: The problem ¶ The nearest solution I've found ¶ Www.yiiframework.com/files/yii-1.0-cheatsheet.pdf. Rbam.

Role Based Access Manager (RBAM) is a Yii module that provides complete management of Authorisation Data (Authorisation Items, Authorisation Hierarchy, and Authorisation Assignments) for Yii’s Role Based Access Control system via a browser interface; it is intended for use in development and end-user administration environments. RBAM has an intuitive “Web 2.0” interface to easily manage Authorisation Items (Roles, Tasks, and Operations), their hierarchy, and Authorisation Assignments. It presents all of an Authorisation Item’s information in one place providing a comprehensive overview and complete management of the item.

RBAM’s “Drill-down” and “Drill-up” features quickly show an item’s position in the Authorisation Hierarchy, what permissions it inherits (Drill down) and which Roles inherit its permissions (Drill up). RBAM supports I18N; it comes with German and Spanish translations (these are mine courtesy of Google - so poor at best). Requirements ¶ Compatibility ¶ Installation ¶ Usage ¶