\documentclass{article}
\usepackage{ulem}
\pagestyle{headings}
\begin{document}
Below are the steps to copy preferences of one user to all the other\newline
users which are listed in the userlist text file.

1. Create an user account, name it 'publicprofile' and set up the preferences for that account\newline
the way you want all the other accounts to be set up.

2. Create a plain text file containing the list of all the users to which new preferences are to be applied and\newline
name it 'users.txt'

e.g.\newline
\#user.txt contains list of all the user whose preferences are to be changed as per the default profile\newline
user1\newline
user2\newline
user3

3. Copy the script below and save it as 'defaultprofile.sh'

\begin{verbatim}

#!/usr/bin/ksh

NEW_USERS="/data/users.txt"
cat ${NEW_USERS} | 
while read USER
do
echo "DROP TABLE default_prefs;"
echo "CREATE TABLE default_prefs as SELECT * FROM horde_prefs WHERE
pref_uid='publicprofile';"
echo "UPDATE default_prefs set pref_uid = '$USER';"
echo "DELETE FROM horde_prefs where pref_uid = '$USER';"
echo "INSERT INTO horde_prefs SELECT * FROM default_prefs;"
echo "COMMIT;"
done
\end{verbatim}

4. run the following command at the shell prompt

\texttt{sh defaultprofile.sh > applypref.sql}

5. after creating 'applypref.sql' run the following commands at the shell prompt

\texttt{su horde}\newline
\texttt{psql -d horde < applypref.sql}

That will copy all the preferences from default user to the users specified in the list.

Jigish

Plan B is to set the properties in the corresponding prefs.php and that's all.\newline
 [Dilyan Palauzov]

\end{document}
