This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// データベースの接続情報です。 | |
$dsn = 'mysql:dbname=provider;host=localhost'; | |
$username = 'root'; | |
$password = 'password'; | |
// エラーログのレベルを定義します。全てのエラーログを出力しているようにしてます。 | |
ini_set('display_errors',1);error_reporting(E_ALL); | |
// OAuthプロバイダーのライブラリを読み込んでいます。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// データベースの接続情報などを定義している共通処理をrequireします。 | |
require_once __DIR__.'/server.php'; | |
// セッションを開始します。 | |
session_start(); | |
// ユーザー名とパスワードが入力されていたら、ログイン処理を開始します。 | |
if (!empty($_POST["username"]) && !empty($_POST["password"])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// セッションを開始します。 | |
session_start(); | |
// usernameというセッション変数に何もセットされていなかったら、 | |
// すなわち未認証だったら、ログイン画面にリダイレクトします。 | |
if (!isset($_SESSION['username'])) { | |
// ログイン画面にリダイレクトする前に、ログイン後に | |
// 戻る画面の戻り先のURL(つまり本画面のURL)をセッションに格納します。 | |
$_SESSION['back'] = $_SERVER["REQUEST_URI"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// データベースの接続情報などを定義している共通処理をrequireします。 | |
require_once __DIR__.'/server.php'; | |
// アクセストークンを取得するためのリクエストを検証し、正しければ、アクセストークンを発行します。 | |
$server->handleTokenRequest(OAuth2\Request::createFromGlobals())->send(); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// セッションを開始します。 | |
session_start(); | |
// ユーザー名とパスワードが入力されていたら、ログイン処理を開始します。 | |
if (!empty($_POST["username"]) && !empty($_POST["password"])) { | |
$username = $_POST["username"]; | |
$userpassword = $_POST["password"]; | |
// データベースの接続に必要なPDOインスタンスを作成します。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// セッションを開始します。 | |
session_start(); | |
// データベースの接続情報などを定義している共通処理をrequireします。 | |
require_once __DIR__.'/server.php'; | |
// 送付されたアクセストークンが正しいものかどうかを検証します。 | |
// アクセストークンが間違っていたり、有効期限が切れていたりすると、 | |
// ここで処理が終わります。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// セッションを開始します。 | |
session_start(); | |
// usernameというセッション変数に何もセットされていなかったら、 | |
// すなわち未認証だったら、ログイン画面にリダイレクトします。 | |
if (!isset($_SESSION['username'])) { | |
// ログイン画面にリダイレクトする前に、ログイン後に | |
// 戻る画面の戻り先のURL(つまり本画面のURL)をセッションに格納します。 | |
$_SESSION['back'] = $_SERVER["REQUEST_URI"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// セッションを開始します。 | |
session_start(); | |
// usernameというセッション変数に何もセットされていなかったら、 | |
// すなわち未認証だったら、ログイン画面にリダイレクトします。 | |
if (!isset($_SESSION['username'])) { | |
// ログイン画面にリダイレクトする前に、ログイン後に | |
// 戻る画面の戻り先のURL(つまり本画面のURL)をセッションに格納します。 | |
$_SESSION['back'] = $_SERVER["REQUEST_URI"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sios.flow; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.springframework.binding.message.MessageContext; | |
import org.springframework.stereotype.Component; | |
import org.springframework.webflow.action.EventFactorySupport; | |
import org.springframework.webflow.execution.Event; |
OlderNewer