Skip to content

Commit

Permalink
Add settings for controlPanelUrl and controlPanelLinkDirectly; commit…
Browse files Browse the repository at this point in the history
  • Loading branch information
mvl22 committed Oct 8, 2013
1 parent c6b814e commit 190a5b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .config.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ bobDbControlpanelPassword='?'
# Organisation name
organisationName=''

# Whether to show the control panel link in the listing site; this must be a quoted value containing a native PHP bool/string, e.g. 'true' or 'false' or "'user1,user2,user3'"
controlPanelLinkEnabled='true'
# Control panel settings
controlPanelUrl="https://www.controlpanel.vote.example.com/controlpanel/"
controlPanelLinkEnabled='true' // Whether to show the control panel link in the listing site; this must be a quoted value containing a native PHP bool/string, e.g. 'true' or 'false' or "'user1,user2,user3'"
controlPanelLinkDirectly=false // Whether the listing interface should link directly to the control panel or show an intermediate page

# Ingest data
instanceDataUrl='https://www.controlpanel.vote.example.com/bestow.html'
Expand Down
7 changes: 7 additions & 0 deletions 3-install-bob-gui-listing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ if [ ! -e "${documentRoot}"/bob-gui/listing/bobguiListingWrapper.php ] ; then
cp -p "${documentRoot}"/bob-gui/listing/bobguiListingWrapper.php.template "${documentRoot}"/bob-gui/listing/bobguiListingWrapper.php
fi

# Convert controlPanelLinkDirectly from boolean to string true/false, so PHP receives native boolean; ternary operator as at: http://stackoverflow.com/a/3953712
controlPanelLinkDirectly=$( $controlPanelLinkDirectly && echo 'true' || echo 'false')

# Add the database credentials to the BOB listing file (replace the lines matching on the left with the whole config string on the right)
#!# Inconsistent namings here would be good to clear up
#!# controlPanelLinkEnabled currently pastes in a PHP value; should instead determine whether the setting is a string or bool and do its own quoting here
Expand All @@ -52,9 +55,13 @@ sed -i \
-e "s/.*'administratorEmail'.*/\$config['administratorEmail'] = '${serverAdmin}';/" \
-e "s/.*'organisationName'.*/\$config['organisationName'] = '${organisationName}';/" \
-e "s/.*'mailDomain'.*/\$config['mailDomain'] = '${mtaUserMailDomain}';/" \
-e "s|.*'controlPanelUrl'.*|\$config['controlPanelUrl'] = '${controlPanelUrl}';|" \
-e "s/.*'controlPanelLinkEnabled'.*/\$config['controlPanelLinkEnabled'] = ${controlPanelLinkEnabled};/" \
-e "s/.*'controlPanelLinkDirectly'.*/\$config['controlPanelLinkDirectly'] = ${controlPanelLinkDirectly};/" \
"${documentRoot}"/bob-gui/listing/bobguiListingWrapper.php



# Add the database credentials to the BOB bootstrap file (replace the lines matching on the left with the whole config string on the right)
sed -i \
-e "s/.*'dbDatabase'.*/\$config['dbDatabase'] = '${bobDbDatabase}';/" \
Expand Down

0 comments on commit 190a5b1

Please sign in to comment.