本文整理汇总了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']);
示例2: password_verify
public function password_verify($password)
{
return password_verify($password, StringHelper::base64_url_decode($this->password_digest));
}