Changeset 110

Show
Ignore:
Timestamp:
04/19/07 08:36:24
Author:
grahack
Message:

FAL: builded a list of examples

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • FreakAuth/trunk/www/system/application/controllers/admin/example.php

    r87 r110  
    5959                                                 ."<p>Click <b>".anchor('admin/example/restrict_example', 'here')."</b>: if you are a superadmin you will see something</p>" 
    6060                                                 ."<p>I'm sure You are smart enough!</p>"; 
    61                  
     61                $data['content'].="<br /><br />Be sure to check the main "; 
     62        $data['content'].=anchor('example', 'examples')." too."; 
    6263                $data['page'] = $this->config->item('FAL_template_dir').'template_admin/example/example'; 
    6364         
  • FreakAuth/trunk/www/system/application/controllers/example.php

    r64 r110  
    11<?php 
    22class Example extends Controller { 
    3  
    4        function Example() 
    5        { 
    6             parent::Controller(); 
    7                           
    8             //thanks to this line of code you can protect this controller 
    9             $this->freakauth_light->check(); 
    10        } 
    11         
    12        //---------------------------------------------------------------------- 
    13        ##### index ##### 
    14                   function index() 
    15                   { 
    16               $this->load->view($this->config->item('FAL_template_dir').'template/example'); 
    17                   } 
     3     
     4    function Example() 
     5    { 
     6         parent::Controller(); 
     7                  
     8         //thanks to this line of code you could protect this controller entirely 
     9         //$this->freakauth_light->check(); 
     10          
     11         $this->_container = $this->config->item('FAL_template_dir').'template/container'; 
     12    } 
     13     
     14        function index() 
     15        { 
     16        $data['heading'] = 'FreakAuth examples'; 
     17        $data['page'] = $this->config->item('FAL_template_dir').'template/examples/examples'; 
     18        $this->load->vars($data); 
     19        $this->load->view($this->_container); 
     20        } 
     21      
     22        function basic() 
     23        { 
     24        $data['heading'] = 'FreakAuth examples'; 
     25        $data['page'] = $this->config->item('FAL_template_dir').'template/examples/example'; 
     26        $this->load->vars($data); 
     27        $this->load->view($this->_container); 
     28        } 
     29     
     30        function conditions() 
     31        { 
     32        $data['heading'] = 'FreakAuth examples'; 
     33        $data['page'] = $this->config->item('FAL_template_dir').'template/examples/conditions'; 
     34        $this->load->vars($data); 
     35        $this->load->view($this->_container); 
     36        } 
     37     
     38        function restricted_to_users() 
     39        { 
     40        $this->freakauth_light->check(); 
     41         
     42        $data['heading'] = 'FreakAuth examples'; 
     43        $data['page'] = $this->config->item('FAL_template_dir').'template/examples/restricted'; 
     44        $this->load->vars($data); 
     45        $this->load->view($this->_container); 
     46        } 
     47     
     48        function restricted_to_admins() 
     49        { 
     50        $this->freakauth_light->check('admin'); 
     51         
     52        $data['heading'] = 'FreakAuth examples'; 
     53        $data['page'] = $this->config->item('FAL_template_dir').'template/examples/restricted'; 
     54        $this->load->vars($data); 
     55        $this->load->view($this->_container); 
     56        } 
     57     
     58        function restricted_to_admins_only() 
     59        { 
     60        $this->freakauth_light->check('admin', true); 
     61         
     62        $data['heading'] = 'FreakAuth examples'; 
     63        $data['page'] = $this->config->item('FAL_template_dir').'template/examples/restricted'; 
     64        $this->load->vars($data); 
     65        $this->load->view($this->_container); 
     66        } 
    1867} 
    1968?> 
  • FreakAuth/trunk/www/system/application/views/FreakAuth_light/template/examples/example.php

    r108 r110  
    1 <html> 
    2     <head> 
    3     </head> 
    4     <body> 
    5         <h1 style="text-align:center;">EXAMPLE VIEW</h1> 
    6         <h2>You can view this message because you logged in and are at least an user!</h2> 
    7                 You are <b><?=getUserName()?></b> (role:<b><?=getUserProperty('role')?></b>), 
    8                 your id is <b><?=getUserProperty('id')?></b>.<br /> 
    9                 Your superadmin is <b><?=getUserPropertyFromId(1,'user_name')?></b>.<br /> 
    10         <?=anchor('', 'back')?> 
    11     </body> 
    12 </html> 
     1You are <b><?=getUserName()?></b> (role:<b><?=getUserProperty('role')?></b>), 
     2your id is <b><?=getUserProperty('id')?></b>.<br /> 
     3 
     4Your first superadmin is <b><?=getUserPropertyFromId(1,'user_name')?></b>. 
     5 
     6<br /><br /><?=anchor('example', 'back to the list')?> 
  • FreakAuth/trunk/www/system/application/views/FreakAuth_light/template/menu.php

    r95 r110  
    11        <ul id="navlist"> 
    22                <li id="active"><?=anchor('', 'home')?></li> 
    3                 <li><?=anchor('example', 'example')?></li> 
     3                <li><?=anchor('example', 'examples')?></li> 
    44                <li><?=anchor('auth', 'login')?></li> 
    55                <li><?=anchor('auth/register', 'register')?></li>