NLPedia:Einstellungen: Unterschied zwischen den Versionen
(→Access Restriction to wiki) |
(→Access Restriction to wiki) |
||
| Zeile 4: | Zeile 4: | ||
== Access Restriction to wiki == | == Access Restriction to wiki == | ||
| − | No anonymous view/edit/create. | + | No anonymous view/edit/create. <br> |
| − | No self registration | + | No self registration <br> |
Registered users have full right to view/edit/create pages. | Registered users have full right to view/edit/create pages. | ||
Add the following lines in LocalSettings.php after this line: require_once( "includes/DefaultSettings.php" ); Result of the configuration will be: users cannot create their own account and cannot read/edit documents without logging in to the system. | Add the following lines in LocalSettings.php after this line: require_once( "includes/DefaultSettings.php" ); Result of the configuration will be: users cannot create their own account and cannot read/edit documents without logging in to the system. | ||
<nowiki> | <nowiki> | ||
| − | $wgGroupPermissions[’*’ ][’createaccount’] = false; | + | $wgGroupPermissions[’*’ ][’createaccount’] = false; <br> |
| + | $wgGroupPermissions[’*’ ][’edit’] = false; <br> | ||
| + | $wgWhitelistRead = array( "Special:Userlogin" ); <br> | ||
| + | $wgGroupPermissions[’*’ ][’read’] = false; <br> | ||
| + | </nowiki># | ||
| − | + | To allow browsing only from particular ip address (e.g. office lan only) insert the following lines to .htaccess file: | |
| − | + | <Limit GET POST> <br> | |
| + | order deny,allow <br> | ||
| + | deny from all <br> | ||
| + | allow from "Office LAN IP" <br> | ||
| + | </Limit> <br> | ||
| − | |||
| − | + | == Eliminating index.php from url == | |
| − | + | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Rewrite Rules to have nice urls (Eliminating index.php from url). e.g. | Rewrite Rules to have nice urls (Eliminating index.php from url). e.g. | ||
| Zeile 32: | Zeile 33: | ||
There are many ways to achieve this. I did it with .htaccess file: | There are many ways to achieve this. I did it with .htaccess file: | ||
| − | mediawiki was installed in the document root directory www.mysite.com/ (using the installer) | + | mediawiki was installed in the document root directory www.mysite.com/ (using the installer) <br> |
| − | set $wgArticlePath = "/wiki/$1"; in LocalSettings.php | + | set $wgArticlePath = "/wiki/$1"; in LocalSettings.php <br> |
| − | put a .htaccess file with the following content in the dir for www.mysite.com | + | put a .htaccess file with the following content in the dir for www.mysite.com <br> |
| − | # not actually needed but probably a good idea anyway | + | # not actually needed but probably a good idea anyway <br> |
| − | php_flag register_globals off | + | php_flag register_globals off <br> |
| − | # first, enable the processing - Unless your ISP has it enabled | + | # first, enable the processing - Unless your ISP has it enabled <br> |
| − | # already. That might cause weird errors. | + | # already. That might cause weird errors. <br> |
| − | RewriteEngine on | + | RewriteEngine on <br> |
| − | # do the rewrite | + | # do the rewrite <br> |
| − | RewriteRule ^wiki/?(.*)$ /index.php?title=$1 [L,QSA] | + | RewriteRule ^wiki/?(.*)$ /index.php?title=$1 [L,QSA] <br> |
| − | 4. Make sure Apache loads the rewrite modules | + | 4. Make sure Apache loads the rewrite modules <br> |
| − | LoadModule rewrite_module modules/mod_rewrite.so | + | LoadModule rewrite_module modules/mod_rewrite.so <br> |
Default Global Timezone | Default Global Timezone | ||
Version vom 2. April 2006, 10:48 Uhr
Inhaltsverzeichnis
PHP Referenz
Access Restriction to wiki
No anonymous view/edit/create.
No self registration
Registered users have full right to view/edit/create pages.
Add the following lines in LocalSettings.php after this line: require_once( "includes/DefaultSettings.php" ); Result of the configuration will be: users cannot create their own account and cannot read/edit documents without logging in to the system. $wgGroupPermissions[’*’ ][’createaccount’] = false; <br> $wgGroupPermissions[’*’ ][’edit’] = false; <br> $wgWhitelistRead = array( "Special:Userlogin" ); <br> $wgGroupPermissions[’*’ ][’read’] = false; <br> #
To allow browsing only from particular ip address (e.g. office lan only) insert the following lines to .htaccess file:
<Limit GET POST>
order deny,allow
deny from all
allow from "Office LAN IP"
</Limit>
Eliminating index.php from url
Rewrite Rules to have nice urls (Eliminating index.php from url). e.g.
http://mywiki.site.tld/wiki/Article_name
There are many ways to achieve this. I did it with .htaccess file:
mediawiki was installed in the document root directory www.mysite.com/ (using the installer)
set $wgArticlePath = "/wiki/$1"; in LocalSettings.php
put a .htaccess file with the following content in the dir for www.mysite.com
- not actually needed but probably a good idea anyway
php_flag register_globals off
- first, enable the processing - Unless your ISP has it enabled
- already. That might cause weird errors.
RewriteEngine on
- do the rewrite
RewriteRule ^wiki/?(.*)$ /index.php?title=$1 [L,QSA]
4. Make sure Apache loads the rewrite modules
LoadModule rewrite_module modules/mod_rewrite.so
Default Global Timezone
File Uploads
File uploads are disabled by default so enable it in LocalSettings.php by:
$wgEnableUploads = true;
Time zone adjust
If you want to set the default timezone offset according to local timezone and handle daylight savings time automatically, you can do this ugly trick: $wgLocaltimezone="Europe/Berlin"; $oldtz = getenv("TZ"); putenv("TZ=$wgLocaltimezone"); $wgLocalTZoffset = date("Z") / 3600; putenv("TZ=$oldtz"); Actually, resetting it probably isn't necessary, I think that's leftover from before we switched to the proper time functions. This should do (untested): $wgLocaltimezone="Europe/Berlin"; putenv("TZ=$wgLocaltimezone"); $wgLocalTZoffset = date("Z") / 3600; For that matter if your server is already in the local timezone you want, this might work: $wgLocalTZoffset = date("Z") / 3600;