Changeset 150 for Mulberry

Show
Ignore:
Timestamp:
01/13/08 21:39:50 (11 months ago)
Author:
cyrusdaboo
Message:

Support for reading/writing preferences as a flat file on a WebDAV server. This is the final piece to
provide a full replacement for IMSP/ACAP via WebDAV technologies. Ultimately an XCAP-like solution
allowing partial reads/writes would be better but this is a good first step.

Location:
Mulberry/branches/v4.1d1
Files:
6 added
18 modified

Legend:

Unmodified
Added
Removed
  • Mulberry/branches/v4.1d1/MacOS/Sources/Application/Other_Dialogs/CChangePswdAcctDialog.cp

    r74 r150  
    9696 
    9797        // Add each remote account 
    98         for(CINETAccountList::const_iterator iter = CPreferences::sPrefs->mRemoteAccounts.GetValue().begin(); 
     98        for(COptionsAccountList::const_iterator iter = CPreferences::sPrefs->mRemoteAccounts.GetValue().begin(); 
    9999                        iter != CPreferences::sPrefs->mRemoteAccounts.GetValue().end(); iter++, menu_pos++) 
    100100        { 
     
    223223 
    224224        // Check each remote account 
    225         for(CINETAccountList::const_iterator iter = CPreferences::sPrefs->mRemoteAccounts.GetValue().begin(); 
     225        for(COptionsAccountList::const_iterator iter = CPreferences::sPrefs->mRemoteAccounts.GetValue().begin(); 
    226226                        iter != CPreferences::sPrefs->mRemoteAccounts.GetValue().end(); iter++) 
    227227        { 
  • Mulberry/branches/v4.1d1/MacOS/Sources/Application/Preferences_Dialog/CPrefsAccount.cp

    r97 r150  
    268268 
    269269        // Add each remote account 
    270         for(CINETAccountList::const_iterator iter = mCopyPrefs->mRemoteAccounts.GetValue().begin(); 
     270        for(COptionsAccountList::const_iterator iter = mCopyPrefs->mRemoteAccounts.GetValue().begin(); 
    271271                        iter != mCopyPrefs->mRemoteAccounts.GetValue().end(); iter++, menu_pos++) 
    272272                ::AppendItemToMenu(menuH, menu_pos, (*iter)->GetName(), false, cicn_RemoteAccount); 
     
    359359                                        break; 
    360360 
     361                                case menu_AccountWebDAVOptions: 
    361362                                case menu_AccountIMSPOptions: 
    362363                                case menu_AccountACAPOptions: 
     
    431432                                        break; 
    432433 
     434                                case menu_AccountWebDAVOptions: 
    433435                                case menu_AccountIMSPOptions: 
    434436                                case menu_AccountACAPOptions: 
    435                                         acct = new CINETAccount; 
     437                                        acct = new COptionsAccount; 
    436438                                        switch(acct_type) 
    437439                                        { 
     440                                        case menu_AccountWebDAVOptions: 
     441                                                acct->SetServerType(CINETAccount::eWebDAVPrefs); 
     442                                                break; 
    438443                                        case menu_AccountIMSPOptions: 
    439444                                                acct->SetServerType(CINETAccount::eIMSP); 
     
    605610                                else if (typeid(*acct) == typeid(CSMTPAccount)) 
    606611                                        acct_list = (CINETAccountList*) &mCopyPrefs->mSMTPAccounts.GetValue(); 
    607                                 else if (typeid(*acct) == typeid(CINETAccount)) 
     612                                else if (typeid(*acct) == typeid(COptionsAccount)) 
    608613                                        acct_list = (CINETAccountList*) &mCopyPrefs->mRemoteAccounts.GetValue(); 
    609614                                else if (typeid(*acct) == typeid(CAddressAccount)) 
     
    640645                                else if (typeid(*acct) == typeid(CSMTPAccount)) 
    641646                                        mCopyPrefs->mSMTPAccounts.SetDirty(); 
    642                                 else if (typeid(*acct) == typeid(CINETAccount)) 
     647                                else if (typeid(*acct) == typeid(COptionsAccount)) 
    643648                                        mCopyPrefs->mRemoteAccounts.SetDirty(); 
    644649                                else if (typeid(*acct) == typeid(CAddressAccount)) 
     
    696701                else if (typeid(*acct) == typeid(CSMTPAccount)) 
    697702                        mCopyPrefs->mSMTPAccounts.SetDirty(); 
    698                 else if (typeid(*acct) == typeid(CINETAccount)) 
     703                else if (typeid(*acct) == typeid(COptionsAccount)) 
    699704                { 
    700705                        // Prevent delete of last remote account if set to remote 
     
    818823                        mIsSMTP = true; 
    819824                } 
    820                 else if (typeid(*account) == typeid(CINETAccount)) 
     825                else if (typeid(*account) == typeid(COptionsAccount)) 
    821826                { 
    822827                        switch(account->GetServerType()) 
    823828                        { 
     829                        case CINETAccount::eWebDAVPrefs: 
     830                                copyStr.FromResource("UI::Preferences::AccountWebDAVOptions"); 
     831                                break; 
    824832                        case CINETAccount::eIMSP: 
    825833                                copyStr.FromResource("UI::Preferences::AccountIMSPOptions"); 
     
    912920        else if (typeid(*current) == typeid(CSMTPAccount)) 
    913921                account = new CSMTPAccount(*(CSMTPAccount*) current); 
    914         else if (typeid(*current) == typeid(CINETAccount)) 
    915                 account = new CINETAccount(*(CINETAccount*) current); 
     922        else if (typeid(*current) == typeid(COptionsAccount)) 
     923                account = new COptionsAccount(*(COptionsAccount*) current); 
    916924        else if (typeid(*current) == typeid(CAddressAccount)) 
    917925                account = new CAddressAccount(*(CAddressAccount*) current); 
     
    940948        else if (typeid(*current) == typeid(CSMTPAccount)) 
    941949                same = (*((CSMTPAccount*) current) == *((CSMTPAccount*) account)); 
    942         else if (typeid(*current) == typeid(CINETAccount)) 
    943                 same = (*((CINETAccount*) current) == *((CINETAccount*) account)); 
     950        else if (typeid(*current) == typeid(COptionsAccount)) 
     951                same = (*((COptionsAccount*) current) == *((COptionsAccount*) account)); 
    944952        else if (typeid(*current) == typeid(CAddressAccount)) 
    945953                same = (*((CAddressAccount*) current) == *((CAddressAccount*) account)); 
     
    956964                else if (typeid(*account) == typeid(CSMTPAccount)) 
    957965                        mCopyPrefs->mSMTPAccounts.SetDirty(); 
    958                 else if (typeid(*account) == typeid(CINETAccount)) 
     966                else if (typeid(*account) == typeid(COptionsAccount)) 
    959967                        mCopyPrefs->mRemoteAccounts.SetDirty(); 
    960968                else if (typeid(*account) == typeid(CAddressAccount)) 
     
    10641072        else if (typeid(*account) == typeid(CSMTPAccount)) 
    10651073                panel = paneid_PrefsSMTPAccount; 
    1066         else if (typeid(*account) == typeid(CINETAccount)) 
     1074        else if (typeid(*account) == typeid(COptionsAccount)) 
    10671075                panel = paneid_PrefsRemoteAccount; 
    10681076        else if (typeid(*account) == typeid(CAddressAccount)) 
  • Mulberry/branches/v4.1d1/MacOS/Sources/Application/Preferences_Dialog/CPrefsAccount.h

    r97 r150  
    6262const ResIDT            menu_AccountLocalMailbox = 3; 
    6363const ResIDT            menu_AccountSMTPMailbox = 5; 
    64 const ResIDT            menu_AccountIMSPOptions = 7; 
    65 const ResIDT            menu_AccountACAPOptions = 8; 
    66 const ResIDT            menu_AccountCardDAVAdbk = 10; 
    67 const ResIDT            menu_AccountIMSPAdbk = 11; 
    68 const ResIDT            menu_AccountACAPAdbk = 12; 
    69 const ResIDT            menu_AccountLDAPSearch = 14; 
    70 const ResIDT            menu_AccountManageSIEVE = 16; 
    71 const ResIDT            menu_AccountCalDAVCalendar = 18; 
    72 const ResIDT            menu_AccountWebDAVCalendar = 19; 
     64const ResIDT            menu_AccountWebDAVOptions = 7; 
     65const ResIDT            menu_AccountIMSPOptions = 8; 
     66const ResIDT            menu_AccountACAPOptions = 9; 
     67const ResIDT            menu_AccountCardDAVAdbk = 11; 
     68const ResIDT            menu_AccountIMSPAdbk = 12; 
     69const ResIDT            menu_AccountACAPAdbk = 13; 
     70const ResIDT            menu_AccountLDAPSearch = 15; 
     71const ResIDT            menu_AccountManageSIEVE = 17; 
     72const ResIDT            menu_AccountCalDAVCalendar = 19; 
     73const ResIDT            menu_AccountWebDAVCalendar = 20; 
    7374 
    7475const ResIDT            cicn_MailAccount = 4; 
  • Mulberry/branches/v4.1d1/MacOS/Sources/Application/Preferences_Dialog/Sub-panels/Account_Panels/Remote_Account_Panels/CPrefsRemoteOptions.cp

    r74 r150  
    2020#include "CPrefsRemoteOptions.h" 
    2121 
    22 #include "CINETAccount.h" 
     22#include "COptionsAccount.h" 
     23#include "CTextFieldX.h" 
    2324 
    2425#include <LCheckBox.h> 
     
    5354        // Get controls 
    5455        mUseRemote = (LCheckBox*) FindPaneByID(paneid_PrefsRemoteOptionsUse); 
     56        mBaseRURL = (CTextFieldX*) FindPaneByID(paneid_PrefsRemoteOptionsBaseRURL); 
    5557} 
    5658 
     
    5860void CPrefsRemoteOptions::SetData(void* data) 
    5961{ 
    60         CINETAccount* acct = (CINETAccount*) data; 
     62        COptionsAccount* acct = (COptionsAccount*) data; 
    6163 
    6264        // Copy info 
    6365        mUseRemote->SetValue(acct->GetLogonAtStart()); 
     66        if (acct->GetServerType() == CINETAccount::eWebDAVPrefs) 
     67                mBaseRURL->SetText(acct->GetBaseRURL()); 
     68        else 
     69        { 
     70                FindPaneByID(paneid_PrefsRemoteOptionsBaseRURLText)->Hide(); 
     71                mBaseRURL->Hide(); 
     72        } 
    6473} 
    6574 
     
    6776void CPrefsRemoteOptions::UpdateData(void* data) 
    6877{ 
    69         CINETAccount* acct = (CINETAccount*) data; 
     78        COptionsAccount* acct = (COptionsAccount*) data; 
    7079 
    7180        acct->SetLoginAtStart(mUseRemote->GetValue()==1); 
     81        if (acct->GetServerType() == CINETAccount::eWebDAVPrefs) 
     82                acct->SetBaseRURL(mBaseRURL->GetText()); 
    7283} 
  • Mulberry/branches/v4.1d1/MacOS/Sources/Application/Preferences_Dialog/Sub-panels/Account_Panels/Remote_Account_Panels/CPrefsRemoteOptions.h

    r74 r150  
    2929const   PaneIDT         paneid_PrefsRemoteOptions = 5022; 
    3030const   PaneIDT         paneid_PrefsRemoteOptionsUse = 'USES'; 
     31const   PaneIDT         paneid_PrefsRemoteOptionsBaseRURLText = 'RTXT'; 
     32const   PaneIDT         paneid_PrefsRemoteOptionsBaseRURL = 'RURL'; 
    3133 
    3234// Mesages 
     
    3537 
    3638// Classes 
     39class CTextFieldX; 
    3740class LCheckBox; 
    3841 
     
    4144private: 
    4245        LCheckBox*              mUseRemote; 
     46        CTextFieldX*    mBaseRURL; 
    4347 
    4448public: 
  • Mulberry/branches/v4.1d1/Sources_Common/Application/Preferences/CAdminLock.cp

    r19 r150  
    178178 
    179179        // Remote server 
    180         for(CINETAccountList::const_iterator iter = prefs->mRemoteAccounts.GetValue().begin(); iter != prefs->mRemoteAccounts.GetValue().end(); iter++) 
     180        for(COptionsAccountList::const_iterator iter = prefs->mRemoteAccounts.GetValue().begin(); iter != prefs->mRemoteAccounts.GetValue().end(); iter++) 
    181181        { 
    182182                if (!(*iter)->GetServerIP().empty()) 
     
    257257 
    258258        // Remote server 
    259         for(CINETAccountList::iterator iter = prefs->mRemoteAccounts.Value().begin(); iter != prefs->mRemoteAccounts.Value().end(); iter++) 
     259        for(COptionsAccountList::iterator iter = prefs->mRemoteAccounts.Value().begin(); iter != prefs->mRemoteAccounts.Value().end(); iter++) 
    260260        { 
    261261                cdstring serverip = (*iter)->GetServerIP(); 
     
    367367                remote_set = mLockedPrefsServerAddr.empty(); 
    368368                pos = 0; 
    369                 for(CINETAccountList::iterator iter = prefs->mRemoteAccounts.Value().begin(); iter != prefs->mRemoteAccounts.Value().end(); iter++, pos++) 
     369                for(COptionsAccountList::iterator iter = prefs->mRemoteAccounts.Value().begin(); iter != prefs->mRemoteAccounts.Value().end(); iter++, pos++) 
    370370                { 
    371371                        if (remote_set) 
     
    455455 
    456456                // Remote server 
    457                 for(CINETAccountList::iterator iter = prefs->mRemoteAccounts.Value().begin(); iter != prefs->mRemoteAccounts.Value().end(); iter++) 
     457                for(COptionsAccountList::iterator iter = prefs->mRemoteAccounts.Value().begin(); iter != prefs->mRemoteAccounts.Value().end(); iter++) 
    458458                { 
    459459                        // Remove port number which shuld not be considered part of the domain 
     
    516516 
    517517                // Change each plain text authenticator 
    518                 for(CINETAccountList::const_iterator iter = prefs->mRemoteAccounts.GetValue().begin(); iter != prefs->mRemoteAccounts.GetValue().end(); iter++) 
     518                for(COptionsAccountList::const_iterator iter = prefs->mRemoteAccounts.GetValue().begin(); iter != prefs->mRemoteAccounts.GetValue().end(); iter++) 
    519519                { 
    520520                        if ((*iter)->GetAuthenticator().RequiresUserPswd()) 
     
    597597 
    598598                // Remote server 
    599                 for(CINETAccountList::const_iterator iter = prefs->mRemoteAccounts.GetValue().begin(); iter != prefs->mRemoteAccounts.GetValue().end(); iter++) 
     599                for(COptionsAccountList::const_iterator iter = prefs->mRemoteAccounts.GetValue().begin(); iter != prefs->mRemoteAccounts.GetValue().end(); iter++) 
    600600                        UpgradeAuthenticator(*iter); 
    601601 
  • Mulberry/branches/v4.1d1/Sources_Common/Application/Preferences/CINETAccount.cp

    r86 r150  
    4343         "SMTP", 
    4444         "NNTP", 
     45         "WebDAV Prefs", 
    4546         "IMSP", 
    4647         "ACAP", 
     
    144145                 
    145146        // HTTP only does SSL - no STARTTLS 
     147        case eWebDAVPrefs: 
    146148        case eHTTPCalendar: 
    147149        case eWebDAVCalendar: 
  • Mulberry/branches/v4.1d1/Sources_Common/Application/Preferences/CINETAccount.h

    r86 r150  
    4444                eSMTP, 
    4545                eNNTP, 
     46                eWebDAVPrefs, 
    4647                eIMSP, 
    4748                eACAP, 
  • Mulberry/branches/v4.1d1/Sources_Common/Application/Preferences/COptionsMap.cp

    r19 r150  
    751751                                                        key.compare_end(cRemoteAccountsKey_2_0)) 
    752752                                        // Create remote account 
    753                                         acct = new CINETAccount; 
     753                                        acct = new COptionsAccount; 
    754754                                else if (key.compare_end(cAddressAccountsKey_1_3) || 
    755755                                                        key.compare_end(cAddressAccountsKey_1_4) || 
  • Mulberry/branches/v4.1d1/Sources_Common/Application/Preferences/COptionsMap.h

    r54 r150  
    3333#include "CManageSIEVEAccount.h" 
    3434#include "CMIMEMap.h" 
     35#include "COptionsAccount.h" 
    3536#include "CSearchStyle.h" 
    3637#include "CSMTPAccount.h" 
     
    110111                { return WriteValue(key, (const CINETAccountList&) value); } 
    111112        virtual bool WriteValue(const cdstring& key, const CSMTPAccountList& value) 
     113                { return WriteValue(key, (const CINETAccountList&) value); } 
     114        virtual bool WriteValue(const cdstring& key, const COptionsAccountList& value) 
    112115                { return WriteValue(key, (const CINETAccountList&) value); } 
    113116        virtual bool WriteValue(const cdstring& key, const CAddressAccountList& value) 
     
    167170        virtual bool ReadValue(const cdstring& key, CSMTPAccountList& value, NumVersion vers_prefs) 
    168171                { return ReadValue(key, (CINETAccountList&) value, vers_prefs); } 
     172        virtual bool ReadValue(const cdstring& key, COptionsAccountList& value, NumVersion vers_prefs) 
     173                { return ReadValue(key, (CINETAccountList&) value, vers_prefs); } 
    169174        virtual bool ReadValue(const cdstring& key, CAddressAccountList& value, NumVersion vers_prefs) 
    170175                { return ReadValue(key, (CINETAccountList&) value, vers_prefs); } 
  • Mulberry/branches/v4.1d1/Sources_Common/Application/Preferences/CPreferences.cp

    r86 r150  
    331331 
    332332                // Test each remote options account status 
    333                 for(CINETAccountList::const_iterator iter = mRemoteAccounts.mValue.begin(); iter != mRemoteAccounts.mValue.end(); iter++) 
     333                for(COptionsAccountList::const_iterator iter = mRemoteAccounts.mValue.begin(); iter != mRemoteAccounts.mValue.end(); iter++) 
    334334                { 
    335335                        extra_txt = (*iter)->GetName(); 
     
    577577                { 
    578578                        // Copy to all remote accounts 
    579                         for(CINETAccountList::iterator iter = mRemoteAccounts.mValue.begin(); iter != mRemoteAccounts.mValue.end(); iter++) 
     579                        for(COptionsAccountList::iterator iter = mRemoteAccounts.mValue.begin(); iter != mRemoteAccounts.mValue.end(); iter++) 
    580580                        { 
    581581                                if ((*iter)->GetAuthenticator().RequiresUserPswd()) 
     
    594594 
    595595                        // Copy to all remote accounts 
    596                         for(CINETAccountList::iterator iter = mRemoteAccounts.mValue.begin(); iter != mRemoteAccounts.mValue.end(); iter++) 
     596                        for(COptionsAccountList::iterator iter = mRemoteAccounts.mValue.begin(); iter != mRemoteAccounts.mValue.end(); iter++) 
    597597                        { 
    598598                                if ((*iter)->GetAuthenticator().RequiresUserPswd()) 
     
    712712 
    713713        // Check remote account uids 
    714         for(CINETAccountList::iterator iter = mRemoteAccounts.mValue.begin(); iter != mRemoteAccounts.mValue.end(); iter++) 
     714        for(COptionsAccountList::iterator iter = mRemoteAccounts.mValue.begin(); iter != mRemoteAccounts.mValue.end(); iter++) 
    715715        { 
    716716                if ((*iter)->GetAuthenticator().RequiresUserPswd()) 
     
    10861086        } 
    10871087        out << " ) Prefs ("; 
     1088        bool prefs_webdav = false; 
    10881089        bool prefs_imsp = false; 
    10891090        bool prefs_acap = false; 
    1090         for(CINETAccountList::const_iterator iter = mRemoteAccounts.mValue.begin(); iter != mRemoteAccounts.mValue.end(); iter++) 
     1091        for(COptionsAccountList::const_iterator iter = mRemoteAccounts.mValue.begin(); iter != mRemoteAccounts.mValue.end(); iter++) 
    10911092        { 
    10921093                switch((*iter)->GetServerType()) 
    10931094                { 
     1095                case CINETAccount::eWebDAVPrefs: 
     1096                        if (!prefs_webdav) 
     1097                        { 
     1098                                out << " WebDAV"; 
     1099                                prefs_webdav = true; 
     1100                        } 
     1101                        break; 
    10941102                case CINETAccount::eIMSP: 
    10951103                        if (!prefs_imsp) 
  • Mulberry/branches/v4.1d1/Sources_Common/Application/Preferences/CPreferences.h

    r86 r150  
    3636#include "CPreferenceEnum.h" 
    3737#include "CPreferenceValue.h" 
     38#include "COptionsAccount.h" 
    3839#include "CSearchStyle.h" 
    3940#include "CSMTPAccount.h" 
     
    115116        CPreferenceValueMap<CMailAccountList>                   mMailAccounts;                                  // List of mail accounts 
    116117        CPreferenceValueMap<CSMTPAccountList>                   mSMTPAccounts;                                  // List of SMTP accounts 
    117         CPreferenceValueMap<CINETAccountList>                   mRemoteAccounts;                                // List of remote options accounts 
     118        CPreferenceValueMap<COptionsAccountList>                mRemoteAccounts;                                // List of remote options accounts 
    118119        CPreferenceValueMap<CManageSIEVEAccountList>    mSIEVEAccounts;                                 // List of ManageSIEVE accounts 
    119120        CPreferenceValueMap<cdstring>                                   mMailDomain;                                    // Mail domain 
  • Mulberry/branches/v4.1d1/Sources_Common/Application/Preferences/CPreferencesRW.cp

    r86 r150  
    947947                        if (!mRemoteIP.mValue.empty()) 
    948948                        { 
    949                                 CINETAccount* remote = new CINETAccount; 
     949                                COptionsAccount* remote = new COptionsAccount; 
    950950 
    951951                                // Make name first part of IP address 
  • Mulberry/branches/v4.1d1/Sources_Common/Mail/Control/CMailControl.cp

    r114 r150  
    929929                                case CINETAccount::eIMSP: 
    930930                                case CINETAccount::eACAP: 
     931                                case CINETAccount::eCardDAVAdbk: 
    931932                                        icon = ICNx_UserPswdAddressBook; 
    932933                                        title = rsrc::GetString("Alerts::UserPswd::ADBKLOGIN"); 
     
    971972                                case CINETAccount::eIMSP: 
    972973                                case CINETAccount::eACAP: 
     974                                case CINETAccount::eCardDAVAdbk: 
    973975                                        icon = IDI_USERPSWD_ADBK; 
    974976                                        title = rsrc::GetString("Alerts::UserPswd::ADBKLOGIN"); 
     
    10191021                                case CINETAccount::eIMSP: 
    10201022                                case CINETAccount::eACAP: 
     1023                                case CINETAccount::eCardDAVAdbk: 
    10211024                                        icon = IDI_USERPSWD_ADBK; 
    10221025                                        title = rsrc::GetString("Alerts::UserPswd::ADBKLOGIN"); 
  • Mulberry/branches/v4.1d1/Sources_Common/Mail/Protocols/COptions