mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Code refactoring
This commit is contained in:
parent
4a95dd6195
commit
36329110e5
81 changed files with 3474 additions and 2124 deletions
|
|
@ -195,15 +195,63 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
|
||||
try
|
||||
{
|
||||
if ($bUseAuthPlainIfSupported && $this->IsSupported('AUTH=PLAIN'))
|
||||
// TODO
|
||||
if (false && $this->IsSupported('AUTH=CRAM-MD5'))
|
||||
{
|
||||
$this->SendRequest('AUTHENTICATE', array('CRAM-MD5'));
|
||||
|
||||
$aResponse = $this->parseResponseWithValidation();
|
||||
if ($aResponse && \is_array($aResponse) && 0 < \count($aResponse) &&
|
||||
\MailSo\Imap\Enumerations\ResponseType::CONTINUATION === $aResponse[\count($aResponse) - 1]->ResponseType)
|
||||
{
|
||||
$oContinuationResponse = null;
|
||||
foreach ($aResponse as $oResponse)
|
||||
{
|
||||
if ($oResponse && \MailSo\Imap\Enumerations\ResponseType::CONTINUATION === $oResponse->ResponseType)
|
||||
{
|
||||
$oContinuationResponse = $oResponse;
|
||||
}
|
||||
}
|
||||
|
||||
if ($oContinuationResponse)
|
||||
{
|
||||
$sToken = \base64_encode("\0".$sLogin."\0".$sPassword);
|
||||
if ($this->oLogger)
|
||||
{
|
||||
$this->oLogger->AddSecret($sToken);
|
||||
}
|
||||
|
||||
$this->Logger()->WriteDump($aResponse);
|
||||
|
||||
$this->sendRaw($sToken, true, '*******');
|
||||
$this->parseResponseWithValidation();
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ($bUseAuthPlainIfSupported && $this->IsSupported('AUTH=PLAIN'))
|
||||
{
|
||||
$sToken = \base64_encode("\0".$sLogin."\0".$sPassword);
|
||||
if ($this->oLogger)
|
||||
{
|
||||
$this->oLogger->AddSecret(\base64_encode("\0".$sLogin."\0".$sPassword));
|
||||
$this->oLogger->AddSecret($sToken);
|
||||
}
|
||||
|
||||
$this->SendRequestWithCheck('AUTHENTICATE',
|
||||
array('PLAIN', \base64_encode("\0".$sLogin."\0".$sPassword)));
|
||||
if ($this->IsSupported('AUTH=SASL-IR') && false)
|
||||
{
|
||||
$this->SendRequestWithCheck('AUTHENTICATE', array('PLAIN', $sToken));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->SendRequest('AUTHENTICATE', array('PLAIN'));
|
||||
$this->parseResponseWithValidation();
|
||||
|
||||
$this->sendRaw($sToken, true, '*******');
|
||||
$this->parseResponseWithValidation();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -423,8 +423,17 @@ abstract class NetClient
|
|||
$iReadedLen = \strlen($this->sResponseBuffer);
|
||||
if (null === $mReadLen || $bForceLogin)
|
||||
{
|
||||
$this->writeLogWithCrlf('< '.$this->sResponseBuffer, //.' ['.$iReadedLen.']',
|
||||
\MailSo\Log\Enumerations\Type::INFO);
|
||||
$iLimit = 5000; // 5kb
|
||||
if ($iLimit < $iReadedLen)
|
||||
{
|
||||
$this->writeLogWithCrlf('[cutted:'.$iReadedLen.'b] < '.\substr($this->sResponseBuffer.'...', 0, $iLimit),
|
||||
\MailSo\Log\Enumerations\Type::INFO);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->writeLogWithCrlf('< '.$this->sResponseBuffer, //.' ['.$iReadedLen.']',
|
||||
\MailSo\Log\Enumerations\Type::INFO);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
<meta http-equiv="refresh" content="0; URL=./?/BadBrowser" />
|
||||
<![endif]-->
|
||||
<script type="text/javascript" data-cfasync="false">
|
||||
if (!navigator || !navigator.cookieEnabled) {
|
||||
document.location.replace('./?/NoCookie');
|
||||
if (!window.navigator || !window.navigator.cookieEnabled) {
|
||||
window.document.location.replace('./?/NoCookie');
|
||||
}
|
||||
</script>
|
||||
<meta name="Author" content="RainLoop Team" />
|
||||
|
|
@ -26,11 +26,11 @@
|
|||
<link type="text/css" rel="stylesheet" id="rlThemeLink" />
|
||||
<script type="text/javascript" data-cfasync="false" src="{{BaseAppBootScriptLink}}"></script>
|
||||
<script type="text/javascript" data-cfasync="false">
|
||||
__includeScr('{{BaseAppDataScriptLink}}' + (window.__rlah ? window.__rlah() || '0' : '0') + '/' + Math.random().toString().substr(2) + '/');
|
||||
__includeScr('{{BaseAppDataScriptLink}}' + (window.__rlah ? window.__rlah() || '0' : '0') + '/' + window.Math.random().toString().substr(2) + '/');
|
||||
</script>
|
||||
<script type="text/javascript" data-cfasync="false">
|
||||
if (window.rainloopAppData && window.rainloopAppData['NewThemeLink']) {
|
||||
document.getElementById('rlThemeLink').href = window.rainloopAppData['NewThemeLink'];
|
||||
window.document.getElementById('rlThemeLink').href = window.rainloopAppData['NewThemeLink'];
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" data-cfasync="false">
|
||||
var oE = document.getElementById('rl-loading');
|
||||
var oE = window.document.getElementById('rl-loading');
|
||||
if (oE && oE.style) {
|
||||
oE.style.opacity = 0;
|
||||
window.setTimeout(function () {
|
||||
|
|
|
|||
|
|
@ -637,7 +637,7 @@
|
|||
border-radius: 8px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */
|
||||
|
||||
/* =============================================================================
|
||||
|
|
@ -1142,7 +1142,7 @@ table {
|
|||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
|
||||
@charset "UTF-8";
|
||||
|
||||
@font-face {
|
||||
|
|
@ -1513,7 +1513,7 @@ table {
|
|||
.icon-resize-out:before {
|
||||
content: "\e06d";
|
||||
}
|
||||
|
||||
|
||||
/** initial setup **/
|
||||
.nano {
|
||||
/*
|
||||
|
|
@ -1630,7 +1630,7 @@ table {
|
|||
.nano > .pane2:hover > .slider2, .nano > .pane2.active > .slider2 {
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
|
||||
/* Magnific Popup CSS */
|
||||
.mfp-bg {
|
||||
top: 0;
|
||||
|
|
@ -1995,7 +1995,7 @@ img.mfp-img {
|
|||
right: 0;
|
||||
padding-top: 0; }
|
||||
|
||||
|
||||
|
||||
|
||||
/* overlay at start */
|
||||
.mfp-fade.mfp-bg {
|
||||
|
|
@ -2041,7 +2041,7 @@ img.mfp-img {
|
|||
-moz-transform: translateX(50px);
|
||||
transform: translateX(50px);
|
||||
}
|
||||
|
||||
|
||||
.simple-pace {
|
||||
-webkit-pointer-events: none;
|
||||
pointer-events: none;
|
||||
|
|
@ -2112,7 +2112,7 @@ img.mfp-img {
|
|||
@keyframes simple-pace-stripe-animation {
|
||||
0% { transform: none; transform: none; }
|
||||
100% { transform: translate(-32px, 0); transform: translate(-32px, 0); }
|
||||
}
|
||||
}
|
||||
.inputosaurus-container {
|
||||
background-color:#fff;
|
||||
border:1px solid #bcbec0;
|
||||
|
|
@ -2180,7 +2180,7 @@ img.mfp-img {
|
|||
box-shadow:none;
|
||||
}
|
||||
.inputosaurus-input-hidden { display:none; }
|
||||
|
||||
|
||||
.flag-wrapper {
|
||||
width: 24px;
|
||||
height: 16px;
|
||||
|
|
@ -2226,7 +2226,7 @@ img.mfp-img {
|
|||
.flag.flag-pt-br {background-position: -192px -11px}
|
||||
|
||||
.flag.flag-cn, .flag.flag-zh-tw, .flag.flag-zh-cn, .flag.flag-zh-hk {background-position: -208px -22px}
|
||||
|
||||
|
||||
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
.clearfix {
|
||||
*zoom: 1;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
12
rainloop/v/0.0.0/static/js/admin.min.js
vendored
12
rainloop/v/0.0.0/static/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
16
rainloop/v/0.0.0/static/js/app.min.js
vendored
16
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -5,4 +5,4 @@ var JSON;JSON||(JSON={}),function(){function str(a,b){var c,d,e,f,g=gap,h,i=b[a]
|
|||
/*! RainLoop Simple Pace v1.0 (c) 2013 RainLoop Team; Licensed under MIT */
|
||||
!function(e){function s(){var s=this;s.el=null,s.done=!1,s.progress=0,s.addInterval=0,s.addSpeed=3,s.stopProgress=100,s.interval=e.setInterval(function(){var t=s.build();t&&e.clearInterval(s.interval)},100)}if(s.prototype.startAddInterval=function(){var s=this;s.stopAddInterval(),s.addInterval=e.setInterval(function(){0<s.progress&&s.stopProgress>s.progress&&s.add(s.addSpeed)},500)},s.prototype.stopAddInterval=function(){e.clearInterval(this.addInterval),this.addInterval=0},s.prototype.build=function(){if(null===this.el){var e=document.querySelector("body");e&&(this.el=document.createElement("div"),this.el.className="simple-pace simple-pace-active",this.el.innerHTML='<div class="simple-pace-progress"><div class="simple-pace-progress-inner"></div></div><div class="simple-pace-activity"></div>',e.firstChild?e.insertBefore(this.el,e.firstChild):e.appendChild(this.el))}return this.el},s.prototype.reset=function(){return this.progress=0,this.render()},s.prototype.update=function(s){var t=e.parseInt(s,10);return t>this.progress&&(this.progress=t,this.progress=100<this.progress?100:this.progress,this.progress=0>this.progress?0:this.progress),this.render()},s.prototype.add=function(s){return this.progress+=e.parseInt(s,10),this.progress=100<this.progress?100:this.progress,this.progress=0>this.progress?0:this.progress,this.render()},s.prototype.setSpeed=function(e,s){this.addSpeed=e,this.stopProgress=s||100},s.prototype.render=function(){var s=this.build();s&&s.children&&s.children[0]&&s.children[0].setAttribute("style","width:"+this.progress+"%"),100!==this.progress||this.done?100>this.progress&&this.done?(this.done=!1,this.startAddInterval(),s.className=s.className.replace("simple-pace-inactive",""),s.className+=" simple-pace-inactive"):100>this.progress&&!this.done&&0===this.addInterval&&this.startAddInterval():(this.done=!0,this.stopAddInterval(),e.setTimeout(function(){s.className=s.className.replace("simple-pace-active",""),s.className+=" simple-pace-inactive"},500))},!e.SimplePace){var t=new s;e.SimplePace={sleep:function(){t.setSpeed(2,95)},set:function(e){t.update(e)},add:function(e){t.add(e)}}}}(window);
|
||||
/*! RainLoop Index Helper v1.1 (c) 2014 RainLoop Team; Licensed under MIT */
|
||||
!function(t,n){function e(){}e.prototype.s=t.sessionStorage,e.prototype.t=t.top||t,e.prototype.getHash=function(){var t=null;if(this.s)t=this.s.getItem("__rlA")||null;else if(this.t){var e=this.t.name&&n&&"{"===this.t.name.toString().substr(0,1)?n.parse(this.t.name.toString()):null;t=e?e.__rlA||null:null}return t},e.prototype.setHash=function(){var e=t.rainloopAppData,s=null;this.s?this.s.setItem("__rlA",e&&e.AuthAccountHash?e.AuthAccountHash:""):this.t&&n&&(s={},s.__rlA=e&&e.AuthAccountHash?e.AuthAccountHash:"",this.t.name=n.stringify(s))},e.prototype.clearHash=function(){this.s?this.s.setItem("__rlA",""):this.t&&(this.t.name="")},t._rlhh=new e,t.__rlah=function(){return t._rlhh?t._rlhh.getHash():null},t.__rlah_set=function(){t._rlhh&&t._rlhh.setHash()},t.__rlah_clear=function(){t._rlhh&&t._rlhh.clearHash()},t.__includeScr=function(t){document.write(unescape('%3Cscript data-cfasync="false" type="text/javascript" src="'+t+'"%3E%3C/script%3E'))},t.__showError=function(){var n=document.getElementById("rl-loading"),e=document.getElementById("rl-loading-error");n&&(n.style.display="none"),e&&(e.style.display="block"),t.SimplePace&&t.SimplePace.set(100)},t.__simplePace=function(n){t.SimplePace&&t.SimplePace.add(n)},t.__runBoot=function(n){t.__RLBOOT&&!n?t.__RLBOOT(function(t){t||__showError()}):__showError()}}(window,window.JSON);
|
||||
!function(t,n,e){function s(){}s.prototype.s=t.sessionStorage,s.prototype.t=t.top||t,s.prototype.getHash=function(){var t=null;if(this.s)t=this.s.getItem("__rlA")||null;else if(this.t){var n=this.t.name&&e&&"{"===this.t.name.toString().substr(0,1)?e.parse(this.t.name.toString()):null;t=n?n.__rlA||null:null}return t},s.prototype.setHash=function(){var n=t.rainloopAppData,s=null;this.s?this.s.setItem("__rlA",n&&n.AuthAccountHash?n.AuthAccountHash:""):this.t&&e&&(s={},s.__rlA=n&&n.AuthAccountHash?n.AuthAccountHash:"",this.t.name=e.stringify(s))},s.prototype.clearHash=function(){this.s?this.s.setItem("__rlA",""):this.t&&(this.t.name="")},t._rlhh=new s,t.__rlah=function(){return t._rlhh?t._rlhh.getHash():null},t.__rlah_set=function(){t._rlhh&&t._rlhh.setHash()},t.__rlah_clear=function(){t._rlhh&&t._rlhh.clearHash()},t.__includeScr=function(t){n.write(unescape('%3Cscript data-cfasync="false" type="text/javascript" src="'+t+'"%3E%3C/script%3E'))},t.__showError=function(){var e=n.getElementById("rl-loading"),s=n.getElementById("rl-loading-error");e&&(e.style.display="none"),s&&(s.style.display="block"),t.SimplePace&&t.SimplePace.set(100)},t.__simplePace=function(n){t.SimplePace&&t.SimplePace.add(n)},t.__runBoot=function(n){t.__APP_BOOT&&!n?t.__APP_BOOT(function(t){t||__showError()}):__showError()}}(window,window.document,window.JSON);
|
||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue