Changeset 267

Show
Ignore:
Timestamp:
09/30/06 00:19:42 (2 years ago)
Author:
laurentj
Message:

- mise à jour des schemas relaxng
- FQ 2719 : support de https dans jurl (attribut https sur <url>, et option simple_urlengine_https)
- FQ 2612 : Pouvoir supprimer point d'entrée des url (attribut noentrypoint sur <url>)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/phpdoc/Converters/HTML/frames/templates/DOM/jelix/templates/top_frame.tpl

    r236 r267  
    1010    <body> 
    1111        <div id="header"> 
    12              
     12 
    1313            <div id="introduction"> 
    1414                <h1><a href="{$subdir}index.html" >Documentation API Reference</a></h1> 
    1515            </div> 
    1616            <div id="telechargement"> 
    17                  
    18                  
     17 
     18 
    1919            </div> 
    2020            <div> 
    2121            </div> 
    22             <div id="chemin">  
     22            <div id="chemin"> 
    2323                {if count($packages) > 1} 
    2424                   {assign var="last_p" value=""} 
     
    3131                <br/> 
    3232                {/if} 
    33                  
     33 
    3434                {if count($ric) >= 1} 
    3535                    {assign var="last_ric_name" value=""} 
     
    4343            </div> 
    4444    </div> 
    45      
     45 
    4646    <div id="sidemenu"> 
    47         <h1><a href="http://jelix.org" title="retour sur la page d'accueil du site"><img src="{$subdir}media/logo_jelix_moyen.png" alt="Jelix" /></a></h1> 
     47        <h1><a href="http://jelix.org" target="_top" title="retour sur la page d'accueil du site"><img src="{$subdir}media/logo_jelix_moyen.png" alt="Jelix" /></a></h1> 
    4848    </div> 
    49          
     49 
    5050    </body> 
    5151</html> 
  • trunk/lib/jelix/core/defaultconfig.ini.php

    r263 r267  
    106106IISStripslashes_path_key = on 
    107107 
     108; liste des actions requerant https (syntaxe expliqu�dessous), pour le moteur d'url simple 
     109simple_urlengine_https = 
    108110 
    109111[simple_urlengine_entrypoints] 
  • trunk/lib/jelix/core/jConfigCompiler.class.php

    r260 r267  
    170170            fclose($f); 
    171171        }else{ 
    172             trigger_error('Can\'t write '.$filename.' file',E_USER_ERROR); 
     172            trigger_error('Jelix can\'t write '.$filename.' file. Set correctly rights in the temp directory',E_USER_ERROR); 
    173173        } 
    174174    } 
  • trunk/lib/jelix/core/url/jUrlCompiler.significant.class.php

    r248 r267  
    6363            $CREATE_URL = array( 
    6464               'news~show@classic' => 
    65                   array(0,'entrypoint','handler') 
     65                  array(0,'entrypoint', https true/false, entrypoint true/false, 'handler') 
    6666                  ou 
    67                   array(1,'entrypoint', 
     67                  array(1,'entrypoint', https true/false, entrypoint true/false, 
    6868                        array('annee','mois','jour','id','titre'), // liste des param�es de l'url �rendre en compte 
    6969                        array(true, false..), // valeur des escapes 
     
    7171                        ) 
    7272                  ou 
    73                   array(2,'entrypoint'); pour les cl�du type "@request" ou "module~@request" 
     73                  array(2,'entrypoint', https true/false, entrypoint true/false ); pour les cl�du type "@request" 
     74                  array(3,'entrypoint', https true/false, entrypoint true/false );  pour les cl�du type  "module~@request" 
    7475 
    7576        */ 
     
    9091           $entryPoint = (string)$tag['name']; 
    9192           $isDefault =  (isset($tag['default']) ? (((string)$tag['default']) == 'true'):false); 
     93           $isHttps = (isset($tag['https']) ? (((string)$tag['https']) == 'true'):false); 
     94           $generatedentrypoint =$entryPoint; 
     95           if(isset($tag['noentrypoint']) && (string)$tag['noentrypoint'] == 'true') 
     96                $generatedentrypoint = ''; 
    9297           $parseInfos = array($isDefault); 
    9398 
     
    95100           // toutes les urls qui ne correspondent pas aux autres r�es 
    96101           if($isDefault){ 
    97              $createUrlInfos['@'.$requestType]=array(2,$entryPoint); 
     102             $createUrlInfos['@'.$requestType]=array(2,$entryPoint, $isHttps); 
    98103           } 
    99104 
     
    101106           foreach($tag->url as $url){ 
    102107               $module = (string)$url['module']; 
    103  
     108               if(isset($url['https'])){ 
     109                   $urlhttps=(((string)$url['https']) == 'true'); 
     110               }else{ 
     111                   $urlhttps=$isHttps; 
     112               } 
     113               if(isset($url['noentrypoint']) && ((string)$url['noentrypoint']) == 'true'){ 
     114                   $urlep=''; 
     115               }else{ 
     116                   $urlep=$generatedentrypoint; 
     117               } 
    104118               // dans le cas d'un point d'entr�qui n'est pas celui par d�ut pour le type de requete indiqu�              // si il y a juste un module indiqu�lors on sait que toutes les actions 
    105119               // concernant ce module passeront par ce point d'entr� 
    106120               if(!$isDefault && !isset($url['action']) && !isset($url['handler'])){ 
    107121                 $parseInfos[]=array($module, '', '/.*/', array(), array(), array(), false ); 
    108                  $createUrlInfos[$module.'~*@'.$requestType] = array(3,$entryPoint); 
     122                 $createUrlInfos[$module.'~*@'.$requestType] = array(3,$urlep, $urlhttps); 
    109123                 continue; 
    110124               } 
     
    123137                  $createUrlContent.="include_once('".$s->getPath()."');\n"; 
    124138                  $parseInfos[]=array($module, $action, $class, $actionOverride ); 
    125                   $createUrlInfos[$module.'~'.$action.'@'.$requestType] = array(0,$entryPoint, $class); 
     139                  $createUrlInfos[$module.'~'.$action.'@'.$requestType] = array(0,$urlep, $urlhttps, $class); 
    126140                  if($actionOverride){ 
    127141                     foreach($actionOverride as $ao){ 
    128                         $createUrlInfos[$module.'~'.$ao.'@'.$requestType] = array(0,$entryPoint, $class); 
     142                        $createUrlInfos[$module.'~'.$ao.'@'.$requestType] = array(0,$urlep,$urlhttps, $class); 
    129143                     } 
    130144                  } 
     
    187201               } 
    188202               $parseInfos[]=array($module, $action, '!^'.$regexppath.'$!', $listparam, $escapes, $liststatics, $actionOverride ); 
    189                $createUrlInfos[$module.'~'.$action.'@'.$requestType] = array(1,$entryPoint, $listparam, $escapes,$path); 
     203               $createUrlInfos[$module.'~'.$action.'@'.$requestType] = array(1,$urlep, $urlhttps, $listparam, $escapes,$path); 
    190204               if($actionOverride){ 
    191205                  foreach($actionOverride as $ao){ 
    192                      $createUrlInfos[$module.'~'.$ao.'@'.$requestType] = array(1,$entryPoint, $listparam, $escapes,$path); 
     206                     $createUrlInfos[$module.'~'.$ao.'@'.$requestType] = array(1,$urlep, $urlhttps, $listparam, $escapes,$path); 
    193207                  } 
    194208               } 
  • trunk/lib/jelix/core/url/jUrlEngine.significant.class.php

    r248 r267  
    285285        /* 
    286286        urlinfo = 
    287             array(0,'entrypoint','handler') 
     287            array(0,'entrypoint', https true/false, entrypoint true/false,'handler') 
    288288            ou 
    289             array(1,'entrypoint', 
     289            array(1,'entrypoint', https true/false, entrypoint true/false 
    290290                    array('annee','mois','jour','id','titre'), // liste des param�es de l'url �rendre en compte 
    291291                    array(true, false..), // valeur des escapes 
     
    293293                    ) 
    294294            ou 
    295             array(2,'entrypoint'); pour les cl�du type "@request" ou "module~@request" 
     295            array(2,'entrypoint', https true/false, entrypoint true/false); pour les cl�du type "@request" 
     296            array(3,'entrypoint', https true/false, entrypoint true/false); pour les cl�du type "module~@request" 
    296297 
    297298        */ 
    298299 
    299300        $url->scriptName = $GLOBALS['gJConfig']->urlengine['basePath'].$urlinfo[1]; 
    300         if(!$GLOBALS['gJConfig']->urlengine['multiview']){ 
     301        if($urlinfo[2]) 
     302            $url->scriptName = 'https://'.$_SERVER['HTTP_HOST'].$url->scriptName; 
     303 
     304        if($urlinfo[1] && !$GLOBALS['gJConfig']->urlengine['multiview']){ 
    301305            $url->scriptName.=$GLOBALS['gJConfig']->urlengine['entrypointExtension']; 
    302306        } 
     
    311315 
    312316        if($urlinfo[0]==0){ 
    313             $s = new jSelectorUrlHandler($urlinfo[2]); 
     317            $s = new jSelectorUrlHandler($urlinfo[3]); 
    314318            $c ='URLS'.$s->resource; 
    315319            $handler =new $c(); 
    316320            $handler->create($urlact, $url); 
    317321        }elseif($urlinfo[0]==1){ 
    318             $result = $urlinfo[4]; 
    319             foreach ($urlinfo[2] as $k=>$param){ 
    320                 if($urlinfo[3][$k]){ 
     322            $result = $urlinfo[5]; 
     323            foreach ($urlinfo[3] as $k=>$param){ 
     324                if($urlinfo[4][$k]){ 
    321325                    $result=str_replace(':'.$param, jUrl::escape($url->getParam($param,''),true), $result); 
    322326                }else{ 
     
    325329                $url->delParam($param); 
    326330            } 
    327  
    328             $url->pathInfo = $result; 
     331            if($urlinfo[1]) 
     332                $url->pathInfo = $result; 
     333            else 
     334                $url->pathInfo = substr($result,1); 
     335 
    329336        }elseif($urlinfo[0]==3){ 
    330337            $url->delParam('module'); 
  • trunk/lib/jelix/core/url/jUrlEngine.simple.class.php

    r248 r267  
    6262    protected function getScript($requestType, $module=null, $action=null){ 
    6363        static $urlspe = null; 
     64        static $urlhttps = null; 
    6465        global $gJConfig; 
    6566 
    6667        $script = $gJConfig->urlengine['defaultEntrypoint']; 
     68 
     69        if($urlhttps == null){ 
     70            $urlhttps=array(); 
     71            $selectors = preg_split("/[\s,]+/", $gJConfig->urlengine['simple_urlengine_https']); 
     72            foreach($selectors as $sel2){ 
     73                $urlhttps[$sel2]= true; 
     74            } 
     75        } 
     76 
     77        $usehttps= false; 
     78        if($action && $action !='' && isset($urlhttps[$module.'~'.$action.'@'.$requestType])){ 
     79            $usehttps = true; 
     80        } 
     81        if($module && $module !='' && !$usehttps &&  isset($urlhttps[$module.'~*@'.$requestType])){ 
     82            $usehttps = true; 
     83        } 
     84        if(!$usehttps && isset($urlhttps['@'.$requestType])){ 
     85            $usehttps = true; 
     86        } 
     87 
    6788 
    6889        if(count($gJConfig->simple_urlengine_entrypoints)){ 
     
    92113            $script.=$gJConfig->urlengine['entrypointExtension']; 
    93114        } 
    94         return $gJConfig->urlengine['basePath'].$script; 
     115 
     116        if($usehttps){ 
     117            return 'https://'.$_SERVER['HTTP_HOST'].$gJConfig->urlengine['basePath'].$script; 
     118        }else{ 
     119            return $gJConfig->urlengine['basePath'].$script; 
     120        } 
    95121    } 
    96122} 
  • trunk/lib/jelix/docs/ns/dao.rng

    r149 r267  
    6262               <optional><attribute name="minlength"><data type="int" /></attribute></optional> 
    6363               <optional><attribute name="maxlength"><data type="int" /></attribute></optional> 
    64                <optional><attribute name="required"><data type="boolean" /></attribute></optional> 
    6564               <optional><attribute name="regexp" /></optional> 
    6665               <optional><attribute name="sequence" /></optional> 
     
    144143         <element name="parameter"> 
    145144            <attribute name="name" /> 
     145            <optional><attribute name="default" /></optional> 
    146146            <empty/> 
    147147         </element> 
     
    156156                   <value>and</value> 
    157157                   <value>or</value> 
     158                   <value>AND</value> 
     159                   <value>OR</value> 
    158160                </choice> 
    159161             </attribute> 
     
    162164            <choice> 
    163165               <element name="eq"><ref name="method.condition.attr" /></element> 
    164                <element name="noteq"><ref name="method.condition.attr" /></element> 
     166               <element name="neq"><ref name="method.condition.attr" /></element> 
    165167               <element name="lt"><ref name="method.condition.attr" /></element> 
    166168               <element name="gt"><ref name="method.condition.attr" /></element> 
    167169               <element name="lteq"><ref name="method.condition.attr" /></element> 
    168170               <element name="gteq"><ref name="method.condition.attr" /></element> 
     171               <element name="like"><ref name="method.condition.attr" /></element> 
     172               <element name="notlike"><ref name="method.condition.attr" /></element> 
    169173               <element name="isnull"><ref name="method.condition.attr.null" /></element> 
    170                <element name="notisnull"><ref name="method.condition.attr.null" /></element> 
     174               <element name="isnotnull"><ref name="method.condition.attr.null" /></element> 
    171175               <element name="in"><ref name="method.condition.attr" /></element> 
    172176               <element name="notin"><ref name="method.condition.attr" /></element> 
     177               <element name="binary_op"><ref name="method.condition.attr.binaryop" /></element> 
     178 
    173179               <ref name="method.conditions" /> 
    174180            </choice> 
     
    192198   </define> 
    193199 
    194  
     200   <define name="method.condition.attr.binaryop"> 
     201       <attribute name="property" /> 
     202       <choice> 
     203           <attribute name="value" /> 
     204           <attribute name="expr" /> 
     205       </choice> 
     206       <attribute name="operator" /> 
     207       <optional><attribute name="driver" /></optional> 
     208       <empty /> 
     209   </define> 
    195210 
    196211   <define name="method.values"> 
     
    222237                           <value>ASC</value> 
    223238                           <value>DESC</value> 
     239                           <value>asc</value> 
     240                           <value>desc</value> 
    224241                        </choice> 
    225242                     </attribute> 
  • trunk/lib/jelix/docs/ns/urls.rng

    r94 r267  
    2020            <name>xmlrpcentrypoint</name> 
    2121            <name>jsonrpcentrypoint</name> 
     22            <name>rdfentrypoint</name> 
     23            <name>xmlentrypoint</name> 
     24            <name>xulentrypoint</name> 
    2225         </choice> 
    2326 
    2427         <optional><attribute name="default"><data type="boolean"/></attribute></optional> 
     28         <optional> <attribute name="noentrypoint"><data type="boolean"/></attribute> </optional> 
     29         <optional> <attribute name="https"><data type="boolean"/></attribute> </optional> 
     30 
    2531         <attribute name="name"/> 
    2632         <zeroOrMore> 
     
    3642      <element name="url"> 
    3743         <attribute name="module" /> 
     44         <optional> <attribute name="noentrypoint"><data type="boolean"/></attribute> </optional> 
     45         <optional> <attribute name="https"><data type="boolean"/></attribute> </optional> 
    3846         <optional> 
    3947             <attribute name="action" /> 
     
    5664   <define name="url.handler"> 
    5765      <element name="url"> 
     66         <attribute name="module" /> 
     67         <optional> <attribute name="noentrypoint"><data type="boolean"/></attribute> </optional> 
     68         <optional> <attribute name="https"><data type="boolean"/></attribute> </optional> 
    5869         <attribute name="handler" /> 
    59          <attribute name="module" /> 
    6070         <optional> 
    6171            <attribute name="action" /> 
  • trunk/testapp/modules/unittest/classes/utcreateurls.class.php

    r247 r267  
    9696         'defaultEntrypoint'=>'index', 
    9797         'entrypointExtension'=>'.php', 
    98          'notfoundAct'=>'jelix~notfound' 
     98         'notfoundAct'=>'jelix~notfound', 
     99         'simple_urlengine_https'=>'unittest~urlsig_url8@classic @xmlrpc', 
    99100       ); 
    100101      /* $gJConfig->simple_urlengine_entrypoints = array( 
     
    115116      $urlList[]= array('urlsig_url5', array('foo'=>'oof',  'bar'=>'rab')); 
    116117      $urlList[]= array('jelix~bar@xmlrpc', array('aaa'=>'bbb')); 
     118      $urlList[]= array('unittest~urlsig_url8', array('rubrique'=>'vetements',  'id_article'=>'98')); 
    117119 
    118120      $trueResult=array( 
     
    123125          "/index.php?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 
    124126          "/xmlrpc.php", 
    125        ); 
    126  
     127          "/index.php?rubrique=vetements&id_article=98&module=unittest&action=urlsig_url8", 
     128       ); 
     129 
     130 
     131      $trueResult[5]='https://'.$_SERVER['HTTP_HOST'].$trueResult[5]; 
     132      $trueResult[6]='https://'.$_SERVER['HTTP_HOST'].$trueResult[6]; 
    127133      $this->_doCompareUrl("simple, multiview = false", $urlList,$trueResult); 
    128134 
     
    135141          "/index?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 
    136142          "/xmlrpc", 
    137        ); 
     143          "/index?rubrique=vetements&id_article=98&module=unittest&action=urlsig_url8", 
     144       ); 
     145      $trueResult[5]='https://'.$_SERVER['HTTP_HOST'].$trueResult[5]; 
     146      $trueResult[6]='https://'.$_SERVER['HTTP_HOST'].$trueResult[6]; 
    138147      $this->_doCompareUrl("simple, multiview = true", $urlList,$trueResult); 
    139148 
     
    155164         'defaultEntrypoint'=>'index', 
    156165         'entrypointExtension'=>'.php', 
    157          'notfoundAct'=>'jelix~notfound' 
     166         'notfoundAct'=>'jelix~notfound', 
     167         'simple_urlengine_https'=>'unittest~urlsig_url8@classic @xmlrpc', 
    158168       ); 
    159169 
     
    207217      $urlList[]= array('urlsig_url2', array('mois'=>'05',  'annee'=>'2004')); 
    208218      $urlList[]= array('unittest~urlsig_url3', array('rubrique'=>'actualite',  'id_art'=>'65', 'article'=>'c\'est la f� au village')); 
     219      $urlList[]= array('unittest~urlsig_url6', array('rubrique'=>'actualite',  'id_art'=>'65')); 
    209220      $urlList[]= array('unittest~urlsig_url4', array('first'=>'premier',  'second'=>'deuxieme')); 
    210221      // celle ci n'a pas de d�nition dans urls.xml *expr� 
     
    212223      $urlList[]= array('jelix~bar@xmlrpc', array('aaa'=>'bbb')); 
    213224      $urlList[]= array('news~bar', array('aaa'=>'bbb')); 
     225      $urlList[]= array('unittest~urlsig_url8', array('rubrique'=>'vetements',  'id_article'=>'98')); 
    214226 
    215227      $trueResult=array( 
     
    217229          "/testnews.php/2004/05", 
    218230          "/index.php/test/cms/actualite/65-c-est-la-fete-au-village", 
     231          "/test/cms2/actualite/65", 
    219232          "/foo/bar.php/withhandler/premier/deuxieme", 
    220233          "/index.php?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 
    221234          "/xmlrpc.php", 
    222           "/news.php?aaa=bbb&action=default_bar" 
    223        ); 
    224  
     235          "/news.php?aaa=bbb&action=default_bar", 
     236          "/index.php/shop/vetements/98" 
     237 
     238       ); 
     239 
     240      $trueResult[8]='https://'.$_SERVER['HTTP_HOST'].$trueResult[8]; 
    225241      $this->_doCompareUrl("significant, multiview = false", $urlList,$trueResult); 
    226242 
     
    231247          "/testnews/2004/05", 
    232248          "/index/test/cms/actualite/65-c-est-la-fete-au-village", 
     249          "/test/cms2/actualite/65", 
    233250          "/foo/bar/withhandler/premier/deuxieme", 
    234251          "/index?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 
    235252          "/xmlrpc", 
    236           "/news?aaa=bbb&action=default_bar" 
    237        ); 
     253          "/news?aaa=bbb&action=default_bar", 
     254          "/index/shop/vetements/98" 
     255       ); 
     256      $trueResult[8]='https://'.$_SERVER['HTTP_HOST'].$trueResult[8]; 
    238257      $this->_doCompareUrl("significant, multiview = true", $urlList,$trueResult); 
    239258 
  • trunk/testapp/var/config/defaultconfig.ini.php.dist

    r263 r267  
    7676IISStripslashesPathKey = on 
    7777 
     78; liste des actions requerant https (syntaxe expliqu�dessous), pour le moteur d'url simple 
     79simple_urlengine_https = "unittest~urlsig_url8@classic @xmlrpc" 
    7880 
    7981[simple_urlengine_entrypoints] 
     
    9496news = "new~*@classic" 
    9597 
     98__https= 
     99 
    96100[logfiles] 
    97101default=messages.log 
  • trunk/testapp/var/config/urls.xml

    r98 r267  
    2020        </url> 
    2121 
     22        <url pathinfo="/test/cms2/:rubrique/:id_art" module="unittest" action="urlsig_url6" noentrypoint="true"> 
     23           <param name="rubrique" /> 
     24           <param name="id_art" regexp="\d+"/> 
     25        </url> 
     26 
     27        <url pathinfo="/shop/:rubrique/:id_article" module="unittest" https="true" action="urlsig_url8"> 
     28           <param name="rubrique" /> 
     29           <param name="id_article" type="int"/> 
     30        </url> 
    2231    </classicentrypoint> 
    2332    <classicentrypoint name="testnews"> 
Download in other formats: Unified Diff Zip Archive