logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

SF.net SVN: squirrelmail: [12300] trunk: msg#00009

Subject: SF.net SVN: squirrelmail: [12300] trunk
Revision: 12300
          
http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=12300&view=rev
Author:   jervfors
Date:     2007-03-03 17:56:54 -0800 (Sat, 03 Mar 2007)

Log Message:
-----------
Moving "doc/db-backend.txt" to the administrator's manual.

Modified Paths:
--------------
    trunk/documentation/admin/admin.sgml
    trunk/squirrelmail/config/config_default.php
    trunk/squirrelmail/doc/index.html
    trunk/squirrelmail/functions/db_prefs.php

Modified: trunk/documentation/admin/admin.sgml
===================================================================
--- trunk/documentation/admin/admin.sgml        2007-03-04 00:54:34 UTC (rev 
12299)
+++ trunk/documentation/admin/admin.sgml        2007-03-04 01:56:54 UTC (rev 
12300)
@@ -939,31 +939,30 @@
 
 <sect1>Using database backends<label id="db-backend">
 <p>
-On sites with many users you might want to store your user data in a
-database instead of in files. This document describes how to configure
-SquirrelMail to do this.
+On sites with many users you might want to store your user data in a database
+instead of in files. SquirrelMail can be configured to do this. Note, however,
+that some SquirrelMail plugins are designed to use different files for users'
+data storage and won't be able to use database to store users' data.
 
-Methods for storing both personal address books and user preferences in
-a database is included as a part of the distribution.
+Methods for storing both personal address books and user preferences in a
+database is included as a part of the distribution.
 
 <sect2>Configuring PEAR DB
 <p>
 For this to work you must have the PEAR classes installed, these are part of
-PHP. Once these are installed you must have sure the directory containing them 
is
-a part of your PHP include_path. See the PHP documentation for information on
+PHP. Once these are installed you must have sure the directory containing them
+is a part of your PHP include_path. See the PHP documentation for information 
on
 how to do that.
 
 Under Mandrake Linux the PEAR classes are installed as part of the php-devel
 package and under FreeBSD they are installed as part of the mod_php4 or php4
 port/package. Debian packages pear libraries in php4-pear package.
 
-<sect2>Configuring address books in database
+<sect2>Creating the database
 <p>
-First you need to create a database and a table to store the data in.
-Create a database user with access to read and write in that table.
+First you need to create a database and a database user with access to read and
+write in that table. For MySQL you would normally do something like:
 
-For MySQL you would normally do something like:
-
 <tscreen><verb>
  (from the command line)
  # mysqladmin create squirrelmail
@@ -973,8 +972,24 @@
               TO squirreluser@localhost IDENTIFIED BY 'sqpassword';
 </verb></tscreen>
 
-The table structure should be similar to this (for MySQL):
+<sect2>Constructing a data source name
+<p>
+Both the address books and the preferences need to be configured with a data
+source name (DSN). The DSN should look something like
+<tt>mysql://squirreluser:sqpassword@localhost/squirrelmail</tt> or
+<tt>pgsql://squirreluser:sqpassword@localhost/squirrelmail</tt>. See the <url
+url="http://pear.php.net/manual/en/package.database.db.php"; name="PHP Pear DB
+manual"> for more details about DSN syntax.
 
