default policy for installer

darcs-hash:20060728093653-7ad00-fc481b0ae7707516de089bfd88dba3eee0f33f3d.gz
This commit is contained in:
Andreas Gohr 2006-07-28 11:36:53 +02:00
parent 3545b2e00f
commit 8af2e4bbb7
3 changed files with 37 additions and 4 deletions

View File

@ -16,5 +16,6 @@
# edit 2
# create 4
# upload 8
# delete 16
* @ALL 4
* @ALL 8

View File

@ -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 :

View File

@ -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;