Added resources folder (Code refactoring)
|
|
@ -528,6 +528,11 @@ class Http
|
|||
public function SaveUrlToFile($sUrl, $rFile, $sCustomUserAgent = 'MailSo Http User Agent (v1)', &$sContentType = '', &$iCode = 0,
|
||||
$oLogger = null, $iTimeout = 10, $sProxy = '', $sProxyAuth = '', $aHttpHeaders = array())
|
||||
{
|
||||
if (null === $sCustomUserAgent)
|
||||
{
|
||||
$sCustomUserAgent = 'MailSo Http User Agent (v1)';
|
||||
}
|
||||
|
||||
if (!is_resource($rFile))
|
||||
{
|
||||
if ($oLogger)
|
||||
|
|
|
|||
|
|
@ -5478,22 +5478,6 @@ class Actions
|
|||
return $this->DefaultResponse(__FUNCTION__, $aResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function DoServicesPics()
|
||||
{
|
||||
$aData = \RainLoop\Utils::ServicesPics();
|
||||
$aResult = array();
|
||||
|
||||
foreach ($aData as $sDomain => $sPic)
|
||||
{
|
||||
$aResult[$sDomain] = APP_WEB_STATIC_PATH.'services/'.$sPic;
|
||||
}
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__, $aResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
@ -6492,6 +6476,60 @@ class Actions
|
|||
{
|
||||
return $this->rawSmart(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function RawAvatar()
|
||||
{
|
||||
$sData = '';
|
||||
|
||||
$sRawKey = (string) $this->GetActionParam('RawKey', '');
|
||||
$sRawKey = \urldecode($sRawKey);
|
||||
|
||||
$this->verifyCacheByKey($sRawKey);
|
||||
|
||||
if (0 < \strlen($sRawKey) && \preg_match('/^[^@]+@([^@]+)$/', $sRawKey))
|
||||
{
|
||||
$sEmail = \MailSo\Base\Utils::IdnToAscii($sRawKey, true);
|
||||
|
||||
$iCode = 0;
|
||||
$sContentType = '';
|
||||
|
||||
$sData = $this->Http()->GetUrlAsString('http://gravatar.com/avatar/'.\md5($sEmail).'.jpg?s=80&d=404',
|
||||
null, $sContentType, $iCode, $this->Logger(), 5,
|
||||
$this->Config()->Get('labs', 'curl_proxy', ''), $this->Config()->Get('labs', 'curl_proxy_auth', ''));
|
||||
|
||||
$sContentType = \strtolower(\trim($sContentType));
|
||||
if (200 !== $iCode || empty($sData) ||
|
||||
!\in_array($sContentType, array('image/jpeg', 'image/jpg', 'image/png')))
|
||||
{
|
||||
$sData = '';
|
||||
|
||||
$aMatch = array();
|
||||
if (\preg_match('/^[^@]+@([a-z0-9\-\.]+)$/', $sEmail, $aMatch) && !empty($aMatch[1]))
|
||||
{
|
||||
$sDomain = $aMatch[1];
|
||||
if (\file_exists(APP_VERSION_ROOT_PATH.'app/resources/images/services/'.$sDomain.'.png'))
|
||||
{
|
||||
$sContentType = 'image/png';
|
||||
$sData = \file_get_contents(APP_VERSION_ROOT_PATH.'app/resources/images/services/'.$sDomain.'.png');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($sData) || empty($sContentType))
|
||||
{
|
||||
$sContentType = 'image/png';
|
||||
$sData = \file_get_contents(APP_VERSION_ROOT_PATH.'app/resources/images/empty-contact.png');
|
||||
}
|
||||
|
||||
$this->cacheByKey($sRawKey);
|
||||
\header('Content-Type: '.$sContentType);
|
||||
echo $sData;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
|
|
|
|||
|
|
@ -305,66 +305,6 @@ class Utils
|
|||
@\setcookie($sName, '', \time() - 3600 * 24 * 30, '/');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function ServicesPics()
|
||||
{
|
||||
return array(
|
||||
'ebay.com' => 'ebay.jpg',
|
||||
'reply.ebay.com' => 'ebay.jpg',
|
||||
'reply1.ebay.com' => 'ebay.jpg',
|
||||
'reply2.ebay.com' => 'ebay.jpg',
|
||||
'reply3.ebay.com' => 'ebay.jpg',
|
||||
|
||||
'facebook.com' => 'facebook.png',
|
||||
'facebookmail.com' => 'facebook.png',
|
||||
|
||||
'cnet.online.com' => 'cnet.jpg',
|
||||
'github.com' => 'github.png',
|
||||
'steampowered.com' => 'steam.png',
|
||||
'myspace.com' => 'myspace.png',
|
||||
'new.myspace.com' => 'myspace.png',
|
||||
'youtube.com' => 'youtube.gif',
|
||||
'amazon.com' => 'amazon.png',
|
||||
'ted.com' => 'ted.png',
|
||||
'google.com' => 'google.png',
|
||||
'plus.google.com' => 'google-plus.png',
|
||||
|
||||
'email.microsoft.com' => 'microsoft.jpg',
|
||||
'microsoftonline.com' => 'microsoft.jpg',
|
||||
'microsoft.com' => 'microsoft.jpg',
|
||||
|
||||
'paypal.com' => 'paypal.jpg',
|
||||
'intl.paypal.com' => 'paypal.jpg',
|
||||
'e.paypal.com' => 'paypal.jpg',
|
||||
|
||||
'ea.com' => 'ea.png',
|
||||
'em.ea.com' => 'ea.png',
|
||||
'battlefieldheroes.com' => 'ea.png',
|
||||
|
||||
'battle.net' => 'battle.net.png',
|
||||
'blizzard.com' => 'battle.net.png',
|
||||
'email.blizzard.com' => 'battle.net.png',
|
||||
'battlefieldheroes.com' => 'battle.net.png',
|
||||
|
||||
'twitter.com' => 'twitter.jpg',
|
||||
'postmaster.twitter.com' => 'twitter.jpg',
|
||||
|
||||
'skype.com' => 'skype.png',
|
||||
'email.skype.com' => 'skype.png',
|
||||
|
||||
'apple.com' => 'apple.jpg',
|
||||
'id.apple.com' => 'apple.jpg',
|
||||
|
||||
'onlive.com' => 'onlive.png',
|
||||
'news.onlive.com' => 'onlive.png',
|
||||
|
||||
'asana.com' => 'asana.png',
|
||||
'connect.asana.com' => 'asana.png',
|
||||
);
|
||||
}
|
||||
|
||||
public static function CustomBaseConvert($sNumberInput, $sFromBaseInput = '0123456789', $sToBaseInput = '0123456789')
|
||||
{
|
||||
if ($sFromBaseInput === $sToBaseInput)
|
||||
|
|
|
|||
BIN
rainloop/v/0.0.0/app/resources/images/empty-contact.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/amazon.com.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/apple.com.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/asana.com.png
Normal file
|
After Width: | Height: | Size: 995 B |
BIN
rainloop/v/0.0.0/app/resources/images/services/battle.net.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/blizzard.com.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 995 B |
BIN
rainloop/v/0.0.0/app/resources/images/services/e.paypal.com.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/ea.com.png
Normal file
|
After Width: | Height: | Size: 6 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/ebay.com.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/em.ea.com.png
Normal file
|
After Width: | Height: | Size: 6 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/facebook.com.png
Normal file
|
After Width: | Height: | Size: 9.9 KiB |
|
After Width: | Height: | Size: 9.9 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/github.com.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/google.com.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/id.apple.com.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/microsoft.com.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/myspace.com.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/onlive.com.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/paypal.com.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/skype.com.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/ted.com.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/twitter.com.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
rainloop/v/0.0.0/app/resources/images/services/youtube.com.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |