/** * @return array | false */ function GetDomainArrayForSelect() { if ($this->_connector->Execute($this->_commandCreator->GetDomainArray())) { $domains = array(); $domains[0] = ap_Utils::TakePhrase('CM_NOT_DOMAIN_SELECT_NAME'); while (($row = $this->_connector->GetNextRecord()) != false) { $domains[$row->id_domain] = $row->name; } return $domains; } return false; }
function Validate() { $return = true; if (empty($this->Login)) { $return = ap_Utils::TakePhrase('CM_REQ_FIELDS_CANNOT_BE_EMPTY'); } else { if (empty($this->Password)) { $return = ap_Utils::TakePhrase('CM_REQ_FIELDS_CANNOT_BE_EMPTY'); } else { if (!is_array($this->DomainIds) || count($this->DomainIds) < 1) { $return = ap_Utils::TakePhrase('CM_REQ_FIELDS_CANNOT_BE_EMPTY'); } } } return $return; }
/** * @return bool */ function Connect() { if ($this->_imapMail->connection != false) { return true; } if (!$this->_imapMail->open()) { $this->SetError(ap_Utils::TakePhrase('WM_ERROR_IMAP4_CONNECT')); return false; } else { register_shutdown_function(array(&$this, 'Disconnect')); } if (!$this->_imapMail->login($this->_account->MailIncLogin, $this->_account->MailIncPassword)) { $this->SetError(ap_Utils::TakePhrase('WM_ERROR_POP3IMAP4AUTH')); return false; } return true; }
/** * @return bool */ function Connect() { if ($this->_pop3Mail->socket != false) { return true; } if (!$this->_pop3Mail->connect($this->_account->MailIncHost, $this->_account->MailIncPort)) { /* $this->SetError($this->_pop3Mail->error); */ $this->SetError(ap_Utils::TakePhrase('WM_ERROR_POP3_CONNECT')); return false; } else { register_shutdown_function(array(&$this, 'Disconnect')); } if (!$this->_pop3Mail->login($this->_account->MailIncLogin, $this->_account->MailIncPassword)) { /* $this->SetError($this->_pop3Mail->error); */ $this->SetError(ap_Utils::TakePhrase('WM_ERROR_POP3IMAP4AUTH')); return false; } return true; }
/** * @param string $str */ function SetSearchDesc($text) { if (strlen($text) > 0) { $this->_search = $text; $this->SetNullPhrase(ap_Utils::TakePhrase('AP_LANG_RESULTEMPTY')); } }
?> </head> <body style="background-color: #e5e5e5" onload="var login=document.getElementById('loginId'); if (login) {login.focus();};" > <div align="center" class="wm_content"> <div id="login_screen" class="wm_login"> <form action="<?php echo AP_INDEX_FILE; ?> ?login" method="post"> <div align="center" class="<?php echo $this->ContentClass(); ?> "> <div class="wm_logo" id="logo"></div> <?php echo ap_Utils::TakePhrase('LOGIN_FORM_ERROR_MESS'); ?> <div class="wm_login"> <div class="a top"></div> <div class="b top"></div> <div class="login_table" style="margin: 0px;"> <div class="wm_login_header">Administration Login</div> <div class="wm_login_content"> <table id="login_table" border="0" cellspacing="0" cellpadding="10"> <tr> <td class="wm_title" style="font-size: 12px; width: 70px">Login:</td> <td> <input class="wm_input" size="20" type="text" id="loginId" name="AdmloginInput" style="width: 99%; font-size: 16px;" onfocus="this.style.background = '#FFF9B2';" onblur="this.style.background = 'white';"
<?php /* * AfterLogic Admin Panel by AfterLogic Corp. <*****@*****.**> * * Copyright (C) 2002-2010 AfterLogic Corp. (www.afterlogic.com) * Distributed under the terms of the license described in LICENSE.txt * */ $db =& DbStorageCreator::CreateDatabaseStorage($this->_settings); $prefix = $this->_settings->DbPrefix; if ($db->_settings->DbType != AP_DB_MYSQL && $db->_settings->DbType != AP_DB_MSSQLSERVER) { exit('Warning: Incorrect database type. Tables can be created in MySql or MSSql database only!'); } if (!$db->Connect()) { exit('Connect Error: ' . ap_Utils::TakePhrase('WM_INFO_CONNECTUNSUCCESSFUL') . ' ' . $db->GetError()); } $bodyText = ''; if ($db->AdminAllTableCreate($bodyText)) { $bodyText = nl2br($bodyText); } else { $bodyText = '<font color="red"><b>Warning!</b></font><br />' . nl2br($bodyText); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /> <html> <head> <?php echo AP_META_CONTENT_TYPE; ?> <title>WebMail</title>
/** * @param string $_msg */ function GlobalError($_msg = null) { $_errorDesc = ap_Utils::TakePhrase('AP_LANG_NOT_CONFIGURED'); $_errorDesc .= $_msg !== null ? '<br /><br />' . $_msg : ''; $this->AddCssFile($this->AdminFolder() . '/styles/styles.css'); define('ERROR_TEML_DESC', $_errorDesc); include CAdminPanel::RootPath() . '/templates/error.php'; exit; }
function _initTable(&$_screen) { $_ap =& $_screen->GetAp(); $_apTab = $_ap->Tab(); if ($_apTab == 'admins') { $_screen->SetNullPhrase(ap_Utils::TakePhrase('CM_LANG_NOADMINS')); $_screen->InitTable(); $_screen->ClearHeaders(); $_screen->AddHeader('Login', 60); $_screen->AddHeader('Description', 120, true); $this->_initAdminsData($_screen); } }
function Cal(&$_screen, &$_settings) { $_screen->data->SetValue('defTimeFormat0', $_settings->Cal_DefaultTimeFormat == 1); $_screen->data->SetValue('defTimeFormat1', $_settings->Cal_DefaultTimeFormat == 2); $_timestamp = time(); if ((int) date('m', $_timestamp) == (int) date('d', $_timestamp)) { $_timestamp += 86400; } $_screen->data->SetValue('defDateFormatValue1', date('m/d/Y', $_timestamp)); $_screen->data->SetValue('defDateFormatValue2', date('d/m/Y', $_timestamp)); $_screen->data->SetValue('defDateFormatValue3', date('Y-m-d', $_timestamp)); $_screen->data->SetValue('defDateFormatValue4', date('M d, Y', $_timestamp)); $_screen->data->SetValue('defDateFormatValue5', date('d M Y', $_timestamp)); switch ($_settings->Cal_DefaultDateFormat) { case 1: $_screen->data->SetValue('defDateFormat1', true); break; case 2: $_screen->data->SetValue('defDateFormat2', true); break; case 3: $_screen->data->SetValue('defDateFormat3', true); break; case 4: $_screen->data->SetValue('defDateFormat4', true); break; case 5: $_screen->data->SetValue('defDateFormat5', true); break; } $_screen->data->SetValue('showWeekends', $_settings->Cal_ShowWeekends); $_screen->data->SetValue('showWorkDay', $_settings->Cal_ShowWorkDay); switch ($_settings->Cal_WeekStartsOn) { case 0: $_screen->data->SetValue('weekStartsOn0', true); break; case 1: $_screen->data->SetValue('weekStartsOn1', true); break; } switch ($_settings->Cal_DefaultTab) { case 1: $_screen->data->SetValue('defTab1', true); break; case 2: $_screen->data->SetValue('defTab2', true); break; case 3: $_screen->data->SetValue('defTab3', true); break; } $_country = ''; if (@file_exists($_settings->_path . '/country/country.dat')) { $_countryCode = $_countryName = ''; $_i = 1; $_fp = @fopen($_settings->_path . '/country/country.dat', 'r'); if ($_fp) { while (!feof($_fp)) { $_str = trim(fgets($_fp)); list($_countryCode, $_countryName) = explode('-', $_str); $_country .= '<option value="' . ap_Utils::AttributeQuote($_countryCode) . '"'; if ($_settings->Cal_DefaultCountry == $_countryCode) { $_country .= ' selected="selected"'; } $_country .= '>' . ap_Utils::EncodeSpecialXmlChars($_countryName) . '</option>' . AP_CRLF; $_i++; if ($_i > 300) { break; } } @fclose($_fp); } } $_screen->data->SetValue('Country_dat', $_country); $_screen->data->SetValue('allTimeZones', $_settings->Cal_AllTimeZones); $_screen->data->SetValue('Cal_WorkdayStarts', $_settings->Cal_WorkdayStarts); $_screen->data->SetValue('Cal_WorkdayEnds', $_settings->Cal_WorkdayEnds); $_screen->data->SetValue('Cal_DefaultTimeFormat', $_settings->Cal_DefaultTimeFormat); $_screen->data->SetValue('Cal_DefaultTimeZone', $_settings->Cal_DefaultTimeZone); $_screen->data->SetValue('CheckWorkdayTimeError', ap_Utils::TakePhrase('WM_INFO_CAL_CHECKWORKDAYTIMEERROR')); $_screen->data->SetValue('allowReminder', $_settings->Cal_AllowReminders); }
/** * @param Account $account * @param int $sync[optional] = null * @return bool */ function UpdateAccount($account, $sync = null) { $result = true; if ($this->DbStorage->Connect()) { if ($account->DefaultAccount) { $defaultAccountArray = $this->DbStorage->SelectAccountDataByLogin($account->Email, $account->MailIncLogin, true, $account->Id); if (is_array($defaultAccountArray) && count($defaultAccountArray) > 0) { $this->SetError(ap_Utils::TakePhrase('WM_CANT_ADD_DEF_ACCT')); $result = false; } } if ($result && $account->MailProtocol == WM_MAILPROTOCOL_POP3 && $sync != null) { $folders =& $this->DbStorage->GetFolders($account); if ($folders) { $inboxFolder =& $folders->GetFolderByType(WM_FOLDERTYPE_Inbox); if ($inboxFolder) { $inboxFolder->SyncType = $sync; $result &= $this->DbStorage->UpdateFolder($inboxFolder); } } } if ($result && $account->MailProtocol == WM_MAILPROTOCOL_IMAP4 && $this->_account->_settings->TakeImapQuota) { if ($this->_account->ImapQuota === 1) { $mbl = $this->GetQuota(); if (false !== $mbl && $mbl >= 0) { $account->MailboxLimit = GetGoodBigInt($mbl); } } else { if ($this->_account->ImapQuota === -1 && $this->IsQuotaSupport()) { $this->_account->ImapQuota = 0; } } $result = $this->DbStorage->UpdateAccountImapQuota($account); } if ($result) { $result = $this->DbStorage->UpdateAccountData($account); } if ($result && $account->IsInternal) { $result &= $this->DbStorage->SaveMailAliases($account); $result &= $this->DbStorage->SaveMailForwards($account); } } return $result; }