diff --git a/conf/acl.auth.php.dist b/conf/acl.auth.php.dist index 3fa9741c5c34d1216b24a5043ccf3f07ab4d5623..14344d7785b72176f7386973a9142936b236f287 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 1bf75da1aab2eb7fe6d0fab6c92f02ef4489fed8..2b90a37d5206c9a3f05eb786570abf3c1f982b40 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 cc179f856d37c7aabd3385503361bb97a2ac9893..46ebf5448d2a363f64e48cb20160cd5558932611 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;