Uploading and preparing the repository to the dev version.

Original unminified source code (dev folder - js, css, less) (fixes #6)
Grunt build system
Multiple identities correction (fixes #9)
Compose html editor (fixes #12)
New general settings - Loading Description
New warning about default admin password
Split general and login screen settings
This commit is contained in:
RainLoop Team 2013-11-16 02:21:12 +04:00
parent afad45137e
commit 4cc2207513
846 changed files with 99453 additions and 2123 deletions

View file

@ -0,0 +1,60 @@
<?php
namespace MailSo\Net\Enumerations;
/**
* @category MailSo
* @package Net
* @subpackage Enumerations
*/
class ConnectionSecurityType
{
const NONE = 0;
const SSL = 1;
const STARTTLS = 2;
const AUTO_DETECT = 9;
/**
* @param int $iPort
* @param int $iSecurityType
*
* @return bool
*/
public static function UseSSL($iPort, $iSecurityType)
{
$iPort = (int) $iPort;
$iResult = (int) $iSecurityType;
if (self::AUTO_DETECT === $iSecurityType)
{
switch (true)
{
case 993 === $iPort:
case 995 === $iPort:
case 465 === $iPort:
$iResult = self::SSL;
break;
}
}
if (self::SSL === $iResult && !\in_array('ssl', \stream_get_transports()))
{
$iResult = self::NONE;
}
return self::SSL === $iResult;
}
/**
* @param bool $bSupported
* @param int $iSecurityType
* @param bool $bHasSupportedAuth = true
*
* @return bool
*/
public static function UseStartTLS($bSupported, $iSecurityType, $bHasSupportedAuth = true)
{
return ($bSupported &&
(self::STARTTLS === $iSecurityType || (self::AUTO_DETECT === $iSecurityType && !$bHasSupportedAuth)) &&
\defined('STREAM_CRYPTO_METHOD_TLS_CLIENT') && \MailSo\Base\Utils::FunctionExistsAndEnabled('stream_socket_enable_crypto'));
}
}