本文整理汇总了PHP中Tinebase_Helper类的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Helper类的具体用法?PHP Tinebase_Helper怎么用?PHP Tinebase_Helper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tinebase_Helper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* the constructor
*
* creates instance of Expressomail_Backend_Imap with parameters
* Supported parameters are
* - user username
* - host hostname or ip address of IMAP server [optional, default = 'localhost']
* - password password for user 'username' [optional, default = '']
* - port port for IMAP server [optional, default = 110]
* - ssl 'SSL' or 'TLS' for secure sockets
* - folder select this folder [optional, default = 'INBOX']
*
* @param array $params mail reader specific parameters
* @throws Expressomail_Exception_IMAPInvalidCredentials
* @return void
*/
public function __construct($params, $_readOnly = FALSE)
{
if (is_array($params)) {
$params = (object) $params;
}
if (!isset($params->user)) {
throw new Expressomail_Exception_IMAPInvalidCredentials('Need at least user in params.');
}
$params->host = isset($params->host) ? $params->host : 'localhost';
$params->password = isset($params->password) ? $params->password : '';
$params->port = isset($params->port) ? $params->port : null;
$params->ssl = isset($params->ssl) ? $params->ssl : false;
$this->_params = $params;
$expressomailConfig = Expressomail_Config::getInstance();
$imapBackendConfigDefinition = $expressomailConfig->getDefinition(Expressomail_Config::IMAPBACKEND);
$backendClassName = self::$_availableBackends[$imapBackendConfigDefinition['default']];
$expressomailSettings = $expressomailConfig->get(Expressomail_Config::EXPRESSOMAIL_SETTINGS);
$backendName = isset($expressomailSettings[Expressomail_Config::IMAPBACKEND]) ? $expressomailSettings[Expressomail_Config::IMAPBACKEND] : $imapBackendConfigDefinition['default'];
if ($backendName != $imapBackendConfigDefinition['default']) {
if (Tinebase_Helper::checkClassExistence(self::$_availableBackends[$backendName], true) && Tinebase_Helper::checkSubClassOf(self::$_availableBackends[$backendName], 'Expressomail_Backend_Imap_Interface', true)) {
$backendClassName = self::$_availableBackends[$backendName];
}
}
$this->_backend = new $backendClassName($params, $_readOnly);
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:41,代码来源:ImapProxy.php
示例2: getConfig
public static function getConfig($appName, $modelNames = null)
{
$mappingDriver = new Tinebase_Record_DoctrineMappingDriver();
if (!$modelNames) {
$modelNames = array();
foreach ($mappingDriver->getAllClassNames() as $modelName) {
$modelConfig = $modelName::getConfiguration();
if ($modelConfig->getApplName() == $appName) {
$modelNames[] = $modelName;
}
}
}
$tableNames = array();
foreach ($modelNames as $modelName) {
$modelConfig = $modelName::getConfiguration();
if (!$mappingDriver->isTransient($modelName)) {
throw new Setup_Exception('Model not yet doctrine2 ready');
}
$tableNames[] = SQL_TABLE_PREFIX . Tinebase_Helper::array_value('name', $modelConfig->getTable());
}
$config = Setup::createConfiguration();
$config->setMetadataDriverImpl($mappingDriver);
$config->setFilterSchemaAssetsExpression('/' . implode('|', $tableNames) . '/');
return $config;
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:25,代码来源:SchemaTool.php
示例3: getFilterImap
/**
*
* @return type
*/
public function getFilterImap()
{
$format = "d-M-Y";
// prepare value
$value = (array) $this->_getDateValues($this->_operator, $this->_value);
$timezone = Tinebase_Helper::array_value('timezone', $this->_options);
$timezone = $timezone ? $timezone : Tinebase_Core::getUserTimezone();
foreach ($value as &$date) {
$date = new Tinebase_DateTime($date);
// should be in user timezone
$date->setTimezone(new DateTimeZone($timezone));
}
switch ($this->_operator) {
case 'within':
case 'inweek':
$value[1]->add(new DateInterval('P1D'));
// before is not inclusive, so we have to add a day
$return = "SINCE {$value[0]->format($format)} BEFORE {$value[1]->format($format)}";
break;
case 'before':
$return = "BEFORE {$value[0]->format($format)}";
break;
case 'after':
$return = "SINCE {$value[0]->format($format)}";
break;
case 'equals':
$return = "ON {$value[0]->format($format)}";
}
return $return;
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:34,代码来源:DateTime.php
示例4: validate
public function validate($username, $password)
{
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Options: ' . print_r($this->_options, true));
}
$url = isset($this->_options['url']) ? $this->_options['url'] : 'https://localhost/validate/check';
$adapter = new Zend_Http_Client_Adapter_Socket();
$adapter->setStreamContext($this->_options = array('ssl' => array('verify_peer' => isset($this->_options['ignorePeerName']) ? false : true, 'allow_self_signed' => isset($this->_options['allowSelfSigned']) ? true : false)));
$client = new Zend_Http_Client($url, array('maxredirects' => 0, 'timeout' => 30));
$client->setAdapter($adapter);
$params = array('user' => $username, 'pass' => $password);
$client->setParameterPost($params);
try {
$response = $client->request(Zend_Http_Client::POST);
} catch (Zend_Http_Client_Adapter_Exception $zhcae) {
Tinebase_Exception::log($zhcae);
return Tinebase_Auth::FAILURE;
}
$body = $response->getBody();
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Request: ' . $client->getLastRequest());
}
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Response: ' . $body);
}
if ($response->getStatus() !== 200) {
return Tinebase_Auth::FAILURE;
}
$result = Tinebase_Helper::jsonDecode($body);
if (isset($result['result']) && $result['result']['status'] === true && $result['result']['value'] === true) {
return Tinebase_Auth::SUCCESS;
} else {
return Tinebase_Auth::FAILURE;
}
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:35,代码来源:PrivacyIdea.php
示例5: factory
/**
* factory function to return a selected account/imap backend class
*
* @param string|Expressomail_Model_Account $_accountId
* @return Expressomail_Backend_Sieve
*/
public static function factory($_accountId)
{
$accountId = $_accountId instanceof Expressomail_Model_Account ? $_accountId->getId() : $_accountId;
if (!isset(self::$_backends[$accountId])) {
$account = $_accountId instanceof Expressomail_Model_Account ? $_accountId : Expressomail_Controller_Account::getInstance()->get($accountId);
// get imap config from account to connect with sieve server
$sieveConfig = $account->getSieveConfig();
// we need to instantiate a new sieve backend
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Connecting to server ' . $sieveConfig['host'] . ':' . $sieveConfig['port'] . ' (secure: ' . (array_key_exists('ssl', $sieveConfig) && $sieveConfig['ssl'] !== FALSE ? $sieveConfig['ssl'] : 'none') . ') with user ' . $sieveConfig['username']);
}
$expressomailConfig = Expressomail_Config::getInstance();
$sieveBackendDefinition = $expressomailConfig->getDefinition(Expressomail_Config::SIEVEBACKEND);
$backendClassName = self::$_availableBackends[$sieveBackendDefinition['default']];
$expressomailSettings = $expressomailConfig->get(Expressomail_Config::EXPRESSOMAIL_SETTINGS);
$backendName = isset($expressomailSettings[Expressomail_Config::SIEVEBACKEND]) ? $expressomailSettings[Expressomail_Config::SIEVEBACKEND] : $sieveBackendDefinition['default'];
if ($sieveBackendName != $sieveBackendDefinition['default']) {
if (Tinebase_Helper::checkClassExistence(self::$_availableBackends[$backendName], true)) {
$backendClassName = self::$_availableBackends[$backendName];
}
}
self::$_backends[$accountId] = new $backendClassName($sieveConfig);
}
return self::$_backends[$accountId];
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:31,代码来源:SieveFactory.php
示例6: testSearchArrayByRegexpKey
/**
* testSearchArrayByRegexpKey
*
* @see 0008782: Endless loop login windows when calling Active Sync Page
*/
public function testSearchArrayByRegexpKey()
{
$server = array('REMOTE_USER' => '1', 'REDIRECT_REMOTE_USER' => '2', 'REDIRECT_REDIRECT_REMOTE_USER' => '3', 'OTHER' => '4');
$remoteUserValues = Tinebase_Helper::searchArrayByRegexpKey('/REMOTE_USER$/', $server);
$this->assertTrue(!empty($remoteUserValues));
$this->assertEquals(3, count($remoteUserValues));
$firstServerValue = array_shift($remoteUserValues);
$this->assertEquals('1', $firstServerValue);
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:14,代码来源:HelperTests.php
示例7: getChildren
/**
* (non-PHPdoc)
* @see Tinebase_WebDav_Collection_AbstractContainerTree::getChildren()
*/
public function getChildren()
{
$children = parent::getChildren();
// do this only for caldav request
if ($this->_useIdAsName && count($this->_getPathParts()) == 2 && Tinebase_Core::getUser()->hasRight('Tasks', Tinebase_Acl_Rights::RUN)) {
$tfwdavct = new Tasks_Frontend_WebDAV('tasks/' . Tinebase_Helper::array_value(1, $this->_getPathParts()), $this->_useIdAsName);
$children = array_merge($children, $tfwdavct->getChildren());
}
return $children;
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:14,代码来源:WebDAV.php
示例8: readVCalBlob
/**
* reads vcal blob and tries to repair some parsing problems that Sabre has
*
* @param string $blob
* @param integer $failcount
* @param integer $spacecount
* @param integer $lastBrokenLineNumber
* @param array $lastLines
* @throws Sabre\VObject\ParseException
* @return Sabre\VObject\Component\VCalendar
*
* @see 0006110: handle iMIP messages from outlook
*
* @todo maybe we can remove this when #7438 is resolved
*/
public static function readVCalBlob($blob, $failcount = 0, $spacecount = 0, $lastBrokenLineNumber = 0, $lastLines = array())
{
// convert to utf-8
$blob = Tinebase_Helper::mbConvertTo($blob);
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' ' . $blob);
}
try {
$vcalendar = \Sabre\VObject\Reader::read($blob);
} catch (Sabre\VObject\ParseException $svpe) {
// NOTE: we try to repair\Sabre\VObject\Reader as it fails to detect followup lines that do not begin with a space or tab
if ($failcount < 10 && preg_match('/Invalid VObject, line ([0-9]+) did not follow the icalendar\\/vcard format/', $svpe->getMessage(), $matches)) {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' ' . $svpe->getMessage() . ' lastBrokenLineNumber: ' . $lastBrokenLineNumber);
}
$brokenLineNumber = $matches[1] - 1 + $spacecount;
if ($lastBrokenLineNumber === $brokenLineNumber) {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Try again: concat this line to previous line.');
}
$lines = $lastLines;
$brokenLineNumber--;
// increase spacecount because one line got removed
$spacecount++;
} else {
$lines = preg_split('/[\\r\\n]*\\n/', $blob);
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Concat next line to this one.');
}
$lastLines = $lines;
// for retry
}
$lines[$brokenLineNumber] .= $lines[$brokenLineNumber + 1];
unset($lines[$brokenLineNumber + 1]);
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' failcount: ' . $failcount . ' brokenLineNumber: ' . $brokenLineNumber . ' spacecount: ' . $spacecount);
}
$vcalendar = self::readVCalBlob(implode("\n", $lines), $failcount + 1, $spacecount, $brokenLineNumber, $lastLines);
} else {
throw $svpe;
}
}
return $vcalendar;
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:59,代码来源:Abstract.php
示例9: testCleanupCache
/**
* testCleanupCache
*/
public function testCleanupCache()
{
$this->_instance->cleanupCache(Zend_Cache::CLEANING_MODE_ALL);
$cache = Tinebase_Core::getCache();
$oldLifetime = $cache->getOption('lifetime');
$cache->setLifetime(1);
$cacheId = Tinebase_Helper::convertCacheId('testCleanupCache');
$cache->save('value', $cacheId);
sleep(3);
// cleanup with CLEANING_MODE_OLD
$this->_instance->cleanupCache();
$cache->setLifetime($oldLifetime);
$this->assertFalse($cache->load($cacheId));
// check for cache files
$config = Tinebase_Core::getConfig();
if ($config->caching && $config->caching->backend == 'File' && $config->caching->path) {
$cacheFile = $this->_lookForCacheFile($config->caching->path);
$this->assertEquals(NULL, $cacheFile, 'found cache file: ' . $cacheFile);
}
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:23,代码来源:ControllerTest.php
示例10: checkRight
/**
* generic check admin rights function
* rules:
* - ADMIN right includes all other rights
* - MANAGE_* right includes VIEW_* right
* - results are cached if caching is active (with cache tag 'rights')
*
* @param string $_right to check
* @param boolean $_throwException [optional]
* @param boolean $_includeTinebaseAdmin [optional]
* @return boolean
* @throws Tinebase_Exception_UnexpectedValue
* @throws Tinebase_Exception_AccessDenied
* @throws Tinebase_Exception
*
* @todo move that to *_Acl_Rights
* @todo include Tinebase admin? atm only the application admin right is checked
* @todo think about moving the caching to Tinebase_Acl_Roles and use only a class cache as it is difficult (and slow?) to invalidate
*/
public function checkRight($_right, $_throwException = TRUE, $_includeTinebaseAdmin = TRUE)
{
if (empty($this->_applicationName)) {
throw new Tinebase_Exception_UnexpectedValue('No application name defined!');
}
if (!is_object(Tinebase_Core::getUser())) {
throw new Tinebase_Exception('No user found for right check!');
}
$right = strtoupper($_right);
$cache = Tinebase_Core::getCache();
$cacheId = Tinebase_Helper::convertCacheId('checkRight' . Tinebase_Core::getUser()->getId() . $right . $this->_applicationName);
$result = $cache->load($cacheId);
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' ' . $cacheId);
}
if (!$result) {
$applicationRightsClass = $this->_applicationName . '_Acl_Rights';
// array with the rights that should be checked, ADMIN is in it per default
$rightsToCheck = $_includeTinebaseAdmin ? array(Tinebase_Acl_Rights::ADMIN) : array();
if (preg_match("/VIEW_([A-Z_]*)/", $right, $matches)) {
// manage right includes view right
$rightsToCheck[] = constant($applicationRightsClass . '::MANAGE_' . $matches[1]);
}
$rightsToCheck[] = constant($applicationRightsClass . '::' . $right);
$result = FALSE;
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' Checking rights: ' . print_r($rightsToCheck, TRUE));
}
foreach ($rightsToCheck as $rightToCheck) {
if (Tinebase_Acl_Roles::getInstance()->hasRight($this->_applicationName, Tinebase_Core::getUser()->getId(), $rightToCheck)) {
$result = TRUE;
break;
}
}
$cache->save($result, $cacheId, array('rights'), 120);
}
if (!$result && $_throwException) {
throw new Tinebase_Exception_AccessDenied("You are not allowed to {$right} in application {$this->_applicationName} !");
}
return $result;
}
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:60,代码来源:Abstract.php
示例11: filterInputForDatabase
/**
* filter input string for database as some databases (looking at you, MySQL) can't cope with some chars
*
* @param string $string
* @return string
*
* @see 0008644: error when sending mail with note (wrong charset)
* @see http://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string/8215387#8215387
* @see http://stackoverflow.com/questions/8491431/remove-4-byte-characters-from-a-utf-8-string
*/
public static function filterInputForDatabase($string)
{
if (self::getDb() instanceof Zend_Db_Adapter_Pdo_Mysql) {
$string = Tinebase_Helper::mbConvertTo($string);
// remove 4 byte utf8
$result = preg_replace('/[\\xF0-\\xF7].../s', '?', $string);
} else {
$result = $string;
}
return $result;
}
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:21,代码来源:Core.php
示例12: setupBuildConstants
/**
* initializes the build constants like buildtype, package information, ...
*/
public static function setupBuildConstants()
{
$config = self::getConfig();
define('TINE20_BUILDTYPE', strtoupper($config->get('buildtype', 'DEVELOPMENT')));
define('TINE20SETUP_CODENAME', Tinebase_Helper::getDevelopmentRevision());
define('TINE20SETUP_PACKAGESTRING', 'none');
define('TINE20SETUP_RELEASETIME', 'none');
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:11,代码来源:Core.php
示例13: _user2Ldap
/**
* convert object with user data to ldap data array
*
* @param Tinebase_Model_FullUser $_user
* @param array $_ldapData the data to be written to ldap
* @param array $_ldapEntry the data currently stored in ldap
*/
protected function _user2Ldap(Tinebase_Model_FullUser $_user, array &$_ldapData, array &$_ldapEntry = array())
{
if ($this instanceof Tinebase_EmailUser_Smtp_Interface) {
if (empty($_user->smtpUser)) {
return;
}
$mailSettings = $_user->smtpUser;
} else {
if (empty($_user->imapUser)) {
return;
}
$mailSettings = $_user->imapUser;
}
foreach ($this->_propertyMapping as $objectProperty => $ldapAttribute) {
$value = empty($mailSettings->{$objectProperty}) ? array() : $mailSettings->{$objectProperty};
switch ($objectProperty) {
case 'emailMailQuota':
// convert to bytes
$_ldapData[$ldapAttribute] = !empty($mailSettings->{$objectProperty}) ? Tinebase_Helper::convertToBytes($mailSettings->{$objectProperty} . 'M') : array();
break;
case 'emailUID':
$_ldapData[$ldapAttribute] = $this->_appendDomain($_user->accountLoginName);
break;
case 'emailGID':
$_ldapData[$ldapAttribute] = $this->_config['emailGID'];
break;
case 'emailForwardOnly':
$_ldapData[$ldapAttribute] = $mailSettings->{$objectProperty} == true ? 'forwardonly' : array();
break;
case 'emailAddress':
$_ldapData[$ldapAttribute] = $_user->accountEmailAddress;
break;
default:
$_ldapData[$ldapAttribute] = $mailSettings->{$objectProperty};
break;
}
}
if ((isset($this->_propertyMapping['emailForwards']) || array_key_exists('emailForwards', $this->_propertyMapping)) && empty($_ldapData[$this->_propertyMapping['emailForwards']])) {
$_ldapData[$this->_propertyMapping['emailForwardOnly']] = array();
}
// check if user has all required object classes. This is needed
// when updating users which where created using different requirements
foreach ($this->_requiredObjectClass as $className) {
if (!in_array($className, $_ldapData['objectclass'])) {
// merge all required classes at once
$_ldapData['objectclass'] = array_unique(array_merge($_ldapData['objectclass'], $this->_requiredObjectClass));
break;
}
}
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:57,代码来源:Ldap.php
示例14: testGetAllFoldersWithContainerSyncFilter
/**
* calendar has different grant handling
* @see 0007450: shared calendars of other users (iOS)
*/
public function testGetAllFoldersWithContainerSyncFilter()
{
$device = $this->_getDevice(Syncroton_Model_Device::TYPE_IPHONE);
$controller = Syncroton_Data_Factory::factory($this->_class, $device, new Tinebase_DateTime(null, null, 'de_DE'));
$folderA = $this->testCreateFolder();
// personal of test user
$sclever = Tinebase_Helper::array_value('sclever', Zend_Registry::get('personas'));
$folderB = Tinebase_Core::getPreference('Calendar')->getValueForUser(Calendar_Preference::DEFAULTCALENDAR, $sclever->getId());
// have syncGerant for sclever
Tinebase_Container::getInstance()->setGrants($folderB, new Tinebase_Record_RecordSet('Tinebase_Model_Grants', array(array('account_id' => $sclever->getId(), 'account_type' => 'user', Tinebase_Model_Grants::GRANT_ADMIN => true), array('account_id' => Tinebase_Core::getUser()->getId(), 'account_type' => 'user', Tinebase_Model_Grants::GRANT_READ => true, Tinebase_Model_Grants::GRANT_SYNC => true))), TRUE);
$syncFilter = new Calendar_Model_EventFilter(array(array('field' => 'container_id', 'operator' => 'in', 'value' => array($folderA->serverId, $folderB))));
$syncFavorite = Tinebase_PersistentFilter::getInstance()->create(new Tinebase_Model_PersistentFilter(array('application_id' => Tinebase_Application::getInstance()->getApplicationByName('Calendar')->getId(), 'account_id' => Tinebase_Core::getUser()->getId(), 'model' => 'Calendar_Model_EventFilter', 'filters' => $syncFilter, 'name' => 'testSyncFilter', 'description' => 'test two folders')));
$device->calendarfilterId = $syncFavorite->getId();
$allSyncrotonFolders = $controller->getAllFolders();
$defaultFolderId = Tinebase_Core::getPreference('Calendar')->{Calendar_Preference::DEFAULTCALENDAR};
foreach ($allSyncrotonFolders as $syncrotonFolder) {
$this->assertTrue($syncrotonFolder->serverId == $defaultFolderId ? $syncrotonFolder->type === Syncroton_Command_FolderSync::FOLDERTYPE_CALENDAR : $syncrotonFolder->type === Syncroton_Command_FolderSync::FOLDERTYPE_CALENDAR_USER_CREATED);
}
$this->assertEquals(2, count($allSyncrotonFolders));
$this->assertArrayHasKey($folderA->serverId, $allSyncrotonFolders);
$this->assertArrayHasKey($folderB, $allSyncrotonFolders);
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:26,代码来源:ActiveSyncTest.php
示例15: _getApplicationName
/**
* return application name
*
* @return string
*/
protected function _getApplicationName()
{
if (!$this->_applicationName) {
$this->_applicationName = Tinebase_Helper::array_value(0, explode('_', get_class($this)));
}
return $this->_applicationName;
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:12,代码来源:AbstractContainerTree.php
示例16: _getMaxAttachmentSize
/**
* get max attachment size for outgoing mails
*
* - currently it is set to memory_limit / 10
* - returns size in Bytes
*
* @return integer
*/
protected function _getMaxAttachmentSize()
{
$configuredMemoryLimit = ini_get('memory_limit');
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' memory_limit = ' . $configuredMemoryLimit);
}
if ($configuredMemoryLimit === FALSE or $configuredMemoryLimit == -1) {
// set to a big default value
$configuredMemoryLimit = '512M';
}
return Tinebase_Helper::convertToBytes($configuredMemoryLimit) / 10;
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:20,代码来源:Send.php
示例17: _generateUserWithSchema3
/**
* schema 3 = 1-x chars of firstname . lastname
*
* @param Tinebase_Model_FullUser $_account
* @return string
*/
protected function _generateUserWithSchema3($_account)
{
$result = $_account->accountLastName;
for ($i = 0; $i < strlen($_account->accountFirstName); $i++) {
$userName = strtolower(substr(Tinebase_Helper::replaceSpecialChars($_account->accountFirstName), 0, $i + 1) . '.' . Tinebase_Helper::replaceSpecialChars($_account->accountLastName));
if (!$this->nameExists('accountLoginName', $userName)) {
$result = $userName;
break;
}
}
return $result;
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:18,代码来源:Abstract.php
示例18: _prepareParameter
/**
* returns function parameter as object, decode Json if needed
*
* Prepare function input to be an array. Input maybe already an array or (empty) text.
* Starting PHP 7 Zend_Json::decode can't handle empty strings.
*
* @param mixed $_dataAsArrayOrJson
* @return array
*/
protected function _prepareParameter($_dataAsArrayOrJson)
{
return Tinebase_Helper::jsonDecode($_dataAsArrayOrJson);
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:13,代码来源:Abstract.php
示例19: getWeekStart
/**
* returns weekstart in iCal day format
*
* @param string $locale
* @return string
*/
public static function getWeekStart($locale = NULL)
{
$locale = $locale ?: Tinebase_Core::getLocale();
$weekInfo = Zend_Locale::getTranslationList('week', $locale);
if (!isset($weekInfo['firstDay'])) {
$weekInfo['firstDay'] = 'mon';
}
return Tinebase_Helper::array_value($weekInfo['firstDay'], array_flip(self::$WEEKDAY_MAP));
}
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:15,代码来源:Rrule.php
示例20: testSetGrantsCacheInvalidation
/**
* cache invalidation needs a second
*/
public function testSetGrantsCacheInvalidation()
{
$container = $this->objects['initialContainer'];
$sclever = Tinebase_Helper::array_value('sclever', Zend_Registry::get('personas'));
$this->assertEquals(FALSE, $this->_instance->hasGrant($sclever->getId(), $container->getId(), Tinebase_Model_Grants::GRANT_READ), 'sclever should _not_ have a read grant');
// have readGrant for sclever
$this->_instance->setGrants($container->getId(), new Tinebase_Record_RecordSet('Tinebase_Model_Grants', array(array('account_id' => Tinebase_Core::getUser()->getId(), 'account_type' => 'user', Tinebase_Model_Grants::GRANT_ADMIN => true), array('account_id' => $sclever->getId(), 'account_type' => 'user', Tinebase_Model_Grants::GRANT_READ => true))), TRUE);
sleep(1);
$this->assertEquals(TRUE, $this->_instance->hasGrant($sclever->getId(), $container->getId(), Tinebase_Model_Grants::GRANT_READ), 'sclever _should have_ a read grant');
// remove readGrant for sclever again
$this->_instance->setGrants($container->getId(), new Tinebase_Record_RecordSet('Tinebase_Model_Grants', array(array('account_id' => Tinebase_Core::getUser()->getId(), 'account_type' => 'user', Tinebase_Model_Grants::GRANT_ADMIN => true), array('account_id' => $sclever->getId(), 'account_type' => 'user', Tinebase_Model_Grants::GRANT_READ => false))), TRUE);
sleep(1);
$this->assertEquals(FALSE, $this->_instance->hasGrant($sclever->getId(), $container->getId(), Tinebase_Model_Grants::GRANT_READ), 'sclever should _not_ have a read grant');
}
开发者ID:bitExpert,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:17,代码来源:ContainerTest.php
注:本文中的Tinebase_Helper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论