User Tools

Site Tools


Sidebar

html:access:violations

Access Level Violations

Marking Access Violations

htmlOKay deals with access violations by marking up a page in the places where the access violations occur. Examples of this markup for each of the access levels are found in the following pages, which show the same HTML but at different access levels:

The following page has two access settings, M and L:

A page with multiple access levels should display at the most restrictive access level, which in this case is M. Sometimes, however, because of Dokuwiki's caching system, the last version saved may display. If this is the least restrictive version, you may have to invalidate the cache. In any case, if the last user to edit the page had the more restricted privileges, then the page will have been saved at the restricted level and that will be the new display version. In other, words, there is never any need for concern that someone with restricted privileges has made changes before these changes have been reviewed.

Errors Window

In addition to the marking up of access violations, there will also be a window which may contain more detailed error messages, as in the example below:

Content of Window

User Info:
hmtlOK_access_level: 2
client: wsmith
$conf['htmlok']: 1
Scope: html
---End User Info---
ID Selectors not supported at current HTML access level: #htmlO_K_div_1.
Element or Attribute not supported at current HTML access level: TABLE
Element or Attribute not supported at current HTML access level: div
Internal Window Elements Not Supported. External files cannot be included in wiki documents: IFRAME.

The User Info section contains four pieces of information–the current access level of this user, the name of the current user (or 'client'), the value of the $conf['htmlok'] variable, which should always be 1 (i.e. true), and the 'scope', which is the namespace under which the current page falls and from which it gets its access permissions. (See the explanation of namespace scope.) For a sample page with both the errors window and marked up access violations, see this page.


Placement of Window

By default this window will open just above the wiki page content. You can, however, place this window wherever you desire using the following:

 <?php $temp=array(); trigger_event('HTMLOK_ACCESS_EVENT', $temp); ?>

If you place this immediately blow the <body> tag, then the window will open at the top of the browser window. You couild, if you wish place it at the bottom of your browser window, for instance in the footer.

How to Open the Window

If you are using the dokuwiki template, an action link to Show HTML Errors will appear at the top of the page. If not, you can install your own action link by placing the following code in your template:

 <?php 
      if($INFO['htmlOK_client'] && $INFO['hmtlOK_access_level'] > 0) { 
          tpl_toolsevent('htmlokaytools', array());
      }
  ?>

Or you can add the following button anywhere in your template that is convenient:

<?php if($INFO['htmlOK_client'] && $INFO['hmtlOK_access_level'] > 0) { ?>
   <form name="htmlOK_errform">
    <div class="no">
     <input type="button" value="Show errors"
        class="button"  
        onclick="htmlOK_ERRORS(0);jQuery('#htmlOKDBG_ERRORWIN').toggle();" />
    </div>
  </form>	
<?php } ?>  

Refresh Button

More than one access level can be applied to the same namespace. For visitors to such a namespace, htmlOKay uses the the Display Level to determine the access level at which to display the pages in that namespace. (For an example See Marking Access Violations above.)

Because DokuWiki caches its pages, the HTML displayed to a visitor may be that of the last cached version of a page, instead of the version assigned to the display level.

More than one access level can be applied to the same namespace. For visitors to such a namespace, htmlOKay uses the the Display Level to determine the access level at which to display the pages in that namespace. (For an example See Marking Access Violations above.)

Because DokuWiki caches its pages, the HTML displayed to a visitor may be that of the last cached version of a page, instead of the version assigned to the display level. Because DokuWiki caches its pages, the HTML displayed to a visitor may be that of the last cached version of a page, instead of the version assigned to the display level, even though the plugin makes various efforts to avoid this problem. To get around this problem if you see it as a problem, you can create a refresh button, to re-parse the page after the developer has logged out:

button.php
    <form class="button" method="get" action=<?php  echo DOKU_BASE ."/doku.php"?>>
      <div class="no">
        <input type="hidden" name="do" value="show" />
        <input type="hidden" name="refresh" value="yes" />
        <input type="hidden" name="id" value="<?php echo $ID; ?>" />
        <input type="submit" value="Refresh" class="button"  />
      </div>
    </form>
html/access/violations.txt · Last modified: 2016/12/09 10:34 by tower