/*

/*Table structure for table `actualites` */


CREATE TABLE `actualites` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `type` enum('article') NOT NULL default 'article',
  `titre` char(50) NOT NULL,
  `soustitre` char(50) default NULL,
  `date` date default NULL,
  `resume` text,
  `texte` text,
  `photo` char(255) default NULL,
  `document` char(255) default NULL,
  `position` smallint(5) unsigned NOT NULL default '0',
  `accueil` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `statut` enum('redaction','publication') NOT NULL default 'redaction',
  `creation` datetime NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `franchise` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

/*Table structure for table `groupes` */


CREATE TABLE `groupes` (
  `id` int(11) NOT NULL auto_increment,
  `libelle` varchar(50) NOT NULL,
  `etiquette` char(50) default NULL,
  `verrou` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

/*Data for the table `groupes` */

insert  into `groupes`(`id`,`libelle`,`etiquette`,`verrou`) values 

(1,'administrateur CN','Admin CN',1),
(2,'administrateur','Administrateur',0);

/*Table structure for table `permissions` */


CREATE TABLE `permissions` (
  `groupe_id` int(11) unsigned NOT NULL,
  `url_id` int(11) unsigned NOT NULL,
  `get` tinyint(1) unsigned NOT NULL default '1',
  `post` tinyint(1) unsigned NOT NULL default '1',
  `put` tinyint(1) unsigned NOT NULL default '0',
  `delete` tinyint(1) unsigned NOT NULL default '0',
  PRIMARY KEY  (`groupe_id`,`url_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

/*Data for the table `permissions` */

insert  into `permissions`(`groupe_id`,`url_id`,`get`,`post`,`put`,`delete`) values 

(1,1,1,0,0,0),

(1,2,1,1,0,0),

(1,3,0,0,0,1),

(1,4,1,0,0,0),

(1,5,1,1,0,0),

(1,6,1,1,0,0),

(1,7,0,0,0,1),

(1,8,1,1,0,0),

(1,9,1,0,0,0),

(1,10,0,0,0,0),

(1,11,1,1,0,0),

(1,12,0,0,0,1),

(1,13,1,0,0,0),

(1,14,0,0,0,1),

(1,15,1,0,0,0),

(1,16,1,0,0,0),

(1,17,1,0,0,0),

(1,18,0,1,0,0),

(1,19,1,0,0,0),

(1,20,0,1,0,0),

(1,21,1,0,0,0),

(1,22,1,1,0,0),

(1,23,0,0,0,1),

(1,24,1,0,0,0);

/*Table structure for table `urls` */


CREATE TABLE `urls` (
  `id` int(11) NOT NULL auto_increment,
  `url` char(255) NOT NULL,
  `controleur` char(255) NOT NULL,
  `methodes` set('get','post','put','delete') NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `url` (`url`)
) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;

/*Data for the table `urls` */

insert  into `urls`(`id`,`url`,`controleur`,`methodes`) values 

(1,'/utilisateurs/','Cn\\Controleur\\Utilisateurs','get'),

(2,'/utilisateurs/:alpha/','Cn\\Controleur\\Utilisateur\\General','get,post'),

(3,'/utilisateurs/:alpha/suppression/','Cn\\Controleur\\Utilisateur\\Suppression','delete'),

(4,'/groupes/','Cn\\Controleur\\Groupes','get'),

(5,'/groupes/:alpha/','Cn\\Controleur\\Groupe\\General','get,post'),

(6,'/groupes/:alpha/permissions/','Cn\\Controleur\\Groupe\\Permissions','get,post'),

(7,'/groupes/:alpha/suppression/','Cn\\Controleur\\Groupe\\Suppression','delete'),

(8,'/(medias|documents|photos|videos)/','Cn\\Controleur\\Medias','get'),

(9,'/media/','Cn\\Controleur\\Media\\Liste','get'),

(10,'/media/apercu/','Cn\\Controleur\\Media\\Apercu','get'),

(11,'/media/dossier/ajoute/','Cn\\Controleur\\Media\\Dossier','post'),

(12,'/media/dossier/supprime/','Cn\\Controleur\\Media\\Dossier','delete'),

(13,'/media/fichiers/','Cn\\Controleur\\Media\\Fichiers','get'),

(14,'/media/fichiers/supprime/','Cn\\Controleur\\Media\\Fichiers','delete'),

(15,'/media/get/','Cn\\Controleur\\Media\\Download','get'),

(16,'/media/info/','Cn\\Controleur\\Media\\Info','get'),

(17,'/media/loupe/','Cn\\Controleur\\Media\\Loupe','get'),

(18,'/media/renomme/','Cn\\Controleur\\Media\\Renomme','post'),

(19,'/media/selectionne/','Cn\\Controleur\\Media\\Selectionne','get'),

(20,'/media/upload/','Cn\\Controleur\\Media\\Upload','post'),

(21,'/actualites/','Cn\\Extensions\\Actualites\\Controleur\\Actualites','get'),

(22,'/actualites/:alpha/','Cn\\Extensions\\Actualites\\Controleur\\Actualite\\General','get,post'),

(23,'/actualites/:alpha/suppression/','Cn\\Extensions\\Actualites\\Controleur\\Actualite\\Suppression','delete'),

(24,'/extensions/','Cn\\Controleur\\Extensions','get');

(25,'/extensions/:alpha/','Cn\\Controleur\\Extensions\\General','get,post');

/*Table structure for table `utilisateurs` */


CREATE TABLE `utilisateurs` (
  `id` mediumint(8) unsigned NOT NULL auto_increment,
  `groupe_id` int(11) unsigned NOT NULL default '0',
  `nom` char(50) default NULL,
  `prenom` char(50) default NULL,
  `email` char(255) NOT NULL,
  `pass` char(123) NOT NULL,
  `cle` char(32) default NULL,
  `operateur` char(20) default NULL,
  `logn` int(10) unsigned NOT NULL default '0',
  `logd` datetime default NULL,
  `creation` datetime NOT NULL,
  `etat` tinyint(1) unsigned NOT NULL default '1',
  `verrou` tinyint(1) unsigned default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

/*Data for the table `utilisateurs` */

insert  into `utilisateurs`(`id`,`groupe_id`,`nom`,`prenom`,`email`,`pass`,`cle`,`operateur`,`logn`,`logd`,`creation`,`etat`,`verrou`) values 

(1,1,'Clerc & Net','Admin','contact@clerc-et-net.com','$2IocAw9Oq7HQ','cdc6a27adf9fd9766df3589fad6a92cd','CN',415,'2017-09-25 15:45:52','2017-09-25 11:24:51',1,1);
