Show
Ignore:
Timestamp:
09/05/2007 01:19:24 PM (15 months ago)
Author:
OscarB
Message:

UG updates: Adding libraries content, encryption, input

Location:
trunk/modules/user_guide/views/user_guide/en/libraries
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/user_guide/views/user_guide/en/libraries/encryption.php

    r447 r503  
    1 Article status [Stub] requires [Writing] Describe encryption class and usage 
     1Article status [First draft] requires [Editing] Describe class 
    22# Encryption Class 
    3 This is a stub (please write me) 
     3Todo Describe the class 
     4 
     5## Methods 
     6 
     7### Encode 
     8<code>$this->encrypt->encode()</code> accepts multiple parameters. The input **string** is required. 
     9Returns an encoded string. 
     10 
     11    $encoded_message = $this->encrypt->encode($str, $key = ''); 
     12 
     13**** 
     14 
     15### Decode 
     16<code>$this->encrypt->decode()</code> accepts multiple parameters. The input **string** is required. 
     17Returns a decoded string. 
     18 
     19    $decoded_message = $this->encrypt->decode($str, $key = ''); 
     20 
     21 
     22**** 
     23 
     24### Hash 
     25<code>$this->encrypt->hash()</code> accepts one mandatory parameter. The input **string** is required. 
     26Returns a message digest. 
     27 
     28    $sha_digest = $this->encrypt->hash($str); 
     29 
     30 
     31 
     32<?php echo $this->load->view('user_guide/en/abbr') ?> 
     33<?php /* $Id$ */ ?> 
  • trunk/modules/user_guide/views/user_guide/en/libraries/input.php

    r447 r503  
    1 Article status [Stub] requires [Writing] Describe input class and usage 
     1Article status [First draft] requires [Editing] Describe input class and usage 
    22# Input Class 
    3 This is a stub (please write me) 
     3todo describe class 
     4 
     5## Methods 
     6 
     7### Fetch item from GET array 
     8<code>$this->input->get()</code> accepts multiple optional parameters. 
     9Returns item as a string or <code>FALSE</code> if item does not exist. 
     10 
     11    $get_item = $this->input->get($index = 'item', $xss_clean = TRUE); 
     12 
     13Setting <code>$index = FALSE</code> returns the GET array.<br /> 
     14Setting <code>$xss_clean = TRUE</code> filters GET for unsafe data. 
     15 
     16**** 
     17 
     18### Fetch item from POST array 
     19<code>$this->input->post()</code> accepts multiple optional parameters. 
     20Returns item as a string or <code>FALSE</code> if item does not exist. 
     21 
     22    $post_item = $this->input->post($index = 'item', $xss_clean = TRUE); 
     23 
     24Setting <code>$index = FALSE</code> returns the POST array.<br /> 
     25Setting <code>$xss_clean = TRUE</code> filters POST for unsafe data. 
     26 
     27**** 
     28 
     29### Fetch item from COOKIE array 
     30<code>$this->input->post()</code> accepts multiple optional parameters. 
     31Returns item as a string or <code>FALSE</code> if item does not exist. 
     32 
     33    $cookie_item = $this->input->post($index = 'item', $xss_clean = TRUE); 
     34 
     35Setting <code>$index = FALSE</code> returns the COOKIE array.<br /> 
     36Setting <code>$xss_clean = TRUE</code> filters COOKIE for unsafe data. 
     37 
     38**** 
     39 
     40### Fetch item from SERVER array 
     41<code>$this->input->server()</code> accepts multiple optional parameters. 
     42Returns item as a string or <code>FALSE</code> if item does not exist. 
     43 
     44    $server_item = $this->input->server($index = 'item', $xss_clean = TRUE); 
     45 
     46Setting <code>$index = FALSE</code> returns the SERVER array.<br /> 
     47Setting <code>$xss_clean = TRUE</code> filters SERVER for unsafe data 
     48 
     49**** 
     50 
     51### Fetch IP address from SERVER array 
     52<code>$this->input->ip_address()</code> has no parameters. 
     53Returns IP address as a string in dotted quad notation eg. <code>"192.0.0.12"</code><br /> 
     54Returns <code>"0.0.0.0"</code> if IP address is not found or invalid. 
     55 
     56    echo $this->input->ip_address(); 
     57 
     58**** 
     59 
     60### Validate IP address from SERVER array 
     61<code>$this->input->valid_ip()</code> accepts one mandatory parameter. 
     62Returns <code>FALSE</code> if IP address is invalid. 
     63 
     64    $ip = "192.0.0.44"; 
     65    echo $this->input->valid_ip($ip); 
     66 
     67**** 
     68 
     69### Fetch USER_AGENT from SERVER array 
     70<code>$this->input->user_agent()</code> has no parameters. 
     71Returns the user agent as a string.<br /> 
     72Returns <code>FALSE</code> if user agent is not found. 
     73 
     74    echo $this->input->user_agent(); 
     75 
     76**** 
     77 
     78### Filter input for XSS 
     79<code>$this->input->xss_clean()</code> accepts multiple parameters. Input string to filter is required. 
     80Returns a string with unsafe data filtered out. Note: The input data may be **modified** by filtering. 
     81 
     82    $clean_item =  $this->input->xss_clean($item, charset = 'ISO-8859-1'); 
     83 
     84 
     85 
     86 
     87 
     88<?php echo $this->load->view('user_guide/en/abbr') ?> 
     89<?php /* $Id$ */ ?>