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


PHP StringHelper::base64_url_decode方法代码示例

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


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

示例1: function

    $user->send_reset_email();
    $app->flash('messages', ['info' => ['Email send with password reset instructions']]);
    $app->redirect('/');
});
//password_resets#edit
$app->get("/password_resets/:reset_digest/edit/:email", SessionsHelper::not_logged_in_user($app), function ($reset_digest, $email) use($app) {
    $user = User::where('email', '=', StringHelper::base64_url_decode($email))->first();
    PasswordResetsHelper::valid_user($app, $user, $reset_digest);
    PasswordResetsHelper::check_expiration($app, $user);
    SessionsHelper::is_activated($app, $user);
    $app->render('password_resets/edit.php', ['reset_digest' => $reset_digest, 'email' => $email]);
});
//password_resets#update
$app->post("/password_resets/:reset_digest", SessionsHelper::not_logged_in_user($app), function ($reset_digest) use($app, $validator) {
    $params = $app->request()->post();
    $user = User::where('email', '=', StringHelper::base64_url_decode($params['email']))->first();
    PasswordResetsHelper::valid_user($app, $user, $reset_digest);
    PasswordResetsHelper::check_expiration($app, $user);
    SessionsHelper::is_activated($app, $user);
    $validation = $validator->make($params, array_merge(User::$password_rules));
    //creating array of errors
    $message_password_confirmation = array();
    if ($params['password'] != $params['password_confirmation']) {
        $message_password_confirmation = ['Password confirmation doesn\'t match'];
    }
    $messages_validation = $validation->messages()->all();
    $messages_all = array_merge($message_password_confirmation, $messages_validation);
    //if there is any validation errors
    if (!empty($messages_all)) {
        $app->flash('messages', ['danger' => $messages_all]);
        $app->redirect('/password_resets/' . $reset_digest . '/edit/' . $params['email']);
开发者ID:mrcoco,项目名称:tinyshop-v2,代码行数:31,代码来源:password_resets_controller.php

示例2: password_verify

 public function password_verify($password)
 {
     return password_verify($password, StringHelper::base64_url_decode($this->password_digest));
 }
开发者ID:mrcoco,项目名称:tinyshop-v2,代码行数:4,代码来源:user.php


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