芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/cloud.pulsehost.co.uk/vendor/afterlogic/dav/lib/DAV/Utils.php
httpRequest->getHeader('user-agent'); if (isset($sUserAgent) && strpos(strtolower($sUserAgent), 'afterlogic ' . strtolower($sClient)) !== false) { $bIsSync = true; } return $bIsSync; } //GetAccountByLogin public static function GetUserByPublicId($sUserName) { $bPrevState = \Aurora\System\Api::skipCheckUserRole(true); $mResult = \Aurora\System\Api::GetModuleDecorator('Core')->GetUserByPublicId($sUserName); \Aurora\System\Api::skipCheckUserRole($bPrevState); return $mResult; } public static function getPrincipalByEmail($sEmail) { $sEmail = trim(str_ireplace("mailto:", "", $sEmail)); $aPrincipalsPath = Backend::Principal()->searchPrincipals( \rtrim(Constants::PRINCIPALS_PREFIX, '/'), array( '{http://sabredav.org/ns}email-address' => $sEmail ) ); if (is_array($aPrincipalsPath) && count($aPrincipalsPath) === 0) { $aPrincipalsPath = Backend::Principal()->searchPrincipals( \rtrim(Constants::PRINCIPALS_PREFIX, '/'), array( '{http://sabredav.org/ns}email-address' => $sEmail ) ); if (is_array($aPrincipalsPath) && count($aPrincipalsPath) === 0) { throw new \Exception("Unknown email address"); } } $aPrincipals = array_filter( $aPrincipalsPath, function ($sPrincipalPath) use ($sEmail) { return ($sPrincipalPath === \Afterlogic\DAV\Constants::PRINCIPALS_PREFIX . $sEmail); } ); if (count($aPrincipals) === 0) { throw new \Exception("Unknown email address"); } return Backend::Principal()->getPrincipalByPath($aPrincipals[0]); } }