当前位置: 首页>>代码示例>>PHP>>正文


PHP Account::LoadFromDb方法代码示例

本文整理汇总了PHP中Account::LoadFromDb方法的典型用法代码示例。如果您正苦于以下问题:PHP Account::LoadFromDb方法的具体用法?PHP Account::LoadFromDb怎么用?PHP Account::LoadFromDb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Account的用法示例。


在下文中一共展示了Account::LoadFromDb方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: BaseProcessor

 /**
  * @return BaseProcessor
  */
 function BaseProcessor()
 {
     if (!Session::has(ACCOUNT_ID)) {
         $this->SetError(1);
     }
     $accountId = Session::val(ACCOUNT_ID);
     $this->sArray = Session::val(SARRAY, array());
     $this->settings =& Settings::CreateInstance();
     if (!$this->settings || !$this->settings->isLoad) {
         $this->SetError(3);
     }
     if ($accountId) {
         if (Get::has(CHANGE_ACCID)) {
             $oldaccount =& Account::LoadFromDb(Session::val(ACCOUNT_ID, -1));
             $accountId = Get::val(CHANGE_ACCID);
             if (!isset($_SESSION['attachtempdir'])) {
                 $_SESSION['attachtempdir'] = md5(session_id());
             }
             $fs =& new FileSystem(INI_DIR . '/temp', $oldaccount->Email, $oldaccount->Id);
             $attfolder =& new Folder($oldaccount->Id, -1, $_SESSION['attachtempdir']);
             $fs->DeleteDir($attfolder);
             unset($fs, $attfolder);
             $this->sArray[ACCOUNT_ID] = $accountId;
             $this->account =& Account::LoadFromDb($accountId);
             if (!$this->account || $this->account->IdUser != $oldaccount->IdUser) {
                 $this->account = null;
             } else {
                 $_SESSION[ACCOUNT_ID] = $accountId;
                 unset($_SESSION[SARRAY]);
                 $this->sArray = array();
             }
         } else {
             $this->sArray[ACCOUNT_ID] = $accountId;
             $this->account =& Account::LoadFromDb($accountId);
         }
         if (!$this->account) {
             $this->SetError(2);
         }
     } else {
         $this->SetError(1);
     }
     if (!isset($this->sArray[ACCOUNT_ID]) || $this->sArray[ACCOUNT_ID] != $accountId) {
         $this->sArray[EDIT_ACCOUNT_ID] = $accountId;
     }
     $this->processor =& new MailProcessor($this->account);
     if (!$this->processor->DbStorage || !$this->processor->DbStorage->Connect()) {
         $this->SetError(5);
     }
     $this->db =& $this->processor->DbStorage;
     $this->accounts =& $this->GetAccounts();
     $skins =& FileSystem::GetSkinsList();
     $hasDefSettingsSkin = false;
     $normalSkin = false;
     foreach ($skins as $skinName) {
         if ($skinName == $this->settings->DefaultSkin) {
             $hasDefSettingsSkin = true;
         }
         if ($skinName == $this->account->DefaultSkin) {
             $normalSkin = true;
             break;
         }
     }
     if (!$normalSkin) {
         $this->account->DefaultSkin = $hasDefSettingsSkin ? $this->settings->DefaultSkin : ($this->account->DefaultSkin = $skins[0]);
     }
     $_SESSION[ATTACH_DIR] = Session::val(ATTACH_DIR, md5(session_id()));
     if (isset($this->sArray[SCREEN])) {
         $screen = Get::val(SCREEN, $this->sArray[SCREEN]);
         $this->sArray[SCREEN] = $screen;
         if ($this->account->AllowChangeSettings == false && ($screen == SET_ACCOUNT_PROF || $screen == SET_ACCOUNT_ADDACC)) {
             $this->sArray[SCREEN] = SCREEN_MAILBOX;
         }
         if (!$this->settings->AllowContacts && $screen == SCREEN_CONTACTS) {
             $this->sArray[SCREEN] = SCREEN_MAILBOX;
         }
     } else {
         $this->sArray[SCREEN] = Get::val(SCREEN, SCREEN_MAILBOX);
     }
     if (isset($this->sArray[FOLDER_ID])) {
         $this->sArray[FOLDER_ID] = Get::val(FOLDER_ID, $this->sArray[FOLDER_ID]);
     } else {
         $this->sArray[FOLDER_ID] = Get::val(FOLDER_ID, -1);
     }
     if (Get::has(FOLDER_ID) || Get::has(SCREEN)) {
         if (isset($this->sArray[SEARCH_ARRAY])) {
             unset($this->sArray[SEARCH_ARRAY]);
         }
     }
     if (Session::has(GOTOFOLDER)) {
         $this->sArray[GOTOFOLDER] = Session::val(GOTOFOLDER, '');
         unset($_SESSION[GOTOFOLDER]);
     }
     if (isset($this->sArray[PAGE])) {
         $this->sArray[PAGE] = Get::val(PAGE, $this->sArray[PAGE]);
     } else {
         $this->sArray[PAGE] = 1;
     }
//.........这里部分代码省略.........
开发者ID:diedsmiling,项目名称:busenika,代码行数:101,代码来源:processor.php

示例2: UserLoginByEmail

 /**
  * @param string $email
  * @param string $login
  * @param int $startPage
  * @param string $password optional
  * @return bool
  */
 function UserLoginByEmail($email, $login, $startPage = START_PAGE_IS_MAILBOX, $password = null, $toEmail = null, $separated = false)
 {
     $newAccount = new Account();
     $settings =& Settings::CreateInstance();
     if (!$settings || !$settings->isLoad) {
         $this->SetError(PROC_CANT_GET_SETTINGS);
         return false;
     }
     $url = 'webmail.php?check=1';
     switch ($startPage) {
         default:
             $url .= '&start=' . START_PAGE_IS_MAILBOX;
             break;
         case START_PAGE_IS_NEW_MESSAGE:
             $url .= '&start=' . START_PAGE_IS_NEW_MESSAGE;
             if ($toEmail && strlen($toEmail) > 0) {
                 $url .= '&to=' . $toEmail;
             }
             break;
         case START_PAGE_IS_MAILBOX:
         case START_PAGE_IS_SETTINGS:
         case START_PAGE_IS_CONTACTS:
             $url .= '&start=' . $startPage;
             break;
         case START_PAGE_IS_CALENDAR:
             if ($separated) {
                 $url = 'calendar.php';
             } else {
                 $url .= '&start=' . $startPage;
             }
             break;
     }
     $loginArray =& Account::LoadFromDbByLogin($email, $login);
     if ($loginArray != null) {
         if ($loginArray[2] == '1') {
             if ($password === null) {
                 $this->SetLoginInfo($loginArray[0], $loginArray[3], null, $separated);
                 $this->ChangeLocation($url);
                 return true;
             } else {
                 if ($password == ConvertUtils::DecodePassword($loginArray[1], $newAccount)) {
                     $this->SetLoginInfo($loginArray[0], $loginArray[3], null, $separated);
                     $this->ChangeLocation($url);
                     return true;
                 } else {
                     $account =& Account::LoadFromDb($loginArray[0]);
                     $account->MailIncPassword = $password;
                     $newprocessor = new MailProcessor($account);
                     if ($newprocessor->MailStorage->Connect(true)) {
                         if ($account->Update()) {
                             $this->SetLoginInfo($account->Id, $account->IdUser, $account->DefaultLanguage, $separated);
                             $this->ChangeLocation($url);
                             return true;
                         } else {
                             $this->SetError(getGlobalError());
                         }
                     } else {
                         $this->SetError(PROC_WRONG_ACCT_PWD);
                     }
                 }
             }
         } else {
             $this->SetError(PROC_CANT_LOG_NONDEF);
         }
     } else {
         $this->SetError(ErrorPOP3IMAP4Auth);
     }
     return false;
 }
开发者ID:JDevelopers,项目名称:Mail,代码行数:76,代码来源:integr.php

示例3: UpdateContactFromRequest

/**
 * @param XmlDomNode $xmlObj
 * @param AddressBookRecord $addressBookRecord
 * @param int $accountId
 */
function UpdateContactFromRequest(&$xmlObj, &$addressBookRecord, $accountId)
{
    $contactNode =& $xmlObj->GetChildNodeByTagName('contact');
    $account =& Account::LoadFromDb($accountId);
    $addressBookRecord->IdUser = $account->IdUser;
    if (array_key_exists('id', $contactNode->Attributes)) {
        $addressBookRecord->IdAddress = $contactNode->Attributes['id'];
    }
    $addressBookRecord->PrimaryEmail = $contactNode->Attributes['primary_email'];
    $addressBookRecord->UseFriendlyName = (bool) $contactNode->Attributes['use_friendly_nm'];
    $addressBookRecord->FullName = $contactNode->GetChildValueByTagName('fullname', true);
    $birthdayNode =& $contactNode->GetChildNodeByTagName('birthday');
    $personalNode =& $contactNode->GetChildNodeByTagName('personal');
    $addressBookRecord->HomeEmail = $personalNode->GetChildValueByTagName('email', true);
    $addressBookRecord->HomeStreet = $personalNode->GetChildValueByTagName('street', true);
    $addressBookRecord->HomeCity = $personalNode->GetChildValueByTagName('city', true);
    $addressBookRecord->HomeState = $personalNode->GetChildValueByTagName('state', true);
    $addressBookRecord->HomeZip = $personalNode->GetChildValueByTagName('zip', true);
    $addressBookRecord->HomeCountry = $personalNode->GetChildValueByTagName('country', true);
    $addressBookRecord->HomeFax = $personalNode->GetChildValueByTagName('fax', true);
    $addressBookRecord->HomePhone = $personalNode->GetChildValueByTagName('phone', true);
    $addressBookRecord->HomeMobile = $personalNode->GetChildValueByTagName('mobile', true);
    $addressBookRecord->HomeWeb = $personalNode->GetChildValueByTagName('web', true);
    $businessNode =& $contactNode->GetChildNodeByTagName('business', true);
    $addressBookRecord->BusinessEmail = $businessNode->GetChildValueByTagName('email', true);
    $addressBookRecord->BusinessCompany = $businessNode->GetChildValueByTagName('company', true);
    $addressBookRecord->BusinessJobTitle = $businessNode->GetChildValueByTagName('job_title', true);
    $addressBookRecord->BusinessDepartment = $businessNode->GetChildValueByTagName('department', true);
    $addressBookRecord->BusinessOffice = $businessNode->GetChildValueByTagName('office', true);
    $addressBookRecord->BusinessStreet = $businessNode->GetChildValueByTagName('street', true);
    $addressBookRecord->BusinessCity = $businessNode->GetChildValueByTagName('city', true);
    $addressBookRecord->BusinessState = $businessNode->GetChildValueByTagName('state', true);
    $addressBookRecord->BusinessZip = $businessNode->GetChildValueByTagName('zip', true);
    $addressBookRecord->BusinessCountry = $businessNode->GetChildValueByTagName('country', true);
    $addressBookRecord->BusinessFax = $businessNode->GetChildValueByTagName('fax', true);
    $addressBookRecord->BusinessPhone = $businessNode->GetChildValueByTagName('phone', true);
    $addressBookRecord->BusinessWeb = $businessNode->GetChildValueByTagName('web', true);
    $otherNode =& $contactNode->GetChildNodeByTagName('other', true);
    $addressBookRecord->OtherEmail = $otherNode->GetChildValueByTagName('email', true);
    $addressBookRecord->Notes = $otherNode->GetChildValueByTagName('notes', true);
    $addressBookRecord->BirthdayDay = $birthdayNode->Attributes['day'];
    $addressBookRecord->BirthdayMonth = $birthdayNode->Attributes['month'];
    $addressBookRecord->BirthdayYear = $birthdayNode->Attributes['year'];
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:49,代码来源:processing.php

示例4: header

    } else {
        if ($error == '2') {
            $errorDesc = PROC_CANT_LOAD_ACCT;
            $errorClass = 'wm_login_error';
        } else {
            if ($error == '3') {
                $errorDesc = PROC_CANT_GET_SETTINGS;
                $errorClass = 'wm_login_error';
            } else {
                if ($error == '5') {
                    $errorDesc = PROC_CANT_LOAD_DB;
                    $errorClass = 'wm_login_error';
                } else {
                    if (isset($_COOKIE['awm_autologin_data'], $_COOKIE['awm_autologin_id'])) {
                        require_once WM_ROOTPATH . 'common/class_account.php';
                        $account =& Account::LoadFromDb($_COOKIE['awm_autologin_id']);
                        if ($account != null && $_COOKIE['awm_autologin_data'] == md5(ConvertUtils::EncodePassword($account->MailIncPassword, $account))) {
                            $_SESSION[ACCOUNT_ID] = $account->Id;
                            $_SESSION[USER_ID] = $account->IdUser;
                            $_SESSION[SESSION_LANG] = $account->DefaultLanguage;
                            header('Location: webmail.php?check=1');
                            exit;
                        }
                    }
                }
            }
        }
    }
}
$dbStorage =& DbStorageCreator::CreateDatabaseStorage($null);
@header('Content-type: text/html; charset=utf-8');
开发者ID:JDevelopers,项目名称:Mail,代码行数:31,代码来源:index.php

示例5: exit

$settings =& Settings::CreateInstance();
if (!$settings || !$settings->isLoad) {
    exit('<script>parent.changeLocation("' . LOGINFILE . '?error=3");</script>');
} elseif (!$settings->IncludeLang()) {
    exit('<script>parent.changeLocation("' . LOGINFILE . '?error=6");</script>');
}
require_once WM_ROOTPATH . 'class_account.php';
require_once WM_ROOTPATH . 'classic/base_defines.php';
require_once WM_ROOTPATH . 'common/class_log.php';
require_once WM_ROOTPATH . 'classic/class_getmessagebase.php';
$log =& CLog::CreateInstance();
if (!Session::has(ACCOUNT_ID)) {
    exit('<script>parent.changeLocation("' . LOGINFILE . '?error=1");</script>');
}
$_SESSION['attachtempdir'] = Session::val('attachtempdir', md5(session_id()));
$account =& Account::LoadFromDb(Session::val(ACCOUNT_ID, -1));
if (!$account) {
    exit('<script>parent.changeLocation("' . LOGINFILE . '?error=2");</script>');
}
$isNull = false;
$mes_id = Get::val('msg_id', '');
$mes_uid = Get::val('msg_uid', '');
$folder_id = Get::val('folder_id', '');
$folder_name = Get::val('folder_fname', '');
$mes_charset = Get::val('charset', -1);
if ($mes_uid) {
    $message =& new GetMessageBase($account, $mes_id, $mes_uid, $folder_id, $folder_name, $mes_charset);
    if (!$message->msg) {
        $isNull = true;
    }
} else {
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:print.php

示例6: setContentLength

require_once WM_ROOTPATH . 'class_account.php';
require_once WM_ROOTPATH . 'class_folders.php';
require_once WM_ROOTPATH . 'class_mailprocessor.php';
require_once WM_ROOTPATH . 'class_webmailmessages.php';
@session_name('PHPWEBMAILSESSID');
@session_start();
function setContentLength($data)
{
    header('Content-Length: ' . strlen($data));
    return $data;
}
@ob_start('setContentLength');
if (!isset($_SESSION[ACCOUNT_ID])) {
    exit;
}
$account =& Account::LoadFromDb($_SESSION[ACCOUNT_ID]);
if (!$account) {
    exit;
}
if (isset($_GET['msg_id'], $_GET['msg_uid'], $_GET['folder_id'], $_GET['folder_fname'])) {
    $folder =& new Folder($_SESSION[ACCOUNT_ID], $_GET['folder_id'], $_GET['folder_fname']);
    $dbStorage =& DbStorageCreator::CreateDatabaseStorage($account);
    if ($dbStorage->Connect()) {
        $dbStorage->GetFolderInfo($folder);
    }
    $processor =& new MailProcessor($account);
    $message =& $processor->GetMessage($_GET['msg_id'], $_GET['msg_uid'], $folder);
    $data = $message->TryToGetOriginalMailMessage();
    $fileNameToSave = trim(ConvertUtils::ClearFileName($message->GetSubject()));
    if (empty($fileNameToSave)) {
        $fileNameToSave = 'message';
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:attach.php

示例7: GetDomainStringLine

}
$domainStr = '';
if ($eximDomains && count($eximDomains) > 0) {
    $domainStr = GetDomainStringLine($eximDomains);
} else {
    @header('Location: ./index.php');
    exit;
}
$step = 1;
if (isset($_SESSION[SESSION_RESET_STEP]) && $_SESSION[SESSION_RESET_STEP] > 0 && $_SESSION[SESSION_RESET_STEP] < 5) {
    $step = (int) $_SESSION[SESSION_RESET_STEP];
}
$stepData = '{step:' . $step;
$stepAccountEmail = $step2Question1 = $step2Question2 = '';
if (isset($_SESSION[SESSION_RESET_ACCT_ID]) && $_SESSION[SESSION_RESET_ACCT_ID] > 0) {
    $stepAccount =& Account::LoadFromDb($_SESSION[SESSION_RESET_ACCT_ID]);
    if ($stepAccount) {
        if (2 == $step) {
            $stepData .= ', email:\'' . ConvertUtils::ClearJavaScriptString($stepAccount->Email, '\'') . '\'';
            $stepData .= ', Q1:\'' . ConvertUtils::ClearJavaScriptString($stepAccount->Question1, '\'') . '\'';
            $stepData .= ', Q2:\'' . ConvertUtils::ClearJavaScriptString($stepAccount->Question2, '\'') . '\'';
        } else {
            if (3 == $step) {
                $stepData .= ', email:\'' . ConvertUtils::ClearJavaScriptString($stepAccount->Email, '\'') . '\'';
                $stepName = 'пользователь';
                if (strlen($stepAccount->FriendlyName) > 0) {
                    $stepName = $stepAccount->FriendlyName;
                }
                $stepData .= ', name:\'' . ConvertUtils::ClearJavaScriptString($stepName, '\'') . '\'';
            } else {
                if (4 == $step) {
开发者ID:JDevelopers,项目名称:Mail,代码行数:31,代码来源:password-reset.php

示例8: switch

     }
     break;
 case 'delete':
     switch ($REQ) {
         case 'message':
             $folder =& new Folder($Account->Id, Post::val('folderId', -1), '');
             $Processor->GetFolderInfo($folder);
             $messageIdUidSet = array(Post::val('messageId', -1) => Post::val('messageUid', ''));
             if (!$Processor->DeleteMessages($messageIdUidSet, $folder)) {
                 SetError(PROC_CANT_DEL_MSGS, BASEFILE . '?' . SCREEN . '=' . SCREEN_MAILBOX);
             }
             header('Location: ' . BASEFILE . '?' . SCREEN . '=' . SCREEN_MAILBOX);
             break;
         case 'folders':
             if ($sarray && in_array($sarray[EDIT_ACCOUNT_ID], $Accounts)) {
                 $editAccount =& Account::LoadFromDb($sarray[EDIT_ACCOUNT_ID]);
                 if ($editAccount->IsDemo) {
                     header('Location: ' . BASEFILE);
                     exit;
                 }
                 $editProcessor =& new MailProcessor($editAccount);
                 $result = true;
                 if (isset($_POST['folders']) && is_array($_POST['folders'])) {
                     foreach ($_POST['folders'] as $key => $value) {
                         $folder =& new Folder($editAccount->Id, $key, $value);
                         $editProcessor->GetFolderInfo($folder);
                         $editProcessor->GetFolderMessageCount($folder);
                         $childCount = $editProcessor->DbStorage->GetFolderChildCount($folder);
                         if ($Account->MailProtocol == MAILPROTOCOL_IMAP4 && ($folder->MessageCount > 0 || $childCount != 0)) {
                             $result = false;
                         } else {
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:actions.php

示例9: isset

	<link rel="shortcut icon" href="favicon.ico" />
</head>
<body onload="parent.CheckEndCheckMailHandler();">
<?php 
$account =& Account::LoadFromDb($_SESSION[ACCOUNT_ID]);
ConvertUtils::SetLimits();
$GLOBALS['useFilters'] = true;
$type = isset($_POST['Type']) ? (int) $_POST['Type'] : 0;
if (1 === $type) {
    $dbStorage =& DbStorageCreator::CreateDatabaseStorage($account);
    if ($dbStorage->Connect() && USE_DB) {
        $accounts =& $dbStorage->SelectAccounts($account->IdUser);
        if ($accounts !== null) {
            foreach ($accounts as $acct_id => $acctArray) {
                if ($acctArray[5]) {
                    $newAcct =& Account::LoadFromDb($acct_id, false, false);
                    $seeEmail = $newAcct->Email;
                    /* custom class */
                    wm_Custom::StaticUseMethod('ChangeAccountEmailToFake', array(&$seeEmail));
                    echo '<script>parent.SetCheckingAccountHandler("' . $seeEmail . '");</script>' . CRLF;
                    myFlush(true);
                    ShowLoggingToServer();
                    $processor = new MailProcessor($newAcct);
                    $folders =& $processor->GetFolders();
                    $processor->MailStorage->DownloadedMessagesHandler = 'ShowDownloadedMessageNumber';
                    if (!$processor->Synchronize($folders)) {
                        $errorDesc .= getGlobalError();
                    }
                    ShowLoggingOffFromServer();
                    $processor->MailStorage->Disconnect();
                    unset($newAcct, $folders, $processor);
开发者ID:JDevelopers,项目名称:Mail,代码行数:31,代码来源:check-mail.php

示例10: AccountAccess

 /**
  * @param int $id
  * @return bool
  */
 function AccountAccess($id)
 {
     if ($id == $_SESSION[ACCOUNT_ID]) {
         return true;
     }
     $result = false;
     if (isset($_SESSION[ACCOUNT_IDS]) && is_array($_SESSION[ACCOUNT_IDS])) {
         $result = in_array($id, $_SESSION[ACCOUNT_IDS]);
     } else {
         if (isset($_SESSION[ACCOUNT_ID])) {
             $_account = null;
             if (!isset($_SESSION[USER_ID])) {
                 $_account =& Account::LoadFromDb($_SESSION[ACCOUNT_ID], false, false);
                 if ($_account) {
                     $_SESSION[USER_ID] = $_account->IdUser;
                 }
             }
             if (isset($_SESSION[USER_ID])) {
                 $_dbStorage =& DbStorageCreator::CreateDatabaseStorage($_account);
                 if ($_dbStorage->Connect()) {
                     $_SESSION[ACCOUNT_IDS] = $_dbStorage->GetAccountListByUserId($_SESSION[USER_ID]);
                     $result = in_array($id, $_SESSION[ACCOUNT_IDS]);
                 }
             }
         }
     }
     if (!$result) {
         $_log =& CLog::CreateInstance();
         $_log->WriteLine('Access Error: Unauthorized access ' . $id . ' && ' . $_SESSION[ACCOUNT_ID], LOG_LEVEL_WARNING);
     }
     return $result;
 }
开发者ID:JDevelopers,项目名称:Mail,代码行数:36,代码来源:class_account.php

示例11: Init

 /**
  * @param Settings $_settings
  * @param MySqlStorage $_dbStorage
  * @param CWebMailLoginInfo $loginInfo
  * @param Account $refAccount
  * @param string $errorString
  */
 function Init(&$_settings, &$_dbStorage, &$loginInfo, &$refAccount, &$errorString)
 {
     $accountCustomValues = array();
     $_log =& CLog::CreateInstance();
     $_isNoLoginField = false;
     $_sendSettingsList = false;
     /* custom class */
     wm_Custom::StaticUseMethod('ChangeLoginInfoBeforeInit', array(&$loginInfo));
     $_infoEmail = trim($loginInfo->getEmail());
     $_infoLogin = trim($loginInfo->getLogin());
     $_infoPassword = $loginInfo->getPassword();
     $_infoAdvancedLogin = $loginInfo->getAdvancedLogin();
     $_infoLang = trim($loginInfo->getLanguage());
     $_domain = $loginInfo->getDomainsSelectValue();
     $_email = $_login = $_optLogin = '';
     if ($_infoAdvancedLogin && $_settings->AllowAdvancedLogin) {
         $_email = $_infoEmail;
         $_login = $_infoLogin;
     } else {
         switch ($_settings->HideLoginMode) {
             case 0:
                 $_email = $_infoEmail;
                 $_login = $_infoLogin;
                 break;
             case 10:
                 $_email = $_infoEmail;
                 $_isNoLoginField = true;
                 $_emailAddress = new EmailAddress();
                 $_emailAddress->SetAsString($_email);
                 $_optLogin = $_emailAddress->GetAccountName();
                 break;
             case 11:
                 $_email = $_infoEmail;
                 $_isNoLoginField = true;
                 $_optLogin = $_email;
                 break;
             case 20:
             case 21:
                 $_login = $_infoLogin;
                 $loginArray = ConvertUtils::ParseEmail($_login);
                 if (20 == $_settings->HideLoginMode) {
                     if (is_array($loginArray) && 2 === count($loginArray)) {
                         $_email = $_login;
                     } else {
                         $_email = $_login . '@';
                         $_email .= $_domain && $_settings->UseMultipleDomainsSelection ? $_domain : $_settings->DefaultDomainOptional;
                     }
                 } else {
                     $_email = is_array($loginArray) && 2 === count($loginArray) ? $loginArray[0] . '@' : $_login . '@';
                     $_email .= $_domain && $_settings->UseMultipleDomainsSelection ? $_domain : $_settings->DefaultDomainOptional;
                 }
                 break;
             case 22:
             case 23:
                 $loginArray = ConvertUtils::ParseEmail($_infoLogin);
                 $_login = is_array($loginArray) && isset($loginArray[0]) ? $loginArray[0] . '@' : $_infoLogin . '@';
                 $_login .= $_domain && $_settings->UseMultipleDomainsSelection ? $_domain : $_settings->DefaultDomainOptional;
                 $_email = $_login;
         }
     }
     /* custom class */
     wm_Custom::StaticUseMethod('ChangeLoginDuringInit', array(&$_login, &$_email));
     $bReturn = true;
     wm_Custom::StaticUseMethod('LdapCustomLoginFunction', array(&$_login, &$_email, &$_infoPassword, &$accountCustomValues, &$errorString, &$bReturn));
     if (!$bReturn) {
         return false;
     }
     $_loginArray = null;
     if (USE_DB) {
         if ($_isNoLoginField) {
             $_loginArray =& Account::LoadFromDbOnlyByEmail($_email);
             if (is_array($_loginArray) && count($_loginArray) > 3) {
                 $_eAccount =& Account::LoadFromDb((int) $_loginArray[0]);
                 if ($_eAccount) {
                     if ($_loginArray[5]) {
                         $errorString = 'Your account is inactive, please contact the system administrator on this.';
                         return false;
                     }
                     $_login = ConvertUtils::DecodePassword($_loginArray[1], $_eAccount) == $_infoPassword ? $_loginArray[4] : $_optLogin;
                 } else {
                     $_login = $_optLogin;
                 }
             } else {
                 $_login = $_optLogin;
             }
             /* custom class */
             wm_Custom::StaticUseMethod('ChangeLoginInfoAfterInit', array(&$_login, &$_email));
         } else {
             /* custom class */
             wm_Custom::StaticUseMethod('ChangeLoginInfoAfterInit', array(&$_login, &$_email));
             $_loginArray =& Account::LoadFromDbByLogin($_email, $_login);
             if ($_loginArray[4]) {
                 $errorString = 'Your account is inactive, please contact the system administrator on this.';
//.........这里部分代码省略.........
开发者ID:JDevelopers,项目名称:Mail,代码行数:101,代码来源:class_login.php

示例12: DoResetpassword

 function DoResetpassword()
 {
     $_dbStorage = $_settings = $_xmlObj = $_xmlRes = $_accountId = null;
     $this->_initFuncArgs($_dbStorage, $_settings, $_xmlObj, $_xmlRes, $_accountId);
     $isGdSupport = @function_exists('imagecreatefrompng');
     $step = $_xmlObj->GetParamValueByName('step');
     if ($step == 1) {
         $_SESSION[SESSION_RESET_STEP] = 1;
         unset($_SESSION[SESSION_RESET_ACCT_ID]);
         $captcha = $_xmlObj->GetParamTagValueByName('captcha');
         if ($isGdSupport && (!isset($_SESSION['captcha_keystring']) || (string) $captcha !== (string) $_SESSION['captcha_keystring'])) {
             CXmlProcessing::PrintErrorAndExit(CaptchaError, $_xmlRes);
         }
         $login = $_xmlObj->GetParamTagValueByName('login');
         $domain = $_xmlObj->GetParamTagValueByName('domain');
         $email = $login . '@' . $domain;
         $_loginArray =& Account::LoadFromDbOnlyByEmail($email);
         if (is_array($_loginArray) && count($_loginArray) > 3) {
             $_eAccount =& Account::LoadFromDb((int) $_loginArray[0]);
             if ($_eAccount && $_eAccount->IsInternal) {
                 if (strlen($_eAccount->Question1 . $_eAccount->Question2) > 0) {
                     $_SESSION[SESSION_RESET_STEP] = 2;
                     $_SESSION[SESSION_RESET_ACCT_ID] = $_eAccount->Id;
                     $_resetNode = new XmlDomNode('reset');
                     $_resetNode->AppendAttribute('step', 2);
                     $_resetNode->AppendChild(new XmlDomNode('email', $_eAccount->Email, true));
                     $_resetNode->AppendChild(new XmlDomNode('q1', $_eAccount->Question1, true));
                     $_resetNode->AppendChild(new XmlDomNode('q2', $_eAccount->Question2, true));
                     $_xmlRes->XmlRoot->AppendChild($_resetNode);
                     return;
                 } else {
                     CXmlProcessing::PrintErrorAndExit(RegUnrecoverableAccount, $_xmlRes);
                 }
             } else {
                 CXmlProcessing::PrintErrorAndExit(WebMailException, $_xmlRes);
             }
         } else {
             CXmlProcessing::PrintErrorAndExit(RegUnknownAdress, $_xmlRes);
         }
     } else {
         if ($step == 2 && isset($_SESSION[SESSION_RESET_ACCT_ID], $_SESSION[SESSION_RESET_STEP]) && $_SESSION[SESSION_RESET_STEP] > 1) {
             $account =& Account::LoadFromDb($_SESSION[SESSION_RESET_ACCT_ID]);
             if ($account) {
                 $answer1 = $_xmlObj->GetParamTagValueByName('answer1');
                 $answer2 = $_xmlObj->GetParamTagValueByName('answer2');
                 if ((string) $account->Answer1 === (string) $answer1 && (string) $account->Answer2 === (string) $answer2) {
                     $_SESSION[SESSION_RESET_STEP] = 3;
                     $_resetNode = new XmlDomNode('reset');
                     $_resetNode->AppendAttribute('step', 3);
                     $_resetNode->AppendChild(new XmlDomNode('email', $account->Email, true));
                     $_resetNode->AppendChild(new XmlDomNode('name', $account->FriendlyName, true));
                     $_xmlRes->XmlRoot->AppendChild($_resetNode);
                     return;
                 } else {
                     CXmlProcessing::PrintErrorAndExit(RegAnswersIncorrect, $_xmlRes);
                 }
             }
         } else {
             if ($step == 3 && isset($_SESSION[SESSION_RESET_ACCT_ID], $_SESSION[SESSION_RESET_STEP]) && $_SESSION[SESSION_RESET_STEP] > 2) {
                 $account =& Account::LoadFromDb($_SESSION[SESSION_RESET_ACCT_ID]);
                 if ($account) {
                     $password1 = $_xmlObj->GetParamTagValueByName('password1');
                     $password2 = $_xmlObj->GetParamTagValueByName('password2');
                     if ((string) $password1 === (string) $password2) {
                         $account->MailIncPassword = $password1;
                         $account->MailOutPassword = $password1;
                         if ($account->UpdatePasswords()) {
                             unset($_SESSION[SESSION_RESET_ACCT_ID], $_SESSION[SESSION_RESET_STEP]);
                             $_resetNode = new XmlDomNode('reset');
                             $_resetNode->AppendAttribute('step', 4);
                             $_xmlRes->XmlRoot->AppendChild($_resetNode);
                             return true;
                         } else {
                             CXmlProcessing::PrintErrorAndExit(PROC_CANT_UPDATE_ACCT, $_xmlRes);
                         }
                     } else {
                         CXmlProcessing::PrintErrorAndExit(WarningPassNotMatch, $_xmlRes);
                     }
                 }
             }
         }
     }
     CXmlProcessing::PrintErrorAndExit(WebMailException, $_xmlRes);
 }
开发者ID:JDevelopers,项目名称:Mail,代码行数:84,代码来源:class_processorswitch.php

示例13: SettingsAccount

    /**
     * @param PageBuilder $pagebuilder
     * @return SettingsAccount
     */
    function SettingsAccount(&$pagebuilder)
    {
        $this->_pagebuilder =& $pagebuilder;
        $this->_proc =& $pagebuilder->_proc;
        $screen = $this->_proc->sArray[SCREEN];
        if ($this->_proc->sArray[EDIT_ACCOUNT_ID] != $this->_proc->account->Id) {
            if (array_key_exists($this->_proc->sArray[EDIT_ACCOUNT_ID], $this->_proc->accounts)) {
                $this->_editAccount =& Account::LoadFromDb($this->_proc->sArray[EDIT_ACCOUNT_ID]);
                $this->_editProccessor =& new MailProcessor($this->_editAccount);
                $this->_editFolders =& $this->_editProccessor->GetFolders();
            } else {
                $this->_editAccount =& $this->_proc->account;
                $this->_editProccessor =& $this->_proc->processor;
                $this->_editFolders =& $this->_proc->GetFolders();
            }
        } else {
            $this->_editAccount =& $this->_proc->account;
            $this->_editProccessor =& $this->_proc->processor;
            $this->_editFolders =& $this->_proc->GetFolders();
        }
        $this->data['allowNewAccount'] = !$this->_proc->settings->AllowUsersAddNewAccounts || !$this->_editAccount->AllowChangeSettings ? '' : '
		<input type="button" value="' . JS_LANG_AddNewAccount . '" 
			onclick="document.location=\'' . BASEFILE . '?' . SCREEN . '=' . SET_ACCOUNT_ADDACC . '\';"
			class="wm_button" ID="Button4" NAME="Button2"/>';
        $this->data['accountsTable'] = '';
        $accounts =& $this->_proc->GetAccounts();
        foreach ($accounts as $keyid => $value) {
            $isCurrent = $keyid == $this->_editAccount->Id;
            $class = $isCurrent ? ' class="wm_settings_list_select"' : ' class="wm_control"';
            $name = $isCurrent ? '<b>' . $value[4] . '</b>' : $value[4];
            //$name .= ($value[6]) ? ' (default)' : '';
            $onclick = $isCurrent ? '' : ' onclick="document.location=\'' . BASEFILE . '?' . EDIT_ACCOUNT_ID . '=' . $keyid . '\';"';
            $deleteHref = $this->_proc->account->IsDemo ? '<a href="#" onclick="return DoAlert();">' . JS_LANG_Delete . '</a>' : '<a href="' . ACTIONFILE . '?action=delete&req=account&acctid=' . $keyid . '" onclick="return confirm(\'' . ConfirmDeleteAccount . '\');">' . JS_LANG_Delete . '</a>';
            $deleteHref = $this->_editAccount->AllowChangeSettings ? $deleteHref : '';
            $this->data['accountsTable'] .= '
					<tr' . $class . '>
						<td' . $onclick . '>' . $name . '</td>
						<td style="width: 10px;">' . $deleteHref . '</td>
					</tr>';
        }
        if ($screen == SET_ACCOUNT_ADDACC && !$this->_proc->settings->AllowUsersAddNewAccounts) {
            $screen = SET_ACCOUNT_PROF;
        }
        $this->_main =& new SettingsAccountForms($screen, $this);
        $this->data['tabSwitcher'] = '';
        if ($screen != SET_ACCOUNT_ADDACC) {
            $this->data['tabSwitcher'] .= '
				<div class="wm_settings_accounts_info">
					<div class="wm_settings_switcher_indent"></div>';
            $this->data['tabSwitcher'] .= $screen == SET_ACCOUNT_MFOLDERS ? '<div class="wm_settings_switcher_select_item">' . JS_LANG_ManageFolders . '</div>' : '<div class="wm_settings_switcher_item"><a href="' . BASEFILE . '?' . SCREEN . '=' . SET_ACCOUNT_MFOLDERS . '">' . JS_LANG_ManageFolders . '</a></div>';
            $this->data['tabSwitcher'] .= $screen == SET_ACCOUNT_SIGNATURE ? '<div class="wm_settings_switcher_select_item">' . JS_LANG_Signature . '</div>' : '<div class="wm_settings_switcher_item"><a href="' . BASEFILE . '?' . SCREEN . '=' . SET_ACCOUNT_SIGNATURE . '">' . JS_LANG_Signature . '</a></div>';
            $this->data['tabSwitcher'] .= $screen == SET_ACCOUNT_FILTERS ? '<div class="wm_settings_switcher_select_item">&nbsp;' . JS_LANG_Filters . '&nbsp;</div>' : '<div class="wm_settings_switcher_item">&nbsp;<a href="' . BASEFILE . '?' . SCREEN . '=' . SET_ACCOUNT_FILTERS . '">' . JS_LANG_Filters . '</a>&nbsp;</div>';
            if ($this->_editAccount->AllowChangeSettings) {
                $this->data['tabSwitcher'] .= $screen == SET_ACCOUNT_PROF ? '<div class="wm_settings_switcher_select_item">' . JS_LANG_Properties . '</div>' : '<div class="wm_settings_switcher_item"><a href="' . BASEFILE . '?' . SCREEN . '=' . SET_ACCOUNT_PROF . '">' . JS_LANG_Properties . '</a></div>';
            }
            $this->data['tabSwitcher'] .= '</div>';
        }
    }
开发者ID:diedsmiling,项目名称:busenika,代码行数:62,代码来源:class_settingspanel.php

示例14: _UserLoginByEmail

 /**
  * @param	string	$email
  * @param	string	$login
  * @param	string	$password = null
  * @return	bool
  */
 protected function _UserLoginByEmail($email, $login, $password = null)
 {
     require_once WM_ROOTPATH . 'common/class_account.php';
     require_once WM_ROOTPATH . 'common/class_dbstorage.php';
     require_once WM_ROOTPATH . 'common/class_mailprocessor.php';
     $newAccount = new Account();
     $settings =& Settings::CreateInstance();
     if (!$settings || !$settings->isLoad) {
         throw new WebMailModelException('settings error');
     }
     if (!$settings->IncludeLang()) {
         throw new WebMailModelException('lang error');
     }
     $loginArray =& Account::LoadFromDbByLogin($email, $login);
     if ($loginArray != null) {
         if ($loginArray[2] == '1') {
             if ($password === null) {
                 @session_write_close();
                 @session_name('PHPWEBMAILSESSID');
                 @session_start();
                 $_SESSION[ACCOUNT_ID] = $loginArray[0];
                 $_SESSION[USER_ID] = $loginArray[3];
                 return true;
             } else {
                 if ($password == ConvertUtils::DecodePassword($loginArray[1], $newAccount)) {
                     @session_write_close();
                     @session_name('PHPWEBMAILSESSID');
                     @session_start();
                     $_SESSION[ACCOUNT_ID] = $loginArray[0];
                     $_SESSION[USER_ID] = $loginArray[3];
                     return true;
                 } else {
                     $account =& Account::LoadFromDb($loginArray[0]);
                     $account->MailIncPassword = $password;
                     $newprocessor = new MailProcessor($account);
                     if ($newprocessor->MailStorage->Connect(true)) {
                         if ($account->Update()) {
                             @session_write_close();
                             @session_name('PHPWEBMAILSESSID');
                             @session_start();
                             $_SESSION[ACCOUNT_ID] = $account->Id;
                             $_SESSION[USER_ID] = $account->IdUser;
                             $_SESSION[SESSION_LANG] = $account->DefaultLanguage;
                             return true;
                         } else {
                             throw new WebMailModelException(getGlobalError());
                         }
                     } else {
                         throw new WebMailModelException(ErrorPOP3IMAP4Auth);
                     }
                 }
             }
         } else {
             throw new WebMailModelException(PROC_CANT_LOG_NONDEF);
         }
     } else {
         throw new WebMailModelException(ErrorPOP3IMAP4Auth);
     }
 }
开发者ID:JDevelopers,项目名称:Mail,代码行数:65,代码来源:webmail_model.php

示例15: DeleteFromDb

 /**
  * @static 
  * @param int $id
  * @return bool
  */
 function DeleteFromDb($id, $deleteDemo = false)
 {
     $account =& Account::LoadFromDb($id);
     if (!$deleteDemo && $account->IsDemo) {
         return true;
     }
     $null = null;
     $dbStorage =& DbStorageCreator::CreateDatabaseStorage($null);
     if ($dbStorage->Connect()) {
         $settings =& Settings::CreateInstance();
         if ($settings->EnableWmServer && $settings->WmAllowManageXMailAccounts) {
             if ($account && $account->MailProtocol == MAILPROTOCOL_WMSERVER) {
                 $WMConsole = new CWmServerConsole();
                 if (!$WMConsole->Connect()) {
                     setGlobalError(PROC_CANT_DEL_ACCT_BY_ID);
                     return false;
                 }
                 $domain = ConvertUtils::ParseEmail($account->Email);
                 if ($domain) {
                     $WMConsole->DeleteUser($domain[1], EmailAddress::GetAccountNameFromEmail($account->MailIncLogin));
                 }
             }
         }
         if ($dbStorage->DeleteAccountData($id)) {
             return true;
         } else {
             setGlobalError(PROC_CANT_DEL_ACCT_BY_ID);
         }
     }
     return false;
 }
开发者ID:diedsmiling,项目名称:busenika,代码行数:36,代码来源:class_account.php


注:本文中的Account::LoadFromDb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。