/** * draw * */ public function draw() { require_once dirname(dirname(__FILE__)) . '/vendors/Auth/Kitten.php'; $auth = new Auth_Kitten(); $html = $auth->drawImage(basename($_GET['f'])); print $html; return false; }
public function display() { $libs_dir = dirname(dirname(dirname(__FILE__))); require_once $libs_dir . '/vendors/Auth/Kitten.php'; $kitten = new Auth_Kitten(); $html = $kitten->buildHtml(dirname($_SERVER['SCRIPT_NAME']) . '/authkitten/akImages/draw?f='); echo $html; }
/** * authKitten * * ぬこ認証用のvalidate function */ public function authKitten(&$model, $data) { $libs_dir = dirname(dirname(dirname(__FILE__))); require_once $libs_dir . '/vendors/Auth/Kitten.php'; $kitten = new Auth_Kitten(); $result = $kitten->verify($_POST['kitten']); return $result; }
function auth_kitten_verify($comment) { global $user_ID; // ログイン済みならチェックしない if ($user_ID !== 0) { add_filter('pre_comment_approved', create_function('$a', 'return \'0\';')); return $comment; } require_once dirname(__FILE__) . '/Auth/Kitten.php'; $kitten = new Auth_Kitten(); $result = $kitten->verify($_POST['kitten']); if ($result !== true) { wp_die('子猫認証に失敗しました。', 'Authentication failed', ['response' => 403]); } return $comment; }
<?php /** * auth_kitten viewer.php * */ require_once dirname(__FILE__) . '/Auth/Kitten.php'; $auth = new Auth_Kitten(); $html = $auth->drawImage(basename($_GET['f'])); echo $html;