當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tinebase_Core::getHostname方法代碼示例

本文整理匯總了PHP中Tinebase_Core::getHostname方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tinebase_Core::getHostname方法的具體用法?PHP Tinebase_Core::getHostname怎麽用?PHP Tinebase_Core::getHostname使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tinebase_Core的用法示例。


在下文中一共展示了Tinebase_Core::getHostname方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setFromArray

 /**
  * (non-PHPdoc)
  * @see Tinebase/Record/Tinebase_Record_Abstract#setFromArray($_data)
  */
 public function setFromArray(array $_data)
 {
     parent::setFromArray($_data);
     // always set url here (or is there a better place?)
     if ($this->getId()) {
         $this->url = Tinebase_Core::getHostname() . '/download/show/' . $this->getId();
     }
 }
開發者ID:bitExpert,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:12,代碼來源:DownloadLink.php

示例2: testAccountDeactivationNotification

 /**
  * test send deactivation notification
  * 
  * @see 0009956: send mail on account deactivation
  */
 public function testAccountDeactivationNotification()
 {
     $smtpConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::SMTP);
     if (!isset($smtpConfig->from) && !isset($smtpConfig->primarydomain)) {
         $this->markTestSkipped('no notification service address configured.');
     }
     Tinebase_Config::getInstance()->set(Tinebase_Config::ACCOUNT_DEACTIVATION_NOTIFICATION, true);
     $userArray = $this->testSaveAccount();
     self::flushMailer();
     $this->_json->setAccountState(array($userArray['accountId']), 'disabled');
     $messages = self::getMessages();
     $this->assertEquals(1, count($messages), 'did not get notification message');
     $message = $messages[0];
     $bodyText = $message->getBodyText(true);
     $translate = Tinebase_Translation::getTranslation('Tinebase');
     $this->assertEquals($translate->_('Your Tine 2.0 account has been deactivated'), $message->getSubject());
     // @todo make this work. currently it does not work in de translation as the user name is cropped (tine20phpuni=)
     //$this->assertContains($userArray['accountLoginName'], $bodyText);
     $this->assertContains(Tinebase_Core::getHostname(), $bodyText);
 }
開發者ID:hernot,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:25,代碼來源:JsonTest.php

示例3: sendDeactivationNotification

 /**
  * send deactivation email to user
  * 
  * @param mixed $accountId
  */
 public function sendDeactivationNotification($accountId)
 {
     if (!Tinebase_Config::getInstance()->get(Tinebase_Config::ACCOUNT_DEACTIVATION_NOTIFICATION)) {
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Deactivation notification disabled.');
         }
         return;
     }
     try {
         $user = $this->getFullUserById($accountId);
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Send deactivation notification to user ' . $user->accountLoginName);
         }
         $translate = Tinebase_Translation::getTranslation('Tinebase');
         $view = new Zend_View();
         $view->setScriptPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'views');
         $view->translate = $translate;
         $view->accountLoginName = $user->accountLoginName;
         // TODO add this?
         //$view->deactivationDate     = $user->deactivationDate;
         $view->tine20Url = Tinebase_Core::getHostname();
         $messageBody = $view->render('deactivationNotification.php');
         $messageSubject = $translate->_('Your Tine 2.0 account has been deactivated');
         $recipient = Addressbook_Controller_Contact::getInstance()->getContactByUserId($user->getId(), true);
         Tinebase_Notification::getInstance()->send(null, array($recipient), $messageSubject, $messageBody);
     } catch (Exception $e) {
         Tinebase_Exception::log($e);
     }
 }
開發者ID:hernot,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:34,代碼來源:Sql.php

示例4: testSaveDownloadLinkDirectory

 /**
  * testSaveDownloadLinkDirectory
  *
  * @return array Filemanager_Model_DownloadLink
  */
 public function testSaveDownloadLinkDirectory()
 {
     $downloadLinkData = $this->_getDownloadLinkData();
     $result = $this->_json->saveDownloadLink($downloadLinkData);
     $this->assertTrue(!empty($result['url']));
     $this->assertEquals(Tinebase_Core::getHostname() . '/download/show/' . $result['id'], $result['url']);
     return $result;
 }
開發者ID:hernot,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:13,代碼來源:JsonTests.php

示例5: _convertVevent


//.........這裏部分代碼省略.........
                     // NOTE: we might miss a attachment here for the following reasons
                     //       1. client reuses a managed id (we are server):
                     //          We havn't observerd this yet. iCal client reuse manged id's
                     //          from base events in exceptions but this is covered as we
                     //          initialize new exceptions with base event attachments
                     //
                     //          When a client reuses a managed id it's not clear yet if
                     //          this managed id needs to be in the same series/calendar/server
                     //
                     //          As we use the object hash the managed id might be used in the
                     //          same files with different names. We need to evaluate the name
                     //          (if attached) in this case as well.
                     //
                     //       2. server send his managed id (we are client)
                     //          * we need to download the attachment (here?)
                     //          * we need to have a mapping externalid / internalid (where?)
                     if (!$attachment) {
                         $readFromURL = true;
                         $url = $property->getValue();
                     } else {
                         $attachments->addRecord($attachment);
                     }
                 } elseif ('URI' === $value) {
                     /*
                     * ATTACH;VALUE=URI:https://server.com/calendars/__uids__/0AA0
                      3A3B-F7B6-459A-AB3E-4726E53637D0/dropbox/4971F93F-8657-412B-841A-A0FD913
                      9CD61.dropbox/Canada.png
                     */
                     $url = $property->getValue();
                     $urlParts = parse_url($url);
                     $host = $urlParts['host'];
                     $name = pathinfo($urlParts['path'], PATHINFO_BASENAME);
                     // iCal 10.7 places URI before uploading
                     if (parse_url(Tinebase_Core::getHostname(), PHP_URL_HOST) != $host) {
                         $readFromURL = true;
                     }
                 } else {
                     // @TODO: implement (check if add / update / update is needed)
                     if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) {
                         Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' attachment found that could not be imported due to missing managed id');
                     }
                 }
                 if ($readFromURL) {
                     if (preg_match('#^(https?://)(.*)$#', str_replace(array("\n", "\r"), '', $url), $matches)) {
                         // we are client and found an external hosted attachment that we need to import
                         $userCredentialCache = Tinebase_Core::getUserCredentialCache();
                         $url = $matches[1] . $userCredentialCache->username . ':' . $userCredentialCache->password . '@' . $matches[2];
                         $attachmentInfo = $matches[1] . $matches[2] . ' ' . $name . ' ' . $managedId;
                         if (Tinebase_Helper::urlExists($url)) {
                             if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) {
                                 Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Downloading attachment: ' . $attachmentInfo);
                             }
                             $stream = fopen($url, 'r');
                             $attachment = new Tinebase_Model_Tree_Node(array('name' => rawurldecode($name), 'type' => Tinebase_Model_Tree_Node::TYPE_FILE, 'contenttype' => (string) $property['FMTTYPE'], 'tempFile' => $stream), true);
                             $attachments->addRecord($attachment);
                         } else {
                             if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) {
                                 Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' Url not found (got 404): ' . $attachmentInfo . ' - Skipping attachment');
                             }
                         }
                     } else {
                         if (Tinebase_Core::isLogLevel(Zend_Log::WARN)) {
                             Tinebase_Core::getLogger()->warn(__METHOD__ . '::' . __LINE__ . ' Attachment found with malformed url: ' . $url);
                         }
                     }
                 }
開發者ID:bitExpert,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:67,代碼來源:Abstract.php


注:本文中的Tinebase_Core::getHostname方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。