極める!Security Component (CakePHP Advent Calendar 2010 24日目) 2010-12-24 目次 この記事はCakePHP Advent Calendar 2010 24日目に向けて書きました CakePHP Advent Calendar 2010に参加したい!と思ったときには既に遅し、トリの24日しか空いておらず、トリっぽい記事なんて書けないわーと思っていました。が、主催のcakephperさんより「べつにトリっぽくなくていいですよ」との温かい言葉を頂いたので、前々から書きたかったSecurityコンポーネントの話を書いてみます。対象バージョンは1.3.6 Stableです。 ちなみにAdvent Calendarとはなんぞや?といいますと、cakephperさんの書き込みより以下引用。 技術系の方がやっているAdvent Calenda
トークンが一致しないと SecurityComponent の blackHole メソッドが実行されます。このメソッドでは header('HTTP/1.0 404 Not Found'); を出力して exit します。(画面は空白) 任意の処理を実行したい場合は blackHoleCallback でコールバック関数を指定します。 設定できるのは同じコントローラ内のアクションのみになります。 function beforeFilter() { $this->Security->blackHoleCallback = "securityError"; $this->Security->requireAuth('login'); } function securityError() { die("security error!"); } トークンチェックをするアクションを複数指定するとき
robots.txtとは robots.txtは、検索エンジンのクローラー(bot)に、クロールされたいページや、クロールされたくないページを教えるテキストファイルのことです。多くの検索エンジンのクローラーは、そのドメインの最上位ディレクトリに設置されたrobotst.txtを最初に読み込んで、クロールするべきページとクロールするべきでないページを取得し、それに基づいて巡回します。ただ、一部のクローラーには、このrobots.txtを無視するものもあります。 robots.txtの書き方はおよそ以下の通りです。 User-agent:(ここにbotのユーザーエージェントを記述。ワイルドカード指定も可能) Crawl-Delay:(クロールの時間間隔を指定) Disallow:(クロールされたくないページやディレクトリを指定) Allow:(Disallowで指定されたディレクトリの小階層で
この記事には広告を含む場合があります。 記事内で紹介する商品を購入することで、当サイトに売り上げの一部が還元されることがあります。 MacをWi-Fi(無線LAN)に接続するときに、ほとんどの場合はパスワードを入力するはず。 では、同じWi-FiにiPhoneなどスマートフォンを接続したくなったとき、パスワードを忘れていたらどうしますか? Macにいちど入力したネットワークパスワードは、実は「キーチェーンアクセス」に保存されています。 この記事では、Macに保存されたネットワークパスワードを確認する方法を紹介。 キーチェーンアクセスから、Macに保存したパスワードをさがすアプリケーションフォルダ内、ユーティリティの「キーチェーンアクセス」を選択。 すると、このようなウィンドウが出てきます。 今回はネットワーク(無線LAN)のパスワードを表示させたいので、分類の「パスワード」をクリック。 す
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く