当前位置: 首页>>代码示例>>PHP>>正文


PHP Piwik::getRandomTitle方法代码示例

本文整理汇总了PHP中Piwik::getRandomTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::getRandomTitle方法的具体用法?PHP Piwik::getRandomTitle怎么用?PHP Piwik::getRandomTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik的用法示例。


在下文中一共展示了Piwik::getRandomTitle方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: configureView

 /**
  * Configure common view properties
  *
  * @param Piwik_View $view
  */
 private function configureView($view)
 {
     $this->setBasicVariablesView($view);
     $view->linkTitle = Piwik::getRandomTitle();
     $view->forceSslLogin = Piwik_Config::getInstance()->General['force_ssl_login'];
     // crsf token: don't trust the submitted value; generate/fetch it from session data
     $view->nonce = Piwik_Nonce::getNonce('Piwik_Login.login');
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:13,代码来源:Controller.php

示例2: configureView

 /**
  * Configure common view properties
  *
  * @param Piwik_View $view
  */
 private function configureView($view)
 {
     $view->linkTitle = Piwik::getRandomTitle();
     $view->enableFrames = Zend_Registry::get('config')->General->enable_framed_logins;
     if (!$view->enableFrames) {
         $view->setXFrameOptions('sameorigin');
     }
     $view->forceSslLogin = Zend_Registry::get('config')->General->force_ssl_login;
     // crsf token: don't trust the submitted value; generate/fetch it from session data
     $view->nonce = Piwik_Nonce::getNonce('Piwik_Login.login');
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:16,代码来源:Controller.php

示例3: getJavascriptCode

 /**
  * Returns the Javascript code to be inserted on every page to track
  *
  * @param int $idSite
  * @param string $piwikUrl http://path/to/piwik/directory/ 
  * @param string $actionName
  * @return string
  */
 public static function getJavascriptCode($idSite, $piwikUrl, $actionName = "''")
 {
     $jsTag = file_get_contents(PIWIK_INCLUDE_PATH . "/core/Tracker/javascriptTag.tpl");
     $jsTag = nl2br(htmlentities($jsTag));
     $piwikUrl = preg_match('~^(http|https)://(.*)$~', $piwikUrl, $matches);
     $piwikUrl = $matches[2];
     $jsTag = str_replace('{$actionName}', $actionName, $jsTag);
     $jsTag = str_replace('{$idSite}', $idSite, $jsTag);
     $jsTag = str_replace('{$piwikUrl}', $piwikUrl, $jsTag);
     $jsTag = str_replace('{$hrefTitle}', Piwik::getRandomTitle(), $jsTag);
     return $jsTag;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:20,代码来源:Piwik.php

示例4: getJavascriptCode

 /**
  * Returns the Javascript code to be inserted on every page to track
  *
  * @param int $idSite
  * @param string $piwikUrl http://path/to/piwik/directory/
  * @return string
  */
 public static function getJavascriptCode($idSite, $piwikUrl)
 {
     $jsCode = file_get_contents(PIWIK_INCLUDE_PATH . "/core/Tracker/javascriptCode.tpl");
     $jsCode = nl2br(htmlentities($jsCode));
     $piwikUrl = preg_match('~^(http|https)://(.*)$~D', $piwikUrl, $matches);
     $piwikUrl = @$matches[2];
     $jsCode = str_replace('{$idSite}', $idSite, $jsCode);
     $jsCode = str_replace('{$piwikUrl}', Piwik_Common::sanitizeInputValue($piwikUrl), $jsCode);
     $jsCode = str_replace('{$hrefTitle}', Piwik::getRandomTitle(), $jsCode);
     return $jsCode;
 }
开发者ID:neolf,项目名称:PIWIK4MOBILE,代码行数:18,代码来源:Piwik.php

示例5: resetPasswordFormValidated

 /**
  * Validate password reset request.  If successful, set new password and redirect.
  *
  * @param string $loginMail (user name or email address)
  * @param string $token (password reset token)
  * @param array of string $newPassword (new password)
  * @param string $urlToRedirect (URL to redirect to, if successfully validated)
  * @return string (failure message)
  */
 protected function resetPasswordFormValidated($loginMail, $token, $password, $urlToRedirect)
 {
     $user = self::getUserInformation($loginMail);
     if ($user === null) {
         return Piwik_Translate('Login_InvalidUsernameEmail');
     }
     if (!self::isValidToken($token, $user)) {
         return Piwik_Translate('Login_InvalidOrExpiredToken');
     }
     try {
         if ($user['email'] == Zend_Registry::get('config')->superuser->email) {
             $user['password'] = md5($password);
             Zend_Registry::get('config')->superuser = $user;
         } else {
             Piwik_UsersManager_API::getInstance()->updateUser($user['login'], $password);
         }
     } catch (Exception $e) {
         $view->ErrorString = $e->getMessage();
     }
     $view = Piwik_View::factory('passwordchanged');
     $view->linkTitle = Piwik::getRandomTitle();
     $view->urlToRedirect = $urlToRedirect;
     echo $view->render();
     exit;
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:34,代码来源:Controller.php

示例6: getJavascriptCode

 public static function getJavascriptCode($idSite, $piwikUrl, $actionName = "''")
 {
     $jsTag = file_get_contents("modules/LogStats/javascriptTag.tpl");
     $jsTag = nl2br(htmlentities($jsTag));
     $jsTag = str_replace('{$actionName}', $actionName, $jsTag);
     $jsTag = str_replace('{$idSite}', $idSite, $jsTag);
     $jsTag = str_replace('{$piwikUrl}', $piwikUrl, $jsTag);
     $jsTag = str_replace('{$hrefTitle}', Piwik::getRandomTitle(), $jsTag);
     return $jsTag;
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:10,代码来源:Piwik.php

示例7: lostPasswordFormValidated

 protected function lostPasswordFormValidated($loginMail, $urlToRedirect)
 {
     Piwik::setUserIsSuperUser();
     $user = null;
     $isSuperUser = false;
     if ($loginMail == Zend_Registry::get('config')->superuser->email || $loginMail == Zend_Registry::get('config')->superuser->login) {
         $isSuperUser = true;
         $user = array('login' => Zend_Registry::get('config')->superuser->login, 'email' => Zend_Registry::get('config')->superuser->email);
     } else {
         if (Piwik_UsersManager_API::userExists($loginMail)) {
             $user = Piwik_UsersManager_API::getUser($loginMail);
         } else {
             if (Piwik_UsersManager_API::userEmailExists($loginMail)) {
                 $user = Piwik_UsersManager_API::getUserByEmail($loginMail);
             }
         }
     }
     if ($user === null) {
         $messageNoAccess = Piwik_Translate('Login_InvalidUsernameEmail');
     } else {
         $view = new Piwik_View('Login/templates/passwordsent.tpl');
         $login = $user['login'];
         $email = $user['email'];
         $randomPassword = Piwik_Common::getRandomString(8);
         if ($isSuperUser) {
             $user['password'] = md5($randomPassword);
             Zend_Registry::get('config')->superuser = $user;
         } else {
             Piwik_UsersManager_API::updateUser($login, $randomPassword);
         }
         // send email with new password
         try {
             $mail = new Piwik_Mail();
             $mail->addTo($email, $login);
             $mail->setSubject(Piwik_Translate('Login_MailTopicPasswordRecovery'));
             $mail->setBodyText(str_replace('\\n', "\n", sprintf(Piwik_Translate('Login_MailPasswordRecoveryBody'), $login, $randomPassword, Piwik_Url::getCurrentUrlWithoutQueryString())));
             $piwikHost = $_SERVER['HTTP_HOST'];
             if (strlen($piwikHost) == 0) {
                 $piwikHost = 'piwik.org';
             }
             $fromEmailName = Zend_Registry::get('config')->General->login_password_recovery_email_name;
             $fromEmailAddress = Zend_Registry::get('config')->General->login_password_recovery_email_address;
             $fromEmailAddress = str_replace('{DOMAIN}', $piwikHost, $fromEmailAddress);
             $mail->setFrom($fromEmailAddress, $fromEmailName);
             @$mail->send();
         } catch (Exception $e) {
             $view->ErrorString = $e->getMessage();
         }
         $view->linkTitle = Piwik::getRandomTitle();
         $view->urlToRedirect = $urlToRedirect;
         echo $view->render();
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:53,代码来源:Controller.php


注:本文中的Piwik::getRandomTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。