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


PHP Common::getRequestvar方法代码示例

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


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

示例1: processPasswordChange

 /**
  * Gets the NEW password from HTTP request parameter, decrypts it and writes
  * the decrypted value back into _POST request.
  * Note: Writing to _POST directly, as there doesn't seem to be another way,
  *       because the parent function will re-read from request (i.e. _POST).
  *
  * @see the parent class function for parameters and return value
  */
 protected function processPasswordChange($userLogin)
 {
     $password = Common::getRequestvar('password', false);
     CryptoForm::decryptAndWriteToPost('password', $password);
     $passwordBis = Common::getRequestvar('passwordBis', false);
     CryptoForm::decryptAndWriteToPost('passwordBis', $passwordBis);
     // call the original function on the decrypted values
     return parent::processPasswordChange($userLogin);
 }
开发者ID:Joey3000,项目名称:piwik-UsersManagerEncrypted,代码行数:17,代码来源:Controller.php

示例2: processPasswordChange

 private function processPasswordChange($userLogin)
 {
     $alias = Common::getRequestVar('alias');
     $email = Common::getRequestVar('email');
     $newPassword = false;
     $password = Common::getRequestvar('password', false);
     $passwordBis = Common::getRequestvar('passwordBis', false);
     if (!empty($password) || !empty($passwordBis)) {
         if ($password != $passwordBis) {
             throw new Exception($this->translator->translate('Login_PasswordsDoNotMatch'));
         }
         $newPassword = $password;
     }
     // UI disables password change on invalid host, but check here anyway
     if (!Url::isValidHost() && $newPassword !== false) {
         throw new Exception("Cannot change password with untrusted hostname!");
     }
     APIUsersManager::getInstance()->updateUser($userLogin, $newPassword, $email, $alias);
     if ($newPassword !== false) {
         $newPassword = Common::unsanitizeInputValue($newPassword);
     }
     // logs the user in with the new password
     if ($newPassword !== false) {
         $sessionInitializer = new SessionInitializer();
         $auth = StaticContainer::get('Piwik\\Auth');
         $auth->setLogin($userLogin);
         $auth->setPassword($password);
         $sessionInitializer->initSession($auth, $rememberMe = false);
     }
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:30,代码来源:Controller.php

示例3: processPasswordChange

 private function processPasswordChange($userLogin)
 {
     $alias = Common::getRequestVar('alias');
     $email = Common::getRequestVar('email');
     $newPassword = false;
     $password = Common::getRequestvar('password', false);
     $passwordBis = Common::getRequestvar('passwordBis', false);
     if (!empty($password) || !empty($passwordBis)) {
         if ($password != $passwordBis) {
             throw new Exception(Piwik::translate('Login_PasswordsDoNotMatch'));
         }
         $newPassword = $password;
     }
     // UI disables password change on invalid host, but check here anyway
     if (!Url::isValidHost() && $newPassword !== false) {
         throw new Exception("Cannot change password with untrusted hostname!");
     }
     if (Piwik::isUserIsSuperUser()) {
         $superUser = Config::getInstance()->superuser;
         $updatedSuperUser = false;
         if ($newPassword !== false) {
             $newPassword = Common::unsanitizeInputValue($newPassword);
             $md5PasswordSuperUser = md5($newPassword);
             $superUser['password'] = $md5PasswordSuperUser;
             $updatedSuperUser = true;
         }
         if ($superUser['email'] != $email) {
             $superUser['email'] = $email;
             $updatedSuperUser = true;
         }
         if ($updatedSuperUser) {
             Config::getInstance()->superuser = $superUser;
             Config::getInstance()->forceSave();
         }
     } else {
         APIUsersManager::getInstance()->updateUser($userLogin, $newPassword, $email, $alias);
         if ($newPassword !== false) {
             $newPassword = Common::unsanitizeInputValue($newPassword);
         }
     }
     // logs the user in with the new password
     if ($newPassword !== false) {
         \Piwik\Registry::get('auth')->initSession($userLogin, md5($newPassword), $rememberMe = false);
     }
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:45,代码来源:Controller.php


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