Changeset 477

Show
Ignore:
Timestamp:
08/10/06 09:59:23 (2 years ago)
Author:
ben
Message:

A new option in config.php allows you to define an Elgg installation as a walled garden: users can't view any content unless they're logged in. This includes RSS feeds.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/config-dist.php

    r420 r477  
    77 
    88// Name of the site (eg Elgg, Apcala, University of Bogton's Learning Landscape, etc) 
    9 $CFG->sitename = 'My Elgg site'; 
     9 
     10    $CFG->sitename = 'My Elgg site'; 
     11 
    1012// External URL to the site (eg http://elgg.bogton.edu/) 
    1113// NB: **MUST** have a final slash at the end 
    12 $CFG->wwwroot = 'http://'; 
     14 
     15    $CFG->wwwroot = 'http://'; 
     16 
    1317// Physical path to the files (eg /home/elggserver/httpdocs/) 
    1418// NB: **MUST** have a final slash at the end 
    15 $CFG->dirroot = ''; 
     19 
     20    $CFG->dirroot = ''; 
     21 
    1622// Email address of the system (eg elgg-admin@bogton.edu) 
    17 $CFG->sysadminemail = ''; 
     23 
     24    $CFG->sysadminemail = ''; 
     25 
    1826// Country code to set language to if you have gettext installed 
    1927// To include new languages, save their compiled .mo gettext 
     
    2129// (the file within this folder must be called elgg.mo) 
    2230// An Elgg gettext template is included as /elgg.pot 
    23 $CFG->defaultlocale = 'en_GB'; 
     31 
     32    $CFG->defaultlocale = 'en_GB'; 
     33 
    2434// The following should be set to false if you don't want the 
    2535// general public to be able to register accounts with your 
    2636// Elgg site. 
    27 $CFG->publicreg = true; 
     37 
     38    $CFG->publicreg = true; 
     39 
    2840// The following sets the default access level within the Elgg 
    2941// site. Possible values include: 
     
    3143//        LOGGED_IN    :: available to logged in users only 
    3244//        PRIVATE        :: available to the user only 
    33 $CFG->default_access = "LOGGED_IN"; 
     45 
     46    $CFG->default_access = "LOGGED_IN"; 
     47 
    3448// dataroot. this is where uploaded files will go (and sessions for now) 
    3549// This should be OUTSIDE your wwwroot. 
    3650// NB: **MUST** have a final slash at the end 
    37 $CFG->dataroot = ''; 
     51 
     52    $CFG->dataroot = ''; 
     53 
    3854// You may change these values to something else but you must ensure that 
    3955// the user the web server process runs as is able to read and write under 
     
    4258//$CFG->filepermissions = 0666; 
    4359 
    44 $CFG->dbtype = 'mysql'; // for now 
    45 $CFG->dbhost = 'localhost'; 
    46 $CFG->dbuser = ''; 
    47 $CFG->dbpass = ''; 
    48 $CFG->dbname = ''; 
    49 $CFG->dbpersist = false; 
     60    $CFG->dbtype = 'mysql'; // for now 
     61    $CFG->dbhost = 'localhost'; 
     62    $CFG->dbuser = ''; 
     63    $CFG->dbpass = ''; 
     64    $CFG->dbname = ''; 
     65    $CFG->dbpersist = false; 
    5066 
    5167// The following will assume all your database tables have this value at the start  
    5268// of their names. If you're upgrading from an earlier version of Elgg, you might  
    5369// need to set this to $CFG->prefix = ''; 
    54 $CFG->prefix = 'elgg'; 
     70 
     71    $CFG->prefix = 'elgg'; 
    5572 
    5673// performance and debugging // 
     
    5875// $CFG->dblogerror = true; 
    5976// put this to 2047 to get adodb error handling. 
    60 $CFG->debug = 0; 
    6177 
     78    $CFG->debug = 0; 
    6279 
    6380// Number of days to keep incoming RSS feed entries for before deleting them. 
    6481// A value of 0 disables automatic deletion. 
    65 $CFG->rsspostsmaxage = 0; 
     82 
     83    $CFG->rsspostsmaxage = 0; 
     84 
     85// Set this to 1 to enable a walled garden - i.e., if you're not logged in, 
     86// all you can see is the login page. 
     87 
     88    $CFG->walledgarden = 0; 
    6689 
    6790// 
  • devel/includes.php

    r424 r477  
    7171        run("init"); 
    7272         
     73    // Walled garden checking: if we're not logged in, 
     74    // and walled garden functionality is turned on, redirect to 
     75    // the logon screen 
     76        if (!empty($CFG->walledgarden) && context != "login" && !logged_on) { 
     77             
     78            header("Location: " . $CFG->wwwroot . "login/index.php"); 
     79            exit(); 
     80             
     81        } 
     82         
    7383?> 
  • devel/login/index.php

    r473 r477  
    11<?php 
     2 
     3define("context","login"); 
    24 
    35require_once(dirname(dirname(__FILE__)).'/includes.php');