Changeset 323
- Timestamp:
- 12/07/06 23:18:23 (2 years ago)
- Files:
-
- trunk/build/lib/jCmdUtils.class.php (modified) (1 diff)
- trunk/build/manifests/demoxul.mn (modified) (1 diff)
- trunk/build/manifests/jelix-lib.mn (modified) (4 diffs)
- trunk/build/manifests/jelix-modules.mn (modified) (1 diff)
- trunk/demoxul/www/themes (added)
- trunk/demoxul/www/themes/default (added)
- trunk/demoxul/www/themes/default/jxacl.css (added)
- trunk/demoxul/www/themes/default/no_right.png (added)
- trunk/demoxul/www/themes/default/right_ok.png (added)
- trunk/demoxul/www/themes/default/xulpage.css (added)
- trunk/demoxul/www/xulapp/main.js (modified) (1 diff)
- trunk/lib/jelix-modules/jxacl/classes/aclservice.class.php (modified) (2 diffs)
- trunk/lib/jelix-modules/jxacl/controllers/admin.rdf.php (modified) (3 diffs)
- trunk/lib/jelix-modules/jxacl/daos/jaclrights.dao.xml (modified) (2 diffs)
- trunk/lib/jelix-modules/jxacl/daos/jaclrightvalues.dao.xml (modified) (1 diff)
- trunk/lib/jelix-modules/jxacl/daos/jaclrightvaluesandgroup.dao.xml (modified) (1 diff)
- trunk/lib/jelix-modules/jxacl/daos/jaclrightvaluesgroup.dao.xml (modified) (1 diff)
- trunk/lib/jelix-modules/jxacl/install/sql/install.datas.mysql.sql (modified) (1 diff)
- trunk/lib/jelix-modules/jxacl/install/sql/install.schema.mysql.sql (modified) (3 diffs)
- trunk/lib/jelix-modules/jxacl/install/www (added)
- trunk/lib/jelix-modules/jxacl/install/www/themes (added)
- trunk/lib/jelix-modules/jxacl/install/www/themes/default (added)
- trunk/lib/jelix-modules/jxacl/install/www/themes/default/jxacl.css (added)
- trunk/lib/jelix-modules/jxacl/install/www/themes/default/no_right.png (added)
- trunk/lib/jelix-modules/jxacl/install/www/themes/default/right_ok.png (added)
- trunk/lib/jelix-modules/jxacl/locales/fr_FR/db.ISO-8859-1.properties (modified) (2 diffs)
- trunk/lib/jelix-modules/jxacl/templates/rights.rdf.tpl (added)
- trunk/lib/jelix-modules/jxacl/templates/xuladmin.tpl (modified) (14 diffs)
- trunk/lib/jelix-modules/jxauth/install/scripts/install.datas.mysql.sql (modified) (1 diff)
- trunk/lib/jelix-modules/jxauth/locales/fr_FR/dbacl.ISO-8859-1.properties (deleted)
- trunk/lib/jelix-modules/jxauth/templates/xuladmin.tpl (modified) (1 diff)
- trunk/lib/jelix-modules/jxxulapp/install/www/themes (added)
- trunk/lib/jelix-modules/jxxulapp/install/www/themes/default (added)
- trunk/lib/jelix-modules/jxxulapp/install/www/themes/default/xulpage.css (moved) (moved from trunk/lib/jelix-www/design/xulpage.css)
- trunk/lib/jelix-modules/jxxulapp/install/www/xulapp/main.js (modified) (1 diff)
- trunk/lib/jelix-modules/jxxulapp/templates/login.tpl (modified) (1 diff)
- trunk/lib/jelix-modules/jxxulapp/templates/main.tpl (modified) (3 diffs)
- trunk/lib/jelix-www/xul/jxulform.xml (modified) (1 diff)
- trunk/lib/jelix/acl/jAcl.class.php (modified) (4 diffs)
- trunk/lib/jelix/acl/jAclManager.class.php (modified) (1 diff)
- trunk/lib/jelix/core/response/jResponseRdf.class.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build/lib/jCmdUtils.class.php
r322 r323 80 80 81 81 if (count($argv)) { 82 var_dump($argv); 82 83 83 throw new Exception("Error: two many parameters\n"); 84 84 } trunk/build/manifests/demoxul.mn
r303 r323 12 12 cd demoxul/www/xulapp 13 13 main.js 14 cd demoxul/www/themes/default 15 jxacl.css 16 no_right.png 17 right_ok.png 18 xulpage.css 14 19 cd demoxul/var/config 15 20 defaultconfig.ini.php.dist trunk/build/manifests/jelix-lib.mn
r321 r323 241 241 auth.UTF-8.properties 242 242 autherror.UTF-8.properties 243 dbacl.ISO-8859-1.properties244 243 cd lib/jelix-modules/jxauth/install/scripts 245 244 delete.postgresql.sql … … 291 290 install.schema.mysql.sql 292 291 install.datas.mysql.sql 292 cd lib/jelix-modules/jxacl/install/www/themes/default 293 jxacl.css 294 no_right.png 295 right_ok.png 293 296 cd lib/jelix-modules/jxacl/locales/fr_FR 294 297 db.ISO-8859-1.properties … … 297 300 xuladmin.tpl 298 301 jxauthovlay.tpl 302 rights.rdf.tpl 299 303 300 304 … … 317 321 jelix.css 318 322 tooltip.css 319 xulpage.css320 323 cd lib/jelix-www/js 321 324 tooltip.js trunk/build/manifests/jelix-modules.mn
r303 r323 23 23 cd jxxulapp/install/www/xulapp 24 24 main.js 25 cd jxxulapp/install/www/themes/default/ 26 xulpage.css trunk/demoxul/www/xulapp/main.js
r307 r323 1 1 2 function OpenAppli(url){ 3 var content = document.getElementById('content'); 4 if(content.getAttribute('src') == url){ 5 content.setAttribute('src',''); 6 content.setAttribute('src',url); 2 function displayStatusMessage(str){ 3 var st = document.getElementById('statusmessage').value=str; 4 } 5 6 7 function OpenAppli(url){ 8 displayStatusMessage(url); 9 var mainContent = document.getElementById('mainContent'); 10 if(mainContent.getAttribute('src') == url){ 11 mainContent.setAttribute('src',''); 12 mainContent.setAttribute('src',url); 7 13 }else{ 8 content.setAttribute('src',url);14 mainContent.setAttribute('src',url); 9 15 } 10 16 } 11 17 18 function XulAppOnLoad(ev){ 19 // pour le bug du load qui se propage au fen�e parentes.. 20 if(ev.target != document) 21 return; 22 } 23 24 document.addEventListener("load", XulAppOnLoad, false); 25 26 function CmdxQuit(){ 27 if(confirm("�es vous s� vouloir quitter l'application ?")) 28 window.location.href= gUrlQuit; 29 } trunk/lib/jelix-modules/jxacl/classes/aclservice.class.php
r259 r323 3 3 * @package jelix-modules 4 4 * @subpackage jxacl 5 * @version $Id$6 5 * @author Jouanneau Laurent 7 6 * @contributor … … 17 16 function getGroupRights($grpid){ 18 17 $rv_dao = jDao::get('jxacl~jaclrightvalues'); 19 20 $sql = 'SELECT s.id_aclsbj, s.id_aclvalgrp, s.label_key, r.value, r.id_aclres 21 FROM jacl_subject s LEFT JOIN jacl_rights r 22 ON (s.id_aclsbj = r.id_aclsbj AND r.id_aclgrp = '.intval($grpid).')'; 18 $sql = 'SELECT s.id_aclsbj, s.id_aclvalgrp, s.label_key, r.value as right_value, r.id_aclres, 19 rv.label_key label_value, rv.value value 20 FROM jacl_right_values rv, jacl_subject s LEFT JOIN jacl_rights r 21 ON (s.id_aclsbj = r.id_aclsbj AND r.id_aclgrp ='.intval($grpid).' AND rv.value=r.value) 22 WHERE rv.id_aclvalgrp = s.id_aclvalgrp'; 23 23 $cnx = jDb::getConnection(); 24 24 25 25 $list=array(); 26 26 $rs = $cnx->query($sql); 27 $currentSubject=null; 27 28 foreach($rs as $right){ 28 if($right->label_key !='') 29 $right->label= jLocale::get($right->label_key); 30 else 31 $right->label = $right->id_aclsbj; 32 $right->value_label=''; 33 if($right->value){ 34 $values= $rv_dao->findByValGroup($right->id_aclvalgrp); 35 $v=intval($right->value); 36 foreach($values as $value){ 37 $r=intval($value->value); 38 if(($r & $v) == $r){ 39 $right->value_label.=' '.jLocale::get($value->label_key); 40 } 41 } 29 if($currentSubject==null || $right->id_aclsbj != $currentSubject->id_aclsbj){ 30 $currentSubject = new stdClass(); 31 $currentSubject->id_aclsbj = $right->id_aclsbj; 32 $currentSubject->id_aclvalgrp = $right->id_aclvalgrp; 33 34 if($right->label_key !='') 35 $currentSubject->label= jLocale::get($right->label_key); 36 else 37 $currentSubject->label = $right->id_aclsbj; 38 $currentSubject->rights=array(); 39 $list[]=$currentSubject; 42 40 } 43 $list[]=$right; 41 42 $r = new stdClass(); 43 $r->value = $right->value; 44 $r->label = jLocale::get($right->label_value); 45 $r->id_aclres = $right->id_aclres; 46 $r->enabled = ($right->value == $right->right_value?'true':'false'); 47 48 $currentSubject->rights[] = $r; 44 49 } 50 45 51 return $list; 46 52 } trunk/lib/jelix-modules/jxacl/controllers/admin.rdf.php
r318 r323 3 3 * @package jelix-modules 4 4 * @subpackage jxacl 5 * @version $Id$6 5 * @author Jouanneau Laurent 7 6 * @contributor … … 22 21 23 22 $rep->datas = $srv->getGroupRights($grpid); 24 $rep->asAttribute = array('id_aclsbj','id_aclvalgrp','value','id_aclres');23 /*$rep->asAttribute = array('id_aclsbj','id_aclvalgrp','value','id_aclres'); 25 24 $rep->asElement = array('label','value_label'); 26 25 … … 28 27 $rep->resNsPrefix='r'; 29 28 $rep->resUriPrefix = "urn:data:row:"; 30 $rep->resUriRoot = "urn:data:row"; 29 $rep->resUriRoot = "urn:data:row";*/ 30 $rep->template='rights.rdf'; 31 31 32 32 return $rep; trunk/lib/jelix-modules/jxacl/daos/jaclrights.dao.xml
r136 r323 2 2 <dao xmlns="http://jelix.org/ns/dao/1.0"> 3 3 <datasources> 4 <primarytable name="r" realname="jacl_rights" primarykey="id_aclsbj,id_aclgrp,id_aclres " />4 <primarytable name="r" realname="jacl_rights" primarykey="id_aclsbj,id_aclgrp,id_aclres,value" /> 5 5 </datasources> 6 6 <record> … … 8 8 <property name="id_aclgrp" fieldname="id_aclgrp" datatype="int" required="yes"/> 9 9 <property name="id_aclres" fieldname="id_aclres" datatype="string" required="yes"/> 10 <property name="value" fieldname="value" datatype=" int" required="yes"/>10 <property name="value" fieldname="value" datatype="string" required="yes"/> 11 11 </record> 12 12 <factory> trunk/lib/jelix-modules/jxacl/daos/jaclrightvalues.dao.xml
r136 r323 5 5 </datasources> 6 6 <record> 7 <property name="value" fieldname="value" datatype=" int" required="yes"/>7 <property name="value" fieldname="value" datatype="string" required="yes"/> 8 8 <property name="label_key" fieldname="label_key" datatype="string" required="yes"/> 9 9 <property name="id_aclvalgrp" fieldname="id_aclvalgrp" datatype="int" required="yes"/> trunk/lib/jelix-modules/jxacl/daos/jaclrightvaluesandgroup.dao.xml
r205 r323 9 9 <property name="id_aclvalgrp" fieldname="id_aclvalgrp" datatype="int" required="yes"/> 10 10 <property name="label_key" fieldname="label_key" datatype="string" required="yes"/> 11 <property name="value" fieldname="value" datatype=" int" required="yes"/>11 <property name="value" fieldname="value" datatype="string" required="yes"/> 12 12 <property name="group_label_key" fieldname="label_key" table="g" datatype="string" required="yes"/> 13 13 <property name="type_group" fieldname="type_aclvalgrp" table="g" datatype="int"/> 14 14 </record> 15 15 <factory> trunk/lib/jelix-modules/jxacl/daos/jaclrightvaluesgroup.dao.xml
r136 r323 8 8 <property name="id_aclvalgrp" fieldname="id_aclvalgrp" datatype="int" required="yes"/> 9 9 <property name="label_key" fieldname="label_key" datatype="string" required="yes"/> 10 10 <property name="type" fieldname="type_aclvalgrp" datatype="int"/> 11 11 </record> 12 12 <!--<factory> trunk/lib/jelix-modules/jxacl/install/sql/install.datas.mysql.sql
r259 r323 2 2 3 3 INSERT INTO `jacl_group` VALUES (1, 'administrateur', 0, NULL); 4 INSERT INTO `jacl_group` VALUES (2, ' inscrits', 1, NULL);4 INSERT INTO `jacl_group` VALUES (2, 'utilisateurs', 1, NULL); 5 5 6 6 -- 7 7 8 INSERT INTO `jacl_right_values` VALUES (1, 'jxacl~db.valgrp.truefalse.false', 1); 9 INSERT INTO `jacl_right_values` VALUES (2, 'jxacl~db.valgrp.truefalse.true', 1); 10 INSERT INTO `jacl_right_values` VALUES (1, 'jxacl~db.valgrp.crudl.list', 2); 11 INSERT INTO `jacl_right_values` VALUES (2, 'jxacl~db.valgrp.crudl.create', 2); 12 INSERT INTO `jacl_right_values` VALUES (4, 'jxacl~db.valgrp.crudl.read', 2); 13 INSERT INTO `jacl_right_values` VALUES (8, 'jxacl~db.valgrp.crudl.update', 2); 14 INSERT INTO `jacl_right_values` VALUES (16, 'jxacl~db.valgrp.crudl.delete', 2); 15 INSERT INTO `jacl_right_values` VALUES (1, 'jxacl~db.valgrp.yesno.no', 3); 16 INSERT INTO `jacl_right_values` VALUES (2, 'jxacl~db.valgrp.yesno.yes', 3); 17 8 INSERT INTO `jacl_right_values_group` VALUES (1, 'jxacl~db.valgrp.truefalse', 1); 9 INSERT INTO `jacl_right_values_group` VALUES (2, 'jxacl~db.valgrp.crudl',0); 10 INSERT INTO `jacl_right_values_group` VALUES (3, 'jxacl~db.valgrp.yesno',1); 11 INSERT INTO `jacl_right_values_group` VALUES (4, 'jxacl~db.valgrp.groups',0); 12 INSERT INTO `jacl_right_values_group` VALUES (5, 'jxacl~db.valgrp.users',0); 18 13 19 14 -- 15 INSERT INTO `jacl_right_values` VALUES ('FALSE', 'jxacl~db.valgrp.truefalse.false', 1); 16 INSERT INTO `jacl_right_values` VALUES ('TRUE', 'jxacl~db.valgrp.truefalse.true', 1); 20 17 21 INSERT INTO `jacl_right_values_group` VALUES (1, 'jxacl~db.valgrp.truefalse'); 22 INSERT INTO `jacl_right_values_group` VALUES (2, 'jxacl~db.valgrp.crudl'); 23 INSERT INTO `jacl_right_values_group` VALUES (3, 'jxacl~db.valgrp.yesno'); 18 INSERT INTO `jacl_right_values` VALUES ('LIST', 'jxacl~db.valgrp.crudl.list', 2); 19 INSERT INTO `jacl_right_values` VALUES ('CREATE', 'jxacl~db.valgrp.crudl.create', 2); 20 INSERT INTO `jacl_right_values` VALUES ('READ', 'jxacl~db.valgrp.crudl.read', 2); 21 INSERT INTO `jacl_right_values` VALUES ('UPDATE', 'jxacl~db.valgrp.crudl.update', 2); 22 INSERT INTO `jacl_right_values` VALUES ('DELETE', 'jxacl~db.valgrp.crudl.delete', 2); 24 23 24 INSERT INTO `jacl_right_values` VALUES ('NO', 'jxacl~db.valgrp.yesno.no', 3); 25 INSERT INTO `jacl_right_values` VALUES ('YES', 'jxacl~db.valgrp.yesno.yes', 3); 25 26 27 INSERT INTO `jacl_right_values` VALUES ('LIST', 'jxacl~db.valgrp.groups.list', 4); 28 INSERT INTO `jacl_right_values` VALUES ('CREATE', 'jxacl~db.valgrp.groups.create', 4); 29 INSERT INTO `jacl_right_values` VALUES ('RENAME', 'jxacl~db.valgrp.groups.rename', 4); 30 INSERT INTO `jacl_right_values` VALUES ('DELETE', 'jxacl~db.valgrp.groups.delete', 4); 26 31 32 INSERT INTO `jacl_right_values` VALUES ('LIST', 'jxacl~db.valgrp.users.list', 5); 33 INSERT INTO `jacl_right_values` VALUES ('DETAILS', 'jxacl~db.valgrp.users.details', 5); 34 INSERT INTO `jacl_right_values` VALUES ('UPDATE', 'jxacl~db.valgrp.users.update', 5); 35 INSERT INTO `jacl_right_values` VALUES ('CREATE', 'jxacl~db.valgrp.users.create', 5); 36 INSERT INTO `jacl_right_values` VALUES ('DELETE', 'jxacl~db.valgrp.users.delete', 5); 37 INSERT INTO `jacl_right_values` VALUES ('CHANGE_PASSWORD', 'jxacl~db.valgrp.users.password', 5); 27 38 28 39 -- 40 INSERT INTO `jacl_subject` VALUES ('jxauth.users.management', 5, 'jxacl~db.sbj.users.management'); 41 INSERT INTO `jacl_subject` VALUES ('jxacl.groups.management', 4, 'jxacl~db.sbj.groups.management'); trunk/lib/jelix-modules/jxacl/install/sql/install.schema.mysql.sql
r203 r323 20 20 21 21 --- groupes de valeurs de droits 22 --- type_aclvalgrp : 0 = valeurs pouvant �e combin�, 1= valeurs exclusives 22 23 DROP TABLE IF EXISTS `jacl_right_values_group`; 23 24 CREATE TABLE `jacl_right_values_group` ( 24 25 `id_aclvalgrp` int(11) NOT NULL default '0', 25 26 `label_key` varchar(50) NOT NULL default '', 27 `type_aclvalgrp` tinyint(4) NOT NULL default '0', 26 28 PRIMARY KEY (`id_aclvalgrp`) 27 29 ) TYPE=MyISAM; … … 30 32 DROP TABLE IF EXISTS `jacl_right_values`; 31 33 CREATE TABLE `jacl_right_values` ( 32 `value` int(11) NOT NULL default '0',34 `value` varchar(20) NOT NULL default '', 33 35 `label_key` varchar(50) NOT NULL default '', 34 36 `id_aclvalgrp` int(11) NOT NULL default '0', … … 54 56 `id_aclgrp` int(11) NOT NULL default '0', 55 57 `id_aclres` varchar(100) NOT NULL default '', 56 `value` tinyint(4) NOT NULL default '0',57 PRIMARY KEY (`id_aclsbj`,`id_aclgrp`,`id_aclres` )58 `value` varchar(20) NOT NULL default '', 59 PRIMARY KEY (`id_aclsbj`,`id_aclgrp`,`id_aclres`, `value`) 58 60 ) TYPE=MyISAM; trunk/lib/jelix-modules/jxacl/locales/fr_FR/db.ISO-8859-1.properties
r204 r323 2 2 valgrp.truefalse.false=faux 3 3 valgrp.truefalse.true=vrai 4 4 5 valgrp.yesno=oui/non 5 6 valgrp.yesno.yes=oui 6 7 valgrp.yesno.no=non 8 7 9 valgrp.crudl=crudl 8 10 valgrp.crudl.list=liste … … 11 13 valgrp.crudl.update=modifier 12 14 valgrp.crudl.delete=effacer 13 group.create=cr� 14 group.rename=renommer 15 group.delete=effacer 16 group.management=Gestion des groupes 15 16 valgrp.groups=Gestion des groupes 17 valgrp.groups.create=cr� 18 valgrp.groups.rename=renommer 19 valgrp.groups.delete=effacer 20 valgrp.groups.list=lister 21 22 valgrp.users=Gestion des utilisateurs 23 valgrp.users.list=Liste 24 valgrp.users.details=Lire 25 valgrp.users.update=Modifier 26 valgrp.users.create=Ajouter 27 valgrp.users.delete=Effacer 28 valgrp.users.password=Changer le mot de passe 29 30 sbj.users.management=Gestion des utilisateurs 31 sbj.groups.management=Gestion des groupes trunk/lib/jelix-modules/jxacl/templates/xuladmin.tpl
r312 r323 12 12 {meta_xul css 'chrome://global/skin/'} 13 13 {meta_xul css 'jelix/xul/jxulform.css'} 14 {meta_xul css 'jelix/design/xulpage.css'}15 14 {meta_xul css 'jelix/xul/jxbl.css'} 15 {meta_xul csstheme 'jxacl.css'} 16 16 {meta_xul ns array('jx'=>'jxbl')} 17 {meta_xul csstheme 'xulpage.css'} 17 18 18 19 <script type="application/x-javascript"><![CDATA[ … … 32 33 document.getElementById('rights').setAttribute("datasources",""); 33 34 document.getElementById('users').setAttribute("datasources",""); 34 document.getElementById('rightsvalues').selectedIndex=0;35 35 document.getElementById('groupstatus').setAttribute('disabled','true'); 36 36 var pager = document.getElementById('userspager'); … … 41 41 42 42 function selectRightForm(idvalgrp, rightvalue){ 43 var deck=document.getElementById('rightsvalues'); 44 deck.selectedIndex=0; 45 if(idvalgrp != '0'){ 46 var grpbox = deck.getElementsByTagName("groupbox"); 47 for(var i =0; i < grpbox.length; i++){ 48 if(grpbox[i].getAttribute("valgrp") == idvalgrp){ 49 deck.selectedIndex=i+1; 50 break; 51 } 52 } 53 if(deck.selectedIndex!=0){ 54 var chks = grpbox[i].getElementsByTagName("checkbox"); 55 var chkvalue, value=parseInt(rightvalue); 56 for(var j=0; j < chks.length; j++){ 57 chkvalue=parseInt(chks[j].getAttribute('rightvalue')); 58 if((chkvalue & value) == chkvalue) 59 chks[j].checked=true; 60 else 61 chks[j].checked=false; 62 } 63 } 64 } 43 65 44 } 66 45 … … 83 62 } 84 63 document.getElementById('groupname').setAttribute('value',gGroupList.selectedItem.label); 85 selectRightForm("0",0);86 64 gCurrentRight = {}; 87 65 } … … 104 82 function onSubjectSelect(tree){ 105 83 var idx = tree.view.selection.currentIndex; 106 if(idx == -1){ 107 selectRightForm("0",0); 84 /*if(idx == -1){ 108 85 gCurrentRight = {}; 109 86 }else{ … … 113 90 gCurrentRight.id_aclsbj = tree.view.getCellText(idx, tree.columns.getNamedColumn ( "id_aclsbj-col")); 114 91 gCurrentRight.id_aclres = tree.view.getCellText(idx, tree.columns.getNamedColumn ( "res-col")); 115 116 selectRightForm(gCurrentRight.id_aclvalgrp, gCurrentRight.rightvalue); 117 } 92 }*/ 118 93 } 119 94 … … 121 96 122 97 function onRightsFormSubmit(form){ 123 var deck=document.getElementById("rightsforms");98 /*var deck=document.getElementById("rightsforms"); 124 99 if(deck.selectedIndex!=0){ 125 100 var chks = deck.selectedPanel.getElementsByTagName("checkbox"); … … 136 111 }else{ 137 112 return false; 138 } 139 140 } 141 113 }*/ 114 115 } 142 116 143 117 function onCreateNewGroup(form){ … … 159 133 } 160 134 161 162 163 function onAddUserGroup(form,idgroup){ 164 document.getElementById('user').value=''; 165 document.getElementById('user2').value=''; 166 {/literal} 167 var usersurl={urljsstring 'jxacl~admin_userslist@rdf',array('offset'=>'0','count'=>'10'),array('grpid'=>'idgroup','__rnd'=>'Math.random()')}; 168 var counturl={urljsstring 'jxacl~admin_usersgcount@classic',array(),array('grpid'=>'idgroup','__rnd'=>'Math.random()')}; 169 {literal} 170 var pager = document.getElementById('userspager'); 171 pager.setAttribute('counturl',counturl); 172 pager.setAttribute('datasourceurl',''); 173 pager.setAttribute('datasourceurl',usersurl); 174 pager.loadCount(); 175 } 176 177 function onRemoveUserGroup(form,idgroup){ 178 document.getElementById('user').value=''; 179 {/literal} 180 var usersurl={urljsstring 'jxacl~admin_userslist@rdf',array('offset'=>'0','count'=>'10'),array('grpid'=>'idgroup','__rnd'=>'Math.random()')}; 181 var counturl={urljsstring 'jxacl~admin_usersgcount@classic',array(),array('grpid'=>'idgroup','__rnd'=>'Math.random()')}; 182 {literal} 183 var pager = document.getElementById('userspager'); 184 pager.setAttribute('counturl',counturl); 185 pager.setAttribute('datasourceurl',''); 186 pager.setAttribute('datasourceurl',usersurl); 187 pager.loadCount(); 188 } 135 function onAddUserGroup(form,idgroup){ 136 document.getElementById('user').value=''; 137 document.getElementById('user2').value=''; 138 {/literal} 139 var usersurl={urljsstring 'jxacl~admin_userslist@rdf',array('offset'=>'0','count'=>'10'),array('grpid'=>'idgroup','__rnd'=>'Math.random()')}; 140 var counturl={urljsstring 'jxacl~admin_usersgcount@classic',array(),array('grpid'=>'idgroup','__rnd'=>'Math.random()')}; 141 {literal} 142 var pager = document.getElementById('userspager'); 143 pager.setAttribute('counturl',counturl); 144 pager.setAttribute('datasourceurl',''); 145 pager.setAttribute('datasourceurl',usersurl); 146 pager.loadCount(); 147 } 148 149 function onRemoveUserGroup(form,idgroup){ 150 document.getElementById('user').value=''; 151 {/literal} 152 var usersurl={urljsstring 'jxacl~admin_userslist@rdf',array('offset'=>'0','count'=>'10'),array('grpid'=>'idgroup','__rnd'=>'Math.random()')}; 153 var counturl={urljsstring 'jxacl~admin_usersgcount@classic',array(),array('grpid'=>'idgroup','__rnd'=>'Math.random()')}; 154 {literal} 155 var pager = document.getElementById('userspager'); 156 pager.setAttribute('counturl',counturl); 157 pager.setAttribute('datasourceurl',''); 158 pager.setAttribute('datasourceurl',usersurl); 159 pager.loadCount(); 160 } 189 161 {/literal} 190 162 ]]></script> … … 223 195 onerror="alert(this.httpreq.responseText);" 224 196 /> 225 < jx:submission id="rightsform" action="{jurl '@jsonrpc'}" method="POST"197 <!--<jx:submission id="rightsform" action="{jurl '@jsonrpc'}" method="POST" 226 198 format="json-rpc" rpcmethod="jxacl~admin_saveright" 227 199 onsubmit="onRightsFormSubmit(this)" … … 231 203 onrpcerror="alert('rpcerror:\n'+this.jsonResponse.error.toSource())" 232 204 onerror="alert('error:\n'+this.httpreq.responseText);" 233 /> 205 />--> 234 206 <jx:submission id="addusertogrpform" 235 207 action="{jurl '@jsonrpc'}" … … 280 252 281 253 </jx:jbox> 282 <jx:jbox title="Droits associ�> 283 <deck id="rightsvalues"> 284 <description></description> 285 {assign $valgrp=0} 286 {foreach $valuegroups as $i=>$vg} 287 {if $valgrp != $vg->id_aclvalgrp} 288 {if $valgrp !=0} 289 <jx:submit id="rightdata{$valgrp}" form="rightsform" label="Sauvegarder"/> 290 </groupbox> 291 {/if} 292 <groupbox submit="rightdata{$vg->id_aclvalgrp}" valgrp="{$vg->id_aclvalgrp}"> 293 {assign $label=$vg->group_label_key} 294 <caption label="{@$label@}"/> 295 {assign $valgrp=$vg->id_aclvalgrp} 296 {/if} 297 298 {assign $label=$vg->label_key} 299 <checkbox label="{@$label@}" rightvalue="{$vg->value}" /> 300 {/foreach} 301 {if $valgrp !=0} 302 <jx:submit id="rightdata{$valgrp}" form="rightsform" label="Sauvegarder"/> 303 </groupbox> 304 {/if} 305 </deck> 306 307 </jx:jbox> 254 308 255 </vbox> 309 256 … … 317 264 <tabpanels flex="1"> 318 265 <tabpanel> 319 <tree id="rights" flex="1" flags="dont-build-content" ref="urn:data:row" 320 datasources="rdf:null" onselect="onSubjectSelect(this)" seltype="single" 321 > 266 <tree id="rights" ref="urn:data:row" width="500" datasources="rdf:null" 267 onselect="onSubjectSelect(this)" seltype="single" editable="true"> 322 268 <treecols> 323 <treecol id=" subject-col" label="Sujets" primary="true" flex="2"269 <treecol id="rights-col" label="Droits" primary="true" flex="2" 324 270 class="sortDirectionIndicator" sortActive="false" 325 271 sortDirection="ascending" 326 272 sort="rdf:http://jelix.org/ns/rights#label"/> 273 327 274 <splitter class="tree-splitter"/> 275 276 <treecol id="enable-col" label="Actif" width="50" 277 type="checkbox" editable="true" /> 278 279 <splitter class="tree-splitter"/> 280 328 281 <treecol id="res-col" label="Ressources" flex="1" 329 class="sortDirectionIndicator" sortActive="true" 330 sortDirection="ascending" 282 class="sortDirectionIndicator" sortActive="true" sortDirection="ascending" 331 283 sort="rdf:http://jelix.org/ns/rights#id_aclres"/> 332 <splitter class="tree-splitter"/> 333 <treecol id="values-col" label="Droits" flex="3" 334 class="sortDirectionIndicator" sortActive="true" 335 sortDirection="ascending" 336 sort="rdf:http://jelix.org/ns/rights#value_label"/> 284 337 285 <treecol id="value-col" label="" flex="0" ignoreincolumnpicker="true" hidden="true" /> 286 338 287 <treecol id="id_aclvalgrp-col" label="" flex="0" ignoreincolumnpicker="true" hidden="true" /> 288 339 289 <treecol id="id_aclsbj-col" label="" flex="0" ignoreincolumnpicker="true" hidden="true" /> 290 340 291 </treecols> 341 292 <template> 342 <treechildren alternatingbackground="true"> 343 <treeitem uri="rdf:*"> 344 <treerow> 345 <treecell label="rdf:http://jelix.org/ns/rights#label"/> 346 <treecell label="rdf:http://jelix.org/ns/rights#id_aclres"/> 347 <treecell label="rdf:http://jelix.org/ns/rights#value_label"/> 348 <treecell label="rdf:http://jelix.org/ns/rights#value"/> 349 <treecell label="rdf:http://jelix.org/ns/rights#id_aclvalgrp"/> 350 <treecell label="rdf:http://jelix.org/ns/rights#id_aclsbj"/> 351 </treerow> 352 </treeitem> 353 </treechildren> 293 <rule iscontainer="true"> 294 <treechildren> 295 <treeitem uri="rdf:*"> 296 <treerow properties="subject"> 297 <treecell label="rdf:http://jelix.org/ns/rights#label"/> 298 </treerow> 299 </treeitem> 300 </treechildren> 301 </rule> 302 <rule iscontainer="false"> 303 <treechildren> 304 <treeitem uri="rdf:*"> 305 <treerow properties="right"> 306 <treecell label="rdf:http://jelix.org/ns/rights#label"/> 307 <treecell value="rdf:http://jelix.org/ns/rights#enabled"/> 308 <treecell label="rdf:http://jelix.org/ns/rights#id_aclres"/> 309 <treecell label="rdf:http://jelix.org/ns/rights#value"/> 310 <treecell label="rdf:http://jelix.org/ns/rights#id_aclvalgrp"/> 311 <treecell label="rdf:http://jelix.org/ns/rights#id_aclsbj"/> 312 </treerow> 313 </treeitem> 314 </treechildren> 315 </rule> 354 316 </template> 355 317 </tree> … … 387 349 <textbox id="user" name="user" value="" required="true" form="addusertogrpform" observes="groupstatus"/> 388 350 <jx:submit id="addusersubmit" form="addusertogrpform" label="Ajouter" observes="groupstatus"/> 389 </groupbox>351 </groupbox> 390 352 391 353 </tabpanel> trunk/lib/jelix-modules/jxauth/install/scripts/install.datas.mysql.sql
r307 r323 2 2 INSERT INTO `jlx_user` VALUES ('admin', '893942cbbaf6dd55d6721353f6776df9', 'no@mail.com'); 3 3 4 INSERT INTO `jacl_subject` VALUES ('auth.users.management', 30, 'jxauth~dbacl.users.management');5 INSERT INTO `jacl_right_values_group` VALUES (30, 'jxauth~dbacl.valgrp.users.management');6 4 7 INSERT INTO `jacl_right_values` VALUES (1, 'jxauth~dbacl.valgrp.users.management.list', 30);8 INSERT INTO `jacl_right_values` VALUES (2, 'jxauth~dbacl.valgrp.users.management.details', 30);9 INSERT INTO `jacl_right_values` VALUES (4, 'jxauth~dbacl.valgrp.users.management.update', 30);10 INSERT INTO `jacl_right_values` VALUES (8, 'jxauth~dbacl.valgrp.users.management.create', 30);11 INSERT INTO `jacl_right_values` VALUES (16, 'jxauth~dbacl.valgrp.users.management.delete', 30);12 INSERT INTO `jacl_right_values` VALUES (32, 'jxauth~dbacl.valgrp.users.management.password', 30);13 14 INSERT INTO `jacl_group` VALUES ( '1', 'Administrateurs', '0', NULL);trunk/lib/jelix-modules/jxauth/templates/xuladmin.tpl
r307 r323 1 1 {meta_xul css 'chrome://global/skin/'} 2 2 {meta_xul css 'jelix/xul/jxulform.css'} 3 {meta_xul css 'jelix/design/xulpage.css'}4 3 {meta_xul css 'jelix/xul/jxbl.css'} 4 {meta_xul csstheme 'xulpage.css'} 5 5 {meta_xul ns array('jx'=>'jxbl')} 6 6 trunk/lib/jelix-modules/jxxulapp/install/www/xulapp/main.js
r307 r323 1 /* 2 var gMainController = { 3 _commands : {'cmdx_quit':true}, 4 supportsCommand : function (cmd) { 5 return (cmd in this._commands); 6 }, 7 isCommandEnabled : function (cmd) { 8 return this._commands[cmd]; 9 }, 10 doCommand : function (cmd) { 11 if(cmd == 'cmdx_quit'){ 12 if(window.prompter.confirm("Quitter","�es vous s� vouloir quitter l'application ?")) 13 window.location.href="/index?module=jxauth&action=login_out"; 14 } 15 }, 16 onEvent : function (eventName) { } 1 2 function displayStatusMessage(str){ 3 var st = document.getElementById('statusmessage').value=str; 17 4 } 18 window.controllers.appendController(gMainController);19 */20 5 21 6 22 7 function OpenAppli(url){ 23 var content = document.getElementById('content'); 24 if(content.getAttribute('src') == url){ 25 content.setAttribute('src',''); 26 content.setAttribute('src',url); 8 displayStatusMessage(url); 9 var mainContent = document.getElementById('mainContent'); 10 if(mainContent.getAttribute('src') == url){ 11 mainContent.setAttribute('src',''); 12 mainContent.setAttribute('src',url); 27 13 }else{ 28 content.setAttribute('src',url);14 mainContent.setAttribute('src',url); 29 15 } 30 16 } 31 17 18 function XulAppOnLoad(ev){ 19 // pour le bug du load qui se propage au fen�e parentes.. 20 if(ev.target != document) 21 return; 22 } 23 24 document.addEventListener("load", XulAppOnLoad, false); 25 26 function CmdxQuit(){ 27 if(confirm("�es vous s� vouloir quitter l'application ?")) 28 window.location.href= gUrlQuit; 29 } trunk/lib/jelix-modules/jxxulapp/templates/login.tpl
r304 r323 7 7 function onLoginResult(form){ldelim} 8 8 if(form.jsonResponse.result == 'OK') 9 window.location.href='{jurl 'jxxulapp~default_index' }';9 window.location.href='{jurl 'jxxulapp~default_index',array(),false}'; 10 10 else 11 11 alert('login ou mot de passe �on�; trunk/lib/jelix-modules/jxxulapp/templates/main.tpl
r307 r323 3 3 <script type="application/x-javascript"><![CDATA[ 4 4 var gUrlQuit = '{jurl 'jxauth~login_out',array(),false}'; 5 6 {literal}7 function XulAppOnLoad(ev){8 // pour le bug du load qui se propage au fen�e parentes..9 if(ev.target != document)10 return;11 }12 13 document.addEventListener("load", XulAppOnLoad, false);14 15 function CmdxQuit(){16 if(confirm("�es vous s� vouloir quitter l'application ?"))17 window.location.href= gUrlQuit;18 }19 {/literal}20 5 ]]></script> 21 6 … … 24 9 </commandset> 25 10 26 <keyset id="keyset-main"> 27 28 </keyset> 29 11 <keyset id="keyset-main"></keyset> 30 12 31 13 <menubar id="menubar-main"> 32 <menu label="Rubriques" id="menu-rubrique" >14 <me
