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

\begin{itemize}
\item Create an user account, name it 'publicprofile' and set up the preferences for that account<br />
the way you want all the other accounts to be set up.


\item Create a plain text file containing the list of all the users to which new preferences are to be applied and<br />
name it 'users.txt'


\end{itemize}
e.g.<br />
\#user.txt contains list of all the user whose preferences are to be changed as per the default profile<br />
user1<br />
user2<br />
user3

\begin{itemize}
\item Copy the script below and save it as 'defaultprofile.sh'


\end{itemize}
<pre><code class="language-bash">
\#!/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
</code></pre>
\begin{itemize}
\item run the following command at the shell prompt


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

\begin{itemize}
\item after creating 'applypref.sql' run the following commands at the shell prompt


\end{itemize}
\texttt{su horde}<br />
\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.<br />
<a href="https://wiki.horde.org/Dilyan">Palauzov</a>

\end{document}
