Changeset 538

Show
Ignore:
Timestamp:
05/21/08 01:02:56 (6 months ago)
Author:
aarkerio
Message:

New Try

Location:
trunk/app
Files:
47 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/app_controller.php

    r491 r538  
    2424     $this->Auth->loginError     = 'Invalid e-mail / password combination. Please try again'; 
    2525     $this->Auth->authorize      = 'controller';   
    26      $this->Auth->autoRedirect   = true; 
    2726     $this->Auth->deny('*'); 
    2827    
    2928     $this->set('cU', $this->Auth->user());  // $cU current user array to use in the views if user logged in 
    3029 } 
    31    
     30  
    3231 public function msgFlash($msg, $to) 
    3332 { 
  • trunk/app/controllers/acquaintances_controller.php

    r526 r538  
    2929       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    3030          return true; 
     31       else: 
     32              return false; 
    3133       endif; 
    32    endif;  
    33    return false;  // go away !! 
     34   endif; 
     35  
     36   return true; 
    3437 } 
    3538  
  • trunk/app/controllers/answers_controller.php

    r526 r538  
    2323 public function isAuthorized()  
    2424 {       
    25     if (isset( $this->params[Configure::read('Routing.admin')] ))  
    26     { 
    27         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 )  // admin and teachers 
    28         { 
    29         return true; 
    30         }  
    31     }  
    32     return false;  // go away !! 
     25   if (isset( $this->params[Configure::read('Routing.admin')] )): 
     26       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     27         return true; 
     28       else: 
     29             return false; 
     30       endif;    
     31   endif; 
     32 
     33   return true; 
    3334 } 
    3435 
  • trunk/app/controllers/categories_controller.php

    r526 r538  
    2121   parent::beforeFilter(); 
    2222 } 
    23     
    24  public function isAuthorized() 
    25  {      
     23  
     24 public function isAuthorized()  
     25 {       
    2626   if (isset( $this->params[Configure::read('Routing.admin')] )): 
    27             if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    28                  return true; 
    29             endif; 
     27       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     28         return true; 
     29       else: 
     30             return false; 
     31       endif;    
    3032   endif; 
    31    return false;  // go away !! 
    32   } 
    3333 
    34   public function index($order = null) 
    35   { 
     34   return true; 
     35 }   
     36 
     37 public function index($order = null) 
     38 { 
    3639        $this->layout    = 'admin'; 
    3740        $this->pageTitle = 'Categories'; 
  • trunk/app/controllers/catfaqs_controller.php

    r510 r538  
    2626 public function isAuthorized()  
    2727 {       
    28     if (isset( $this->params[Configure::read('Routing.admin')] ))  
    29     { 
    30         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 )  // admin and teachers 
    31         { 
    32         return true; 
    33         }  
    34     }  
    35     return false;  // go away !! 
     28   if (isset( $this->params[Configure::read('Routing.admin')] )): 
     29       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     30         return true; 
     31       else: 
     32             return false; 
     33       endif;    
     34   endif; 
     35 
     36   return true; 
    3637 } 
    3738  
  • trunk/app/controllers/catforums_controller.php

    r526 r538  
    2424 } 
    2525 
    26  public function isAuthorized() 
    27  {      
     26 public function isAuthorized()  
     27 {       
    2828   if (isset( $this->params[Configure::read('Routing.admin')] )): 
    29         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    30                return true; 
    31         endif; 
     29       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     30         return true; 
     31       else: 
     32             return false; 
     33       endif;    
    3234   endif; 
    33    return false;  // go away !! 
     35 
     36   return true; 
    3437 } 
    3538  
  • trunk/app/controllers/catglossaries_controller.php

    r526 r538  
    2727 {       
    2828   if (isset( $this->params[Configure::read('Routing.admin')] )): 
    29         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    30            return true; 
    31         endif; 
     29       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     30         return true; 
     31       else: 
     32             return false; 
     33       endif;    
    3234   endif; 
    33    return false;  // go away !! 
     35 
     36   return true; 
    3437 } 
    3538 
  • trunk/app/controllers/colleges_controller.php

    r510 r538  
    2727 {       
    2828   if (isset( $this->params[Configure::read('Routing.admin')] )): 
    29         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     29       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    3030         return true; 
    31     endif;  
    32    endif;  
    33   return false;  // go away !! 
     31       else: 
     32             return false; 
     33       endif;    
     34   endif; 
     35 
     36   return true; 
    3437 } 
    35  
    3638 
    3739 public function view()  
  • trunk/app/controllers/comments_controller.php

    r526 r538  
    2323    $this->Auth->allow(array('view', 'add')); 
    2424 } 
    25   
     25   
    2626 public function isAuthorized()  
    2727 {       
    2828   if (isset( $this->params[Configure::read('Routing.admin')] )): 
    29         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     29       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    3030         return true; 
    31         endif; 
    32    endif;  
    33      
    34    return false;  // go away !! 
     31       else: 
     32             return false; 
     33       endif;    
     34   endif; 
     35 
     36   return true; 
    3537 } 
    36  
    37  
     38  
    3839 public function view($username=null, $entry_id=null) 
    3940 {     
  • trunk/app/controllers/confirms_controller.php

    r526 r538  
    2323 {       
    2424   if (isset( $this->params[Configure::read('Routing.admin')] )): 
    25         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    26           return true; 
    27     endif; 
    28     endif;  
    29     return false;  // go away !! 
     25       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     26         return true; 
     27       else: 
     28             return false; 
     29       endif;    
     30   endif; 
     31 
     32   return true; 
    3033 } 
    3134  
  • trunk/app/controllers/discussions_controller.php

    r537 r538  
    2828    endif; 
    2929 } 
    30  
     30  
    3131 public function isAuthorized()  
    3232 {       
    3333   if (isset( $this->params[Configure::read('Routing.admin')] )): 
    34         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    35           return true; 
    36         endif; 
     34       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     35         return true; 
     36       else: 
     37             return false; 
     38       endif;    
    3739   endif; 
    38    return false;  // go away !! 
     40 
     41   return true; 
    3942 } 
    40  
     43  
    4144 public function add() 
    4245 { 
  • trunk/app/controllers/ecourses_controller.php

    r526 r538  
    2121    $this->Auth->allow(array('display')); 
    2222 } 
     23  
    2324 public function isAuthorized()  
    2425 {       
    2526   if (isset( $this->params[Configure::read('Routing.admin')] )): 
    26         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    27           return true; 
    28         endif; 
     27       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     28         return true; 
     29       else: 
     30             return false; 
     31       endif;    
    2932   endif; 
    30    return false;  // go away !! 
     33 
     34   return true; 
    3135 } 
     36  
    3237 
    3338 /**** 
  • trunk/app/controllers/entries_controller.php

    r528 r538  
    2323    parent::beforeFilter(); 
    2424    $this->Auth->allow(array('rss', 'search')); 
    25  } 
     25 }  
    2626  
    2727 public function isAuthorized()  
    2828 {       
    29     if (isset( $this->params[Configure::read('Routing.admin')] )): 
    30         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     29   if (isset( $this->params[Configure::read('Routing.admin')] )): 
     30       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    3131         return true; 
    32         endif; 
    33     endif; 
    34     return false;  // go away !! 
     32       else: 
     33             return false; 
     34       endif;    
     35   endif; 
     36 
     37   return true; 
    3538 } 
    3639 
  • trunk/app/controllers/events_controller.php

    r510 r538  
    2525    $this->Auth->allow(array('display')); 
    2626  } 
     27  
     28 public function isAuthorized()  
     29 {       
     30   if (isset( $this->params[Configure::read('Routing.admin')] )): 
     31       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     32         return true; 
     33       else: 
     34             return false; 
     35       endif;    
     36   endif; 
     37 
     38   return true; 
     39 } 
     40  
    2741    
    2842  public function calendar() 
  • trunk/app/controllers/faqs_controller.php

    r526 r538  
    2424 } 
    2525 
    26  public function isAuthorized() 
    27  { 
    28    if (isset($this->params[Configure::read('Routing.admin')])): 
    29         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2):           
    30                       return true; 
    31         endif; 
     26 public function isAuthorized()  
     27 {       
     28   if (isset( $this->params[Configure::read('Routing.admin')] )): 
     29       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     30         return true; 
     31       else: 
     32             return false; 
     33       endif;    
    3234   endif; 
    33    return false; // go away!! 
     35 
     36   return true; 
    3437 } 
    35   
     38   
    3639 public function index($order = null) 
    3740 { 
  • trunk/app/controllers/forums_controller.php

    r510 r538  
    2626 public function isAuthorized()  
    2727 {       
    28     if (isset( $this->params[Configure::read('Routing.admin')] ))  
    29     { 
    30         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 )  // admin and teachers 
    31         { 
    32         return true; 
    33         }  
    34     }  
    35     return false;  // go away !! 
     28   if (isset( $this->params[Configure::read('Routing.admin')] )): 
     29       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     30         return true; 
     31       else: 
     32             return false; 
     33       endif;    
     34   endif; 
     35 
     36   return true; 
    3637 } 
    3738  
  • trunk/app/controllers/galleries_controller.php

    r510 r538  
    2525 public function isAuthorized()  
    2626 {       
    27     if (isset( $this->params[Configure::read('Routing.admin')] ))  
    28     { 
    29         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 )  // admin and teachers 
    30         { 
    31         return true; 
    32         }  
    33     }  
    34     return false;  // go away !! 
     27   if (isset( $this->params[Configure::read('Routing.admin')] )): 
     28       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     29         return true; 
     30       else: 
     31             return false; 
     32       endif;    
     33   endif; 
     34 
     35   return true; 
    3536 } 
    36  
    37  
    38   public function index($id = null) 
    39   { 
     37  
     38 public function index($id = null) 
     39 { 
    4040        $this->pageTitle = 'View Active Users'; 
    4141        $this->set('data', $this->User->findAll());  
    4242        $this->set('color', 'blue'); 
    43   } 
     43 } 
    4444     
    45   public function listview() 
    46   {          
     45 public function listview() 
     46 {          
    4747        $this->layout    = 'popup'; 
    4848         
  • trunk/app/controllers/glossaries_controller.php

    r526 r538  
    2222   parent::beforeFilter(); 
    2323 } 
     24 
    2425  
    2526 public function isAuthorized()  
    2627 {       
    2728   if (isset( $this->params[Configure::read('Routing.admin')] )): 
    28         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     29       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    2930         return true; 
    30         endif; 
    31     endif; 
    32     return false;  // go away !! 
     31       else: 
     32             return false; 
     33       endif;    
     34   endif; 
     35 
     36   return true; 
    3337 } 
    34      
     38   
    3539 public function display($username) 
    3640 { 
  • trunk/app/controllers/groups_controller.php

    r526 r538  
    2121  } 
    2222 
    23   public function isAuthorized()  
    24   { 
    25     if (isset( $this->params[Configure::read('Routing.admin')] )): 
    26               if ($this->Auth->user('group_id') == 1  ):  // admin                     
    27                       return true; 
    28                   endif; 
    29     endif; 
    30     return false;  // go away !!      
    31   } 
     23 public function isAuthorized()  
     24 {       
     25   if (isset( $this->params[Configure::read('Routing.admin')] )): 
     26       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     27         return true; 
     28       else: 
     29             return false; 
     30       endif;    
     31   endif; 
     32 
     33   return true; 
     34 } 
    3235   
    3336 /**   === ADMIN METHODS ===  **/  
  • trunk/app/controllers/helps_controller.php

    r526 r538  
    2323     $this->Auth->allow(array('display', 'tour')); 
    2424 } 
    25    
     25  
    2626 public function isAuthorized()  
    2727 {       
    2828   if (isset( $this->params[Configure::read('Routing.admin')] )): 
    29          if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    30            return true; 
    31          endif; 
     29       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     30         return true; 
     31       else: 
     32             return false; 
     33       endif;    
    3234   endif; 
    33    return false;  // go away !! 
     35 
     36   return true; 
    3437 } 
    35  
     38  
    3639 public function tour()  
    3740 { 
  • trunk/app/controllers/images_controller.php

    r533 r538  
    1818  public $components    = array('Adds'); 
    1919 
    20   public function beforeFilter() 
    21   { 
     20 public function beforeFilter() 
     21 { 
    2222     parent::beforeFilter(); 
    23   } 
    24      
    25   public function isAuthorized()  
    26   {       
    27     if (isset( $this->params[Configure::read('Routing.admin')] )): 
    28         if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
    29             return true; 
    30         endif;  
    31     endif; 
    32     return false;  // go away !! 
     23 } 
     24     
     25 public function isAuthorized()  
     26 {       
     27   if (isset( $this->params[Configure::read('Routing.admin')] )): 
     28       if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ):  // admin and teachers 
     29         return true; 
     30       else: 
     31             return false; 
     32       endif;    
     33   endif; 
     34 
     35   return true;