06.24 php saved
dhu
Tags add more
ACL, appcontroller, database, structure and table  
Note
Contenu AppController + structures `acos`, `aros`, `aros_acos`, `users`, `groups`
  1. <?php
  2. class AppController extends Controller {
  3.     var $components = array('Acl', 'Auth');
  4.     var $helpers = array('Html', 'Text', 'Javascript', 'Form');
  5.     var $publicControllers = array('pages');
  6.  
  7.  
  8.    
  9.     function beforeFilter() {
  10.         //Configure AuthComponent
  11.         if (isset($this->Auth)) {
  12.             $this->Auth->authorize = 'actions';
  13.             $this->Auth->actionPath = 'controllers/';
  14.             $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
  15.             $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'index');
  16.             $this->Auth->fields = array('username' => 'username', 'password' => 'password');
  17.             $this->Auth->logoutRedirect = "/";
  18.            
  19.             if (in_array(low($this->params['controller']), $this->publicControllers)) {
  20.                 $this->Auth->allow();
  21.           }
  22.         }
  23.     }
  24. }
  25. ?>
  26.  
  27. --
  28. -- Structure de la table `acos`
  29. --
  30.  
  31. CREATE TABLE `acos` (
  32.   `id` int(10) NOT NULL auto_increment,
  33.   `parent_id` int(10) default NULL,
  34.   `model` varchar(255) default NULL,
  35.   `foreign_key` int(10) default NULL,
  36.   `alias` varchar(255) default NULL,
  37.   `lft` int(10) default NULL,
  38.   `rght` int(10) default NULL,
  39.   PRIMARY KEY  (`id`)
  40. ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=26 ;
  41.  
  42. --
  43. -- Structure de la table `aros`
  44. --
  45.  
  46. CREATE TABLE `aros` (
  47.   `id` int(10) NOT NULL auto_increment,
  48.   `parent_id` int(10) default NULL,
  49.   `model` varchar(255) default NULL,
  50.   `foreign_key` int(10) default NULL,
  51.   `alias` varchar(255) default NULL,
  52.   `lft` int(10) default NULL,
  53.   `rght` int(10) default NULL,
  54.   PRIMARY KEY  (`id`)
  55. ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
  56.  
  57. --
  58. -- Structure de la table `aros_acos`
  59. --
  60.  
  61. CREATE TABLE `aros_acos` (
  62.   `id` int(10) NOT NULL auto_increment,
  63.   `aro_id` int(10) NOT NULL,
  64.   `aco_id` int(10) NOT NULL,
  65.   `_create` varchar(2) NOT NULL default '0',
  66.   `_read` varchar(2) NOT NULL default '0',
  67.   `_update` varchar(2) NOT NULL default '0',
  68.   `_delete` varchar(2) NOT NULL default '0',
  69.   PRIMARY KEY  (`id`),
  70.   UNIQUE KEY `ARO_ACO_KEY` (`aro_id`,`aco_id`)
  71. ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
  72.  
  73. --
  74. -- Structure de la table `users`
  75. --
  76.  
  77. CREATE TABLE `users` (
  78.   `id` int(10) unsigned NOT NULL auto_increment,
  79.   `group_id` int(10) unsigned NOT NULL,
  80.   `username` varchar(255) NOT NULL,
  81.   `password` char(40) NOT NULL,
  82.   `created` datetime NOT NULL,
  83.   `modified` datetime NOT NULL,
  84.   PRIMARY KEY  (`id`),
  85.   UNIQUE KEY `username` (`username`)
  86. ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
  87.  
  88. --
  89. -- Structure de la table `groups`
  90. --
  91.  
  92. CREATE TABLE `groups` (
  93.   `id` int(10) unsigned NOT NULL auto_increment,
  94.   `name` varchar(255) NOT NULL,
  95.   `created` datetime NOT NULL,
  96.   `modified` datetime NOT NULL,
  97.   PRIMARY KEY  (`id`)
  98. ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
Parsed in 0.144 seconds, using GeSHi 1.0.7.14

Modify this Paste