Skip to content

Commit

Permalink
Require tutorials to be explicitly enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Pontus Stenetorp committed Nov 12, 2012
1 parent 46b0b76 commit 1ae81dc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@

DEBUG = False

### TUTORIALS
# Unauthorised users can create tutorials (but not edit without a login)
TUTORIALS = False

### LOG_LEVEL
# If you are a developer you may want to turn on extensive server
Expand Down
13 changes: 13 additions & 0 deletions tutorial.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ from session import init_session, get_session

from config import DATA_DIR

# Tutorials have to be enabled explicitly since it modifies the disk
try:
from config import TUTORIALS
except ImportError:
TUTORIALS = False

if not TUTORIALS:
print 'Content-Type: text/plain'
print ''
print 'Tutorials disabled on this server, please enable it in config.py'
print ''
exit(0)

TUTORIAL_BASE = '.tutorials'
TUTORIAL_START = "000-introduction"
TUTORIAL_DATA_DIR = DATA_DIR
Expand Down

0 comments on commit 1ae81dc

Please sign in to comment.