[imp] auto create folder
Laurent Foucher
laurent.foucher at iut-tlse3.fr
Thu May 12 08:25:31 UTC 2011
Hi,
Based on the script found on the wiki, default folders are created if
not exists with imp4. Here the script i use :
if (!function_exists('_imp_hook_postlogin')) {
function _imp_hook_postlogin($actionID, $isLogin)
{
global $prefs;
require_once '/usr/share/horde3/imp/lib/Folder.php';
$imp_folder = &IMP_Folder::singleton();
$folder_options = array(
'sent_mail_folder', 'drafts_folder', 'trash_folder', 'spam_folder'
);
foreach ($folder_options as $this_folder) {
$folder = $prefs->getValue($this_folder, true);
if ($folder) {
$folder = IMP::folderPref($folder, true);
if (!$imp_folder->exists($folder)) {
$imp_folder->create($folder, true);
}
}
}
}
}
I would like to do the same think with imp5, but i am lost with the
new Classes. Can you help me to migrate this script to imp5 ?
Thanks a lot.
--
- Laurent Foucher
< I U T 'A' Paul Sabatier >
laurent.foucher at iut-tlse3.fr
Enseignant/Chargé de mission Systèmes & Réseau
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 1703 bytes
Desc: Cl? publique PGP
URL: <http://lists.horde.org/archives/imp/attachments/20110512/1fe0b122/attachment.bin>
More information about the imp
mailing list