[ PHPXref.com ] [ Generated: Sun Jul 20 20:09:57 2008 ] [ QwikiWiki 1.5.1 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> _config.php (source)

   1  <?php 
   2  // _config.php

   3  //

   4  // Copyright 2004/2005, David Barrett (www.quinthar.com) and TESTCo (www.testco.com).  All Rights Reserved.

   5  //

   6  // See LICENSE for the complete licensing details.

   7  
   8  // Critical Information

   9  // At the very least, you'll want to personalize these variables. 

  10  // - The 'title' will be sent in the <TITLE> block, and will thus appear in

  11  //   the title-bar of your users' Web browser

  12  // - 'adminName' should be your name

  13  // - 'adminPassword' PLEASE change this to be something unique

  14  // - 'adminSig' will be attached to outgoing email messages (assuming you stick 

  15  //   with the default text) on the mailing list

  16  // - 'emailFrom' is the address from which QwikiWiki attributes its email

  17  
  18  // Title Bar

  19  // This will be put in the <TITLE> bar of the user's Web browser

  20  
  21  $VERSION = "1.5.1"; //warning - do no change

  22  
  23  
  24  $QW_CONFIG['title']         = "QwikiWiki";
  25  
  26  $QW_CONFIG['adminAccount']['username'] = 'admin';
  27  $QW_CONFIG['adminAccount']['email']    = 'your_name@changeme.com';
  28  $QW_CONFIG['adminAccount']['password'] = 'changeme!'; // alphanumeric only

  29  $QW_CONFIG['adminAccount']['sig']      = '- your signature';
  30  $QW_CONFIG['guestAccount']['username'] = 'Guest';
  31  
  32  // Access Control

  33  // QwikiWiki comes with a four-level access control system:

  34  // 1) Unauthenticated users are given 'guest' privileges, as defined by the

  35  //    'guestAccount' parameters below.  By setting ['guestAccount']['read'] to

  36  //    true, for example, all users will be able to read any page.

  37  //

  38  // 2) Users can optionally create individual user accounts.  "Authenticated"

  39  //    users (those who are "logged-in") have individual permissions, which 

  40  //    override the guest permissions.  The default permissions assigned to new

  41  //    accounts are specified in the ['defaultAccount'] settings.

  42  //

  43  // 3) In the '/data/_adminData.php' file (in which all the account data is

  44  //    stored), there is also an 'overridePageArray'.  With this array, you can

  45  //    override the read/write permissions for guest and authenticated users on a

  46  //    per-page basis.  By default, the page named "Home" is overridden to be

  47  //    readable by everyone, regardless of other permissions.

  48  //

  49  // 4) Finally, there is an 'adminAccount' that overrides all other permissions.

  50  //    When logged in as the administrator, you can access the 'Admin' interface,

  51  //    in which you can change permissions assigned to individual users.

  52  //

  53  // This file comes with three pre-arranged access control settings.  Pick the

  54  // one that best describes what you want to do, and adjust from there:

  55  //

  56  // - Public: All users are given read/write access to all pages.  This is the

  57  //           least secure, most permissive of the settings.  In the spirit of

  58  //           openness, this is the default setting.

  59  //

  60  // - Protected: Guest users are allowed to read all pages, but only

  61  //              authenticated users (ie, those who create an account and log in)

  62  //              are allowed to edit.

  63  //

  64  // - Private: Guest users are allowed to view the home page, but none others.

  65  //            Authenticated users can view all pages, but not edit.  Only you,

  66  //            or authenticated users you individually select, can edit.

  67  //

  68  //            NOTE: QwikiWiki stores its data "in the clear" in the /data

  69  //                  subdirectory.  Thus you must configure your Web-browser

  70  //                  to disallow access from the /data directory in order to

  71  //                  prevent users from bypassing QwikiWiki security and 

  72  //                  accessing the files directly.  If you are using an Apache

  73  //                  server configured to allow .htaccess, you can accomplish

  74  //                  this by creating a file named ".htaccess" in your /data

  75  //                  directory containing this single line:

  76  //

  77  //                       Deny from all

  78  //

  79  $QW_CONFIG['accessControlLevel'] = 'public';
  80  
  81  // Access Control Definition

  82  // The lines below specify the precise details of each access control level.

  83  // Admin can always access everything

  84  $QW_CONFIG['adminAccount']['read']  = true;
  85  $QW_CONFIG['adminAccount']['write'] = true;
  86  switch( $QW_CONFIG['accessControlLevel'] )
  87  {
  88      case 'public' :
  89          // Users can both read and write, whether authenticated (logged-in) or not

  90          $QW_CONFIG['defaultAccount']['read']  = true;
  91          $QW_CONFIG['defaultAccount']['write'] = true;
  92          $QW_CONFIG['guestAccount']['read']  = true;
  93          $QW_CONFIG['guestAccount']['write'] = true;
  94          break;
  95          
  96      case 'protected' :
  97          // Authenticated users can read and write

  98          $QW_CONFIG['defaultAccount']['read']  = true;
  99          $QW_CONFIG['defaultAccount']['write'] = true;
 100          // Guest users can only read

 101          $QW_CONFIG['guestAccount']['read']  = true;
 102          $QW_CONFIG['guestAccount']['write'] = false;
 103          break;
 104          
 105      case 'private' :
 106          // Authenticated users can read, but not write by default

 107          $QW_CONFIG['defaultAccount']['read']  = true;
 108          $QW_CONFIG['defaultAccount']['write'] = false;
 109          // Guest users can neither read nor write (overridden for Home page

 110          // in "/data/_adminData.php")

 111          $QW_CONFIG['guestAccount']['read']  = false;
 112          $QW_CONFIG['guestAccount']['write'] = false;
 113          break;
 114  }
 115  
 116  // Start Page

 117  // Set this to be the name of the QuikiPage that is mapped to the "null" page

 118  $QW_CONFIG['startPage'] = "Home";
 119  
 120  // Global Navigation

 121  // Depending on the template used, the Global Nav is a lis of key pages presented

 122  // to the user as starting points for navigation.  This is an array of text blocks

 123  // that will be run through the Wiki-parser.  Thus it can be any Qwiki page name,

 124  // URL, HTML tag, etc.

 125  $QW_CONFIG['globalNav'] = array("_Home_", "QwikiWiki","QwikiSyntax","_Recent_Changes_","_Page_Index_","_Site_Map_");
 126  
 127  // Acceptable HTML Tags

 128  // QwikiWiki allows users to insert HTML directly into page text, which is

 129  // both good and bad.  The good part is this makes it really easy to manipulate

 130  // the final output of the Wiki page.  The bad part is that unscrupulous users

 131  // can insert bad code into your output pages.  With this in mind, QwikiWiki lets

 132  // you strick your own balance between security and usability by specifying which

 133  // HTML tags you'll allow users to use.  Simply insert new tags (or remove existing

 134  // tags) from the 'acceptableHTMLTags' list below, as shown.

 135  $QW_CONFIG['acceptableHTMLTags']  = '<a><b><i><u><img><code><pre><html><table><tr><td><div>';
 136  
 137  // Edit Lockfile Expiration

 138  // Specify the timeout duration for lockfiles.  If this is too short, people

 139  // might lose the lock while still editing.  If this is too long, dead locks

 140  // (from starting to edit and closing the window, for example) will block out

 141  // legitimate editing.

 142  $QW_CONFIG['editLockfileExpiration'] = 60 * 30; // a half hour

 143  
 144  // QwikiTag Patterns

 145  // Set this to be the list of word patterns to automatically treat as QwikiTags.

 146  // Note, this the first matching pattern will be used as the display name of the 

 147  // QwikiTag, the name of the QwikiPage, and also the name of the file on disk

 148  // (after appending '.qwiki').  Thus, make sure you only match patterns that

 149  // you want to visually display, and that make valid filenames.

 150  $QW_CONFIG['tagPatternArray'] = array( '/(^|[^\w_]+)([A-Z]+[a-z\d]+[A-Z]+\w*)($|[^\w_]+)/', '/(^|\W+)_([\w-]+(?:_[\w-]+)*)_($|\W+)/');
 151  
 152  // Pattern used to validate the file name given by the 'page' request parameter

 153  $QW_CONFIG['pageNamePattern'] = '/^[a-z0-9](\.|_|-|\w)*$/i';
 154  
 155  $QW_CONFIG['headPatternArray'] = array('/^([A-Z]+\S*( [^a-z\s]+\S*)+)$/');
 156  
 157  // Ignored QwikiTags

 158  // One downside of all wikis is how they occasionaly tag words as links even

 159  // when you don't want them to be.  If you find yourself suffering from this,

 160  // add the offending word in the 'ignoreTagPatternArray' and it will never be

 161  // be linked as a QwikiTag.

 162  $QW_CONFIG['ignoreQwikiTagArray'] = array( 'DoNotLinkMe', 'Do_not_link_me', 'P2P', 'B2B', 'B2C');
 163  
 164  // QwikiTag redirects

 165  // Typically, an auto-detected page name will link to a page with the same name.

 166  // However, you can map any QwikiTag to any URL by adding to the following list:

 167  $QW_CONFIG['redirectTagArray'] = array('Recent_Changes' => 'recentchanges.php','Page_Index' => 'pageindex.php','Site_Map' => 'sitemap.php');
 168  
 169  // File Attachments

 170  // If enabled, editors can upload files to a private directory created for that

 171  // page.  Thus stored, typing the name of the file into the page source creates 

 172  // a link to that file.  If the file happens to be an image (gif, jpg, png), 

 173  // it will also be embedded inline.  For security reasons, you can set the list

 174  // of acceptable file extensions (so as to prevent, say, PHP files from being

 175  // uploaded).

 176  $QW_CONFIG['enableAttach'] = true;
 177  $QW_CONFIG['maxUploadSize'] = 2 * 1024 * 1024; // 2MB

 178  $QW_CONFIG['acceptableExtensions'] = array( 'gif', 'jpg', 'zip', 'doc', 'txt' );
 179  
 180  // Template

 181  // Pick the filename of the PHP template used for output.  The following templates

 182  // are supplied out-of-the-box:

 183  // - _narrow_template.php - A 700-pixel fixed-width page with navigation at the bottom

 184  //                          (mimics the QwikiWiki v1.2 layout)

 185  // - _wide_template.php - A 100% variable-width page with navigation at the top

 186  // - _widelogo_template.php - Same as _wide_template.php, but with space for a logo

 187  $QW_CONFIG['templateFilename'] = '_widelogo_template.php';
 188  $QW_CONFIG['templateLogo'] = 'qwikiwiki_logo.gif'; // used in _widelogo_template.php

 189  
 190  // Stylesheet

 191  // Pick the filename of the CSS stylesheet used to format the template.  The following

 192  // stylesheets are supplied out-of-the-box:

 193  // - _darkblue_style.css - Dark blue theme, used on www.qwikiwiki.com

 194  // - _greenblack_style.css - Dark blue theme, used on www.quinthar.com

 195  // - _lightblue_style.css - A muted, light-blue theme (default in v1.2 of QwikiWiki)

 196  // - _bbs_style.css - A green-on-black theme loosely-reminiscnet of old-school BBSes

 197  $QW_CONFIG['stylesheetFilename'] = '_darkblue_style.css';
 198  
 199  // Email Options

 200  // New in v1.4, QwikiWiki allows users to subscribe to individual pages to be notified

 201  // when the page changes.  These notification messages follow file-based templates,

 202  // both in text and HTML.  By default, the HTML page change notifications even embed

 203  // the latest version of the page into the email itself.  To disable these page-changed

 204  // mailing lists, set 'enableEmail' to false.  To force all email to be text (and not

 205  // HTML), set 'enableEmailHTML' to be false.

 206  //

 207  // **WARNING** So far as I can tell, PHP has a bug on Win32 systems that prevents it

 208  //             from sending HTML email.  In fact, it even appears to crash PHP when you

 209  //             attempt to do so.  Thus, if you are running QwikiWiki on a Win32 server,

 210  //             you are HIGHLY RECOMMENDED to test sending HTML email vigorously, and to

 211  //             disable it otherwise.

 212  //

 213  $QW_CONFIG['emailEnable']     = true;
 214  $QW_CONFIG['emailEnableHTML'] = true;
 215  
 216  // Email templates

 217  // All email sent follows template messages contained in the files named below.  These

 218  // message templates embed the following system-inserted variables:

 219  // - QW_HOMELINK        - URL of the QwikiWiki installation 

 220  // - QW_PAGELINK        - URL of the page that changed

 221  // - QW_TITLE           - Title of the page that changed

 222  // - QW_PAGE            - Name of the page that changed

 223  // - QW_CSS             - CSS contents of the current style

 224  // - QW_BODYTEXT        - text (unformatted) contents of the page itself

 225  // - QW_BODYHTML        - HTML contents of the page itself

 226  // - QW_ADMINSIG        - Contents of QW['adminSig'], defined above

 227  // - QW_UNSUBSCRIBELINK - URL to unsubscribe from the mailing list

 228  // - QW_RESUBSCRIBELINK - URL to resubscribe to the mailing list

 229  //

 230  $QW_CONFIG['emailSubscribeSubject']            = "Subscribed to 'QW_PAGE' on QW_TITLE";
 231  $QW_CONFIG['emailUnsubscribeSubject']          = "Unsubscribed from 'QW_PAGE' on QW_TITLE";
 232  $QW_CONFIG['emailChangedSubject']              = "'QW_PAGE' changed on QW_TITLE";
 233  $QW_CONFIG['emailSubscribeBodyTextFilename']   = "_subscribemessage.txt";
 234  $QW_CONFIG['emailSubscribeBodyHTMLFilename']   = "_subscribemessage.html";
 235  $QW_CONFIG['emailUnsubscribeBodyTextFilename'] = "_unsubscribemessage.txt";
 236  $QW_CONFIG['emailUnsubscribeBodyHTMLFilename'] = "_unsubscribemessage.html";
 237  $QW_CONFIG['emailChangedBodyTextFilename']     = "_changedmessage.txt";
 238  $QW_CONFIG['emailChangedBodyHTMLFilename']     = "_changedmessage.html";
 239  
 240  //Set your locale and encoding here

 241  //setlocale(LC_ALL, '');

 242  $QW_CONFIG['encoding']='ISO-8859-1';
 243  //setlocale(LC_ALL, 'ru_RU.cp1251'); //for

 244  //$QW_CONFIG['encoding']='windows-1251'; //Russian cp1251

 245  //!Russian users! Don't forget to turn Russian apache off.

 246  //                You must create file .htaccess with "CharsetDisable On"

 247  
 248  
 249  // Debugging

 250  // Enable this if you want to allow "debug=true" to be added to any URI such

 251  // as to output debugging information.

 252  $QW_CONFIG['enableDebugging'] = true;
 253  
 254  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]