summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-07-28 11:36:53 +0200
committerAndreas Gohr <andi@splitbrain.org>2006-07-28 11:36:53 +0200
commit8af2e4bbb77efbfe391088f7de187db3262874cb (patch)
tree856fc89f92027b743d06e7aaeac6704d6cea931f
parent3545b2e00f01dc8e3b59ba4b2fc937f296b43bb5 (diff)
downloadrpg-8af2e4bbb77efbfe391088f7de187db3262874cb.tar.gz
rpg-8af2e4bbb77efbfe391088f7de187db3262874cb.tar.bz2
default policy for installer
darcs-hash:20060728093653-7ad00-fc481b0ae7707516de089bfd88dba3eee0f33f3d.gz
-rw-r--r--conf/acl.auth.php.dist3
-rw-r--r--inc/lang/en/lang.php6
-rw-r--r--install.php32
3 files changed, 37 insertions, 4 deletions
diff --git a/conf/acl.auth.php.dist b/conf/acl.auth.php.dist
index 3fa9741c5..14344d778 100644
--- a/conf/acl.auth.php.dist
+++ b/conf/acl.auth.php.dist
@@ -16,5 +16,6 @@
# edit 2
# create 4
# upload 8
+# delete 16
-* @ALL 4
+* @ALL 8
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index 1bf75da1a..2b90a37d5 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -205,7 +205,7 @@ $lang['i_problems'] = 'The installer found some problems, indicated below. You
$lang['i_modified'] = 'For security reasons this script will only work with a new and unmodified Dokuwiki installation.
You should either re-extract the files from the downloaded package or consult the complete
<a href="http://wiki.splitbrain.org/wiki:install">Dokuwiki installation instructions</a>';
-$lang['i_funcna'] = 'PHP function <code>%s</code> is not available. Maybe your provider disabled it for some reason?';
+$lang['i_funcna'] = 'PHP function <code>%s</code> is not available. Maybe your hosting provider disabled it for some reason?';
$lang['i_permfail'] = '<code>%s</code> is not writable by DokuWiki. You need to fix the permission settings of this directory!';
$lang['i_confexists'] = '<code>%s</code> already exists';
$lang['i_writeerr'] = 'Unable to create <code>%s</code>. You will need to check directory/file permissions and create the file manually.';
@@ -215,6 +215,10 @@ $lang['i_success'] = 'The configuration was finished successfully. You may de
<a href="doku.php">your new DokuWiki</a>.';
$lang['i_failure'] = 'Some errors occured while writing the configuration files. You may need to fix them manually before
you can use <a href="doku.php">your new DokuWiki</a>.';
+$lang['i_policy'] = 'Initial ACL policy';
+$lang['i_pol0'] = 'Open Wiki (read, write, upload for everyone)';
+$lang['i_pol1'] = 'Public Wiki (read for everyone, write and upload for registered users)';
+$lang['i_pol2'] = 'Closed Wiki (read, write, upload for registered users only)';
//Setup VIM: ex: et ts=2 enc=utf-8 :
diff --git a/install.php b/install.php
index cc179f856..46ebf5448 100644
--- a/install.php
+++ b/install.php
@@ -62,7 +62,7 @@ header('Content-Type: text/html; charset=utf-8');
code { font-size: 110%; color: #008000; }
fieldset { border: none }
label { display: block;}
- input.text { width: 30em; margin: 0 0.5em; }
+ select.text, input.text { width: 30em; margin: 0 0.5em; }
</style>
<script type="text/javascript" language="javascript">
function acltoggle(){
@@ -175,6 +175,13 @@ function print_form($d){
<label for="confirm"><?php echo $lang['passchk']?></label>
<input class="text" type="password" name="d[confirm]" id="confirm" />
+
+ <label for="policy"><?php echo $lang['i_policy']?></label>
+ <select class="text" name="d[policy]" id="policy">
+ <option value="0" <?php echo ($d['policy'] == 0)?'selected="selected"':'' ?>><?php echo $lang['i_pol0']?></option>
+ <option value="1" <?php echo ($d['policy'] == 1)?'selected="selected"':'' ?>><?php echo $lang['i_pol1']?></option>
+ <option value="2" <?php echo ($d['policy'] == 2)?'selected="selected"':'' ?>><?php echo $lang['i_pol2']?></option>
+ </select>
</fieldset>
</fieldset>
@@ -234,6 +241,7 @@ function check_data($d){
*/
function store_data($d){
$ok = true;
+ $d['policy'] = (int) $d['policy'];
// create changes.log
if (!@file_exists(DOKU_INC.'data/changes.log')){
@@ -267,7 +275,27 @@ EOT;
$ok = $ok && fileWrite(DOKU_LOCAL.'users.auth.php', $output);
// create acl.auth.php
- $output = @file_get_contents(DOKU_CONF.'acl.auth.php.dist');
+ $output = <<<EOT
+# acl.auth.php
+# <?php exit()?>
+# Don't modify the lines above
+#
+# Access Control Lists
+#
+# Auto-generated by install script
+# Date: $now
+
+EOT;
+ if($d['policy'] == 2){
+ $output .= "* @ALL 0\n";
+ $output .= "* @users 8\n";
+ }elseif($d['policy'] == 2){
+ $output .= "* @ALL 1\n";
+ $output .= "* @users 8\n";
+ }else{
+ $output .= "* @ALL 8\n";
+ }
+
$ok = $ok && fileWrite(DOKU_LOCAL.'acl.auth.php', $output);
}
return $ok;