+When including a sensitive password in your DSN, please make sure that you
+tighten the permissions on <tt>config/config.php</tt> accordingly, so untrusted
+users can't read it.
+
+<sect2>Storing address books in the database
+<p>
+Create a table for the address books. The table structure should be similar to
+this for MySQL:
+
 <tscreen><verb>
 CREATE TABLE address (
   owner varchar(128) DEFAULT '' NOT NULL,
@@ -1004,45 +1019,33 @@
   ("firstname", "lastname");
 </verb></tscreen>
 
-Next, edit your configuration so that the address book DSN (Data Source
-Name) is specified, this can be done using either conf.pl or via the
-administration plugin. The DSN should look something like:
+Don't forget to configure SquirrelMail with the DSN and the table name. This 
can
+be done using either the SquirrelMail configuration utility or via the
+administration plugin.
 
-<tscreen><verb>
- mysql://squirreluser:sqpassword@localhost/squirrelmail or
- pgsql://squirreluser:sqpassword@localhost/squirrelmail
-</verb></tscreen>
+Global address book uses same table format as the one used for personal address
+book. You can even use same table, if you don't have a user named "global".
 
-See <url url="http://pear.php.net/manual/en/package.database.db.php";
-name="PHP Pear DB manual"> for more details about DSN syntax.
-
-When including a sensitive password in your DSN, please make sure
-that you tighten the permissions on config.php accordingly, so
-untrusted users can't read it.
-
-Global address book uses same table format as the one used for personal
-address book. You can even use same table, if you don't have user named
-'global'.
-
-<sect2>Configuring preferences in database
+<sect2>Storing preferences in the database
 <p>
-This is done in much the same way as it is for storing your address
-books in a database.
+Create a table for the preferences. The table structure should be similar to
+this for MySQL:
 
-The table structure should be similar to this (for MySQL):
-
 <tscreen><verb>
-  CREATE TABLE userprefs (
-    user varchar(128) DEFAULT '' NOT NULL,
-    prefkey varchar(64) DEFAULT '' NOT NULL,
-    prefval BLOB DEFAULT '' NOT NULL,
-    PRIMARY KEY (user,prefkey)
-  );
+CREATE TABLE userprefs (
+  user varchar(128) DEFAULT '' NOT NULL,
+  prefkey varchar(64) DEFAULT '' NOT NULL,
+  prefval BLOB DEFAULT '' NOT NULL,
+  PRIMARY KEY (user,prefkey)
+);
 </verb></tscreen>
 
 and for PostgreSQL:
 
 <tscreen><verb>
+-- Note: Change the SquirrelMail config variable $prefs_user_field in
+--       "config/config.php" from the default "user" to "username" since "user"
+--       is a reserved word in PostgreSQL.
 CREATE TABLE "userprefs" (
    "username" varchar(128) NOT NULL,
    "prefkey" varchar(64) NOT NULL,
@@ -1051,24 +1054,10 @@
 );
 </verb></tscreen>
 
-Next, edit your configuration so that the preferences DSN (Data Source
-Name) is specified, this can be done using either SquirrelMail configuration
-utility or via the administration plugin. The DSN should look something like:
+Don't forget to configure SquirrelMail with the DSN, the table name, and the
+field names. This can be done using either the SquirrelMail configuration
+utility or via the administration plugin.
 
-<tscreen><verb>
- mysql://squirreluser:sqpassword@localhost/squirrelmail or
- pgsql://squirreluser:sqpassword@localhost/squirrelmail
-</verb></tscreen>
-
-When including a sensitive password in your DSN, please make sure
-that you tighten the permissions on config.php accordingly, so
-untrusted users can't read it.
-
-Once configuration settings are saved, users' personal preferences will be
-stored in a database. Please note, however, that some SquirrelMail plugins
-are designed to use different files for users' data storage and won't be
-able to use database to store users' data.
-
 <sect2>Primary keys
 <p>
 You <bf>must</bf> set primary keys correctly. If keys are not set correctly,

Modified: trunk/squirrelmail/config/config_default.php
===================================================================
--- trunk/squirrelmail/config/config_default.php        2007-03-04 00:54:34 UTC 
(rev 12299)
+++ trunk/squirrelmail/config/config_default.php        2007-03-04 01:56:54 UTC 
(rev 12300)
@@ -899,13 +899,13 @@
 
 /*** Database ***/
 /**
- * Read doc/database.txt in order to get more information
+ * Read the administrator's manual in order to get more information
  * about these settings.
  */
 /**
  * Database-driven private addressbooks
  *   DSN (Data Source Name) for a database where the private
- *   addressbooks are stored.  See doc/db-backend.txt for more info.
+ *   addressbooks are stored.  See the administrator's manual for more info.
  *   If it is not set, the addressbooks are stored in files
  *   in the data dir.
  *   The DSN is in the format: mysql://user:pass@hostname/dbname

Modified: trunk/squirrelmail/doc/index.html
===================================================================
--- trunk/squirrelmail/doc/index.html   2007-03-04 00:54:34 UTC (rev 12299)
+++ trunk/squirrelmail/doc/index.html   2007-03-04 01:56:54 UTC (rev 12300)
@@ -47,13 +47,6 @@
      This document describes how to use this new code, and the requirements.
    </dd>
 
-   <dt><a href="db-backend.txt">Database Backend</a></dt>
-   <dd>
-     SquirrelMail allows you to store user's preferences and address books
-     in database that is compatible with PHP Pear DB libraries. This document
-     describes how to setup database.
-   </dd>
-
    <dt><a href="presets.txt">Specific IMAP server setups</a></dt>
    <dd>
      SquirrelMail configuration utility allows adjusting settings for selected

Modified: trunk/squirrelmail/functions/db_prefs.php
===================================================================
--- trunk/squirrelmail/functions/db_prefs.php   2007-03-04 00:54:34 UTC (rev 
12299)
+++ trunk/squirrelmail/functions/db_prefs.php   2007-03-04 01:56:54 UTC (rev 
12300)
@@ -299,7 +299,7 @@
         if (strlen($user) > $this->user_size) {
             $this->error = "Oversized username value."
                 ." Your preferences can't be saved."
-                ." See doc/db-backend.txt or contact your system 
administrator.";
+                ." See the administrator's manual or contact your system 
administrator.";
 
             /**
              * Debugging function. Can be used to log all issues that trigger
@@ -317,7 +317,7 @@
         if (strlen($key) > $this->key_size) {
             $err_msg = "Oversized user's preference key."
                 ." Some preferences were not saved."
-                ." See doc/db-backend.txt or contact your system 
administrator.";
+                ." See the administrator's manual or contact your system 
administrator.";
             // error is not fatal. Only some preference is not saved.
             trigger_error($err_msg,E_USER_WARNING);
             return false;
@@ -328,7 +328,7 @@
         if (strlen($value) > $this->val_size) {
             $err_msg = "Oversized user's preference value."
                 ." Some preferences were not saved."
-                ." See doc/db-backend.txt or contact your system 
administrator.";
+                ." See the administrator's manual or contact your system 
administrator.";
             // error is not fatal. Only some preference is not saved.
             trigger_error($err_msg,E_USER_WARNING);
             return false;
@@ -541,5 +541,3 @@
     }
     return getPref($data_dir, $username, $key);
 }
-
-// vim: et ts=4


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


<Prev in Thread] Current Thread [Next in Thread>