Changeset 1387

Show
Ignore:
Timestamp:
12/06/07 12:45:34 (10 months ago)
Author:
rho
Message:

minor cleanup code

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/includes.php

    r1378 r1387  
    154154    // and walled garden functionality is turned on, redirect to 
    155155    // the logon screen 
    156         if (!empty($CFG->walledgarden) && (context != "external" || !defined("context")) && !logged_on) { 
    157             header("Location: " . $CFG->wwwroot . "login/index.php"); 
    158             exit(); 
     156        if (!empty($CFG->walledgarden) && (!defined("context") || context != 'external') && !logged_on) { 
     157            require_login(); 
    159158        } 
    160159 
  • devel/mod/admin/index.php

    r1360 r1387  
    77 
    88    define("context", "admin"); 
     9    require_login('admin'); 
     10 
    911    templates_page_setup(); 
    1012 
  • devel/mod/community/addgroup.php

    r1369 r1387  
    1212       // run("communities:init"); 
    1313 
     14        require_login(); 
     15 
    1416        define("context", "network"); 
    1517        templates_page_setup(); 
    16  
    17     // Whose friends are we looking at? 
    18         global $page_owner; 
    19  
    20     // You must be logged on to view this! 
    21     //    protect(1); 
    2218 
    2319        $title = user_info("name", page_owner())  . " :: ". __gettext("Invite a Community"); 
  • devel/mod/community/index.php

    r1369 r1387  
    1717        templates_page_setup(); 
    1818 
    19     // Whose friends are we looking at? 
    20         global $page_owner; 
    21  
    22     // You must be logged on to view this! 
    23     //    protect(1); 
    24  
    2519        $title = run("profile:display:name") . " :: " . __gettext("Communities"); 
    2620        $body = run('communities:editpage'); 
  • devel/mod/community/members.php

    r1369 r1387  
    1717        templates_page_setup(); 
    1818 
    19     // Whose friends are we looking at? 
    20         global $page_owner,$profile_id; 
    21  
    22     // You must be logged on to view this! 
    23     //    protect(1); 
    24  
    2519        $title = run("profile:display:name") . " :: " . __gettext("Members"); 
    2620        $body = run('communities:members', array($page_owner)); 
  • devel/mod/community/new.php

    r1369 r1387  
    1212        run("communities:init"); 
    1313 
     14        require_login(); 
     15 
    1416        $context = (defined('COMMUNITY_CONTEXT'))?COMMUNITY_CONTEXT:"network"; 
    1517 
    1618        define("context", $context); 
    1719        templates_page_setup(); 
    18  
    19     // Whose friends are we looking at? 
    20         global $page_owner; 
    21  
    22     // You must be logged on to view this! 
    23     //    protect(1); 
    2420 
    2521        $title = run("profile:display:name") . " :: " . __gettext("Owned Communities"); 
  • devel/mod/community/requests.php

    r1369 r1387  
    1212        run("communities:init"); 
    1313 
     14        require_login(); 
     15 
    1416        $context = (defined('COMMUNITY_CONTEXT'))?COMMUNITY_CONTEXT:"network"; 
    1517 
    1618        define("context", $context); 
     19 
    1720        templates_page_setup(); 
    18  
    19     // Whose friends are we looking at? 
    20         global $page_owner; 
    21  
    22     // You must be logged on to view this! 
    23     //    protect(1); 
    2421 
    2522        $title = run("profile:display:name") . " :: ". __gettext("Membership requests"); 
  • devel/mod/groups/index.php

    r1369 r1387  
    1212        run("groups:init"); 
    1313         
     14        require_login(); 
     15 
    1416        define("context", "network"); 
    1517        templates_page_setup(); 
    16  
    17     // Whose friends are we looking at? 
    18         global $page_owner; 
    19          
    20     // You must be logged on to view this! 
    21         protect(1); 
    2218         
    2319        $title = run("profile:display:name") . " :: ". __gettext("Access Controls"); 
  • devel/mod/icons/index.php

    r1369 r1387  
    1111run("icons:init"); 
    1212 
     13require_login(); 
     14 
    1315$context = optional_param('context','account'); 
    1416define('context',$context); 
    1517 
    16 // You must be logged on to view this! 
    17 protect(1); 
    1818templates_page_setup(); 
    1919 
  • devel/mod/template/edit.php

    r1363 r1387  
    66require_once(dirname(dirname(__FILE__))."/../includes.php"); 
    77 
    8 protect(1); 
    9  
    108run("profile:init"); 
    119run("templates:init"); 
     10 
     11require_login(); 
    1212 
    1313define("context", "account"); 
  • devel/mod/template/index.php

    r1363 r1387  
    66        require_once(dirname(dirname(__FILE__))."/../includes.php"); 
    77         
    8         protect(1); 
    9          
     8        require_login(); 
     9 
    1010        run("profile:init"); 
    1111        templates_actions(); 
  • devel/mod/template/preview.php

    r1369 r1387  
    66require_once(dirname(dirname(__FILE__))."/../includes.php"); 
    77 
    8 protect(1); 
     8require_login(); 
    99 
    1010run("profile:init"); 
  • devel/mod/users/index.php

    r1369 r1387  
    1212define('context',$context); 
    1313 
    14 protect(1); 
     14require_login(); 
    1515 
    1616templates_page_setup();