Changeset 12961
- Timestamp:
- 06/01/08 03:23:11 (5 years ago)
- Location:
- websites/planet.php.gr.jp/trunk
- Files:
-
- 2 added
- 8 modified
-
.ethna (modified) (1 diff)
-
app/Ethna_AuthActionClass.php (modified) (2 diffs)
-
app/action/Login.php (added)
-
etc/delphinus-ini.php.default (modified) (1 diff)
-
log/delphinus.log (modified) (previous)
-
template/phpugjp/login.tpl (added)
-
www/css/ethna.css (modified) (2 diffs)
-
www/info.php (modified) (1 diff)
-
www/unittest.php (modified) (1 diff)
-
www/xmlrpc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
websites/planet.php.gr.jp/trunk/.ethna
r12928 r12961 1 1 [project] 2 ethna_version = 2.3.5 2 3 controller_file = "app/Delphinus_Controller.php" 3 4 controller_class = "Delphinus_Controller" -
websites/planet.php.gr.jp/trunk/app/Ethna_AuthActionClass.php
r12955 r12961 17 17 * @package Anubis 18 18 * 19 * $config = array(20 * 'base_url' => 'http://example.com/index.php',21 * 'author' => 'typekey_username',22 * 'typekey_token' => 'typekey_token',23 * );24 19 */ 25 20 class Ethna_AuthActionClass extends Ethna_ActionClass 26 21 { 27 22 28 /**29 * Typekey Object30 * @var object31 * @access protected32 */33 var $TypeKey;34 35 var $typekey_token;36 var $signin_url;37 var $signout_url;38 39 //{{{ authenticate()40 23 /** 41 24 * authentication … … 44 27 function authenticate() 45 28 { 46 if ($this->session->isStart()) { 47 //session_start(); 48 return null; 29 if (!$this->session->isStart()) { 30 $config = $this->config->get('auth'); 31 if (!isset($config['type'])) { 32 $error_message = 'システム設定が正しく行われていません。認証設定を見直してください。'; 33 $error_message = mb_convert_encoding($error_message, 'UTF-8', 'EUC-JP'); 34 $this->ae->add('config_error', $error_message); 35 return 'error'; 36 } else if ($config['type'] == 'none') { 37 38 // none 39 40 } else { 41 $this->redirect('/login'); 42 } 49 43 } 50 51 $typekey_url = "http://".$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];52 $base_url = $this->config->get('base_url');53 $author = $this->config->get('author');54 55 if ( !is_array($author) ) {56 $author = array($author);57 }58 59 //set typekey token from config60 $this->typekey_token = $this->config->get('typekey_token');61 62 $this->TypeKey = new Auth_TypeKey();63 $this->TypeKey->site_token($this->typekey_token);64 $this->TypeKey->version('1.1');65 66 $this->signin_url = $this->TypeKey->urlSignIn($typekey_url);67 $this->signout_url = $this->TypeKey->urlSignOut($base_url);68 69 $this->af->setApp('signout_url', $this->signout_url);70 44 71 if ( is_null($this->session->get('name')) || 72 !in_array($this->session->get('name'), $author) ) { 73 74 if( $this->authTypeKey($_GET) === TRUE ){ 75 //if( TRUE ){ 76 77 //typekey user not defined allow list 78 //if ( !in_array($_GET['name'], $author) ) { 79 80 // $this->session->destroy(); 81 // Aero_Util::move($this->signout_url, "3"); 82 // //header('Location: ' . $this->signout_url); 83 // exit(); 84 85 //} 86 87 //success 88 $this->session->start(); 89 $this->session->set('name', $_GET['name']); 90 91 return null; 92 93 } else { 45 return parent::authenticate(); 46 } 94 47 95 //$this->session->destroy(); 96 print("fail auth typekey"); 97 Aero_Util::move($this->signout_url, "5"); 98 exit(); 99 100 } 101 } 102 103 return null; 104 48 /** 49 * redirect 50 * 51 * @access public 52 */ 53 function redirect($action = "") 54 { 55 $url = $this->config->get('base_url') . $action; 56 $html = <<<EOD 57 <html> 58 <head> 59 <meta http-equiv="Content-type" content="text/html; charset=EUC-JP"> 60 <meta http-equiv="refresh" CONTENT="0;URL={$url}"> 61 <meta name="robots" content="INDEX,NOFOLLOW"> 62 <title>Redirecting to {$url}</title> 63 </head> 64 <body> 65 <p>if not start redirect, click <a href="{$url}">this link</a></p> 66 </body> 67 </html> 68 EOD; 69 print($html); 70 exit(); 105 71 } 106 //}}}107 108 //{{{ authTypeKey()109 /**110 * authTypeKey111 *112 * $query = array(113 * 'ts' => '',114 * 'email' => '',115 * 'name' => '',116 * 'nick' => '',117 * 'sig' => '',118 * )119 *120 * @access protected121 */122 function authTypeKey($query){123 124 $result = isset($query['ts'])125 && isset($query['email'])126 && isset($query['name'])127 && isset($query['nick'])128 && isset($query['sig']);129 130 if($result){131 132 $result = $this->TypeKey->verifyTypeKey($query);133 134 if (PEAR::isError($result)) {135 136 if($result->getMessage() == 'Timestamp from TypeKey is too old'){137 header('Location: ' . $this->signout_url);138 exit();139 140 }141 142 if($result->getMessage() == 'Invalid signature'){143 Ethna::raiseNotice('TypeKey Invalid signature');144 return true;145 }146 147 Ethna::raiseError($result->getMessage());148 var_dump($result->getMessage());149 return false;150 151 } else {152 153 return true;154 155 }156 157 } else {158 159 //header('Location: ' . $this->signin_url);160 Aero_Util::move($this->signin_url, "0");161 exit();162 163 }164 }165 //}}}166 72 167 73 } -
websites/planet.php.gr.jp/trunk/etc/delphinus-ini.php.default
r12921 r12961 17 17 18 18 //using typekey account by Administration 19 'author' => array('typekey_username'), 20 'typekey_token' => '', 19 'auth' => array( 20 'type' => 'typekey', // typekey or hatena 21 22 //for typekey setting 23 'author' => array('your accountname'), 24 'typekey_url' => 'http://example.com/to/delphinus', 25 'typekey_token' => 'your typekey token', 26 27 //'any' or 'id' or array('id1', 'id2', 'id3') 28 'hatena_id' => array('your hatena id'), 29 'hatena_api_key' => '', 30 'hatena_api_secret' => '', 31 ), 21 32 22 33 //delphinus system setting -
websites/planet.php.gr.jp/trunk/www/css/ethna.css
r12921 r12961 1 1 body { 2 background: url("http://ethna.jp/image/pagebg.gif");3 font-family: Arial,Verdana,Helvetica,'MS UI Gothic',sans-serif;4 margin-left: 40px;5 margin-right: 40px;2 background: url("http://ethna.jp/image/pagebg.gif"); 3 font-family: Arial,Verdana,Helvetica,'MS UI Gothic',sans-serif; 4 margin-left: 40px; 5 margin-right: 40px; 6 6 } 7 7 8 8 div#header { 9 margin-top: 40px;10 margin-bottom: 1em;11 padding: 0px 20px;12 height: 40px;13 background: url("http://ethna.jp/image/navbg.gif") repeat-x;9 margin-top: 40px; 10 margin-bottom: 1em; 11 padding: 0px 20px; 12 height: 40px; 13 background: url("http://ethna.jp/image/navbg.gif") repeat-x; 14 14 } 15 15 16 16 div#header h1 { 17 font-weight: bold;18 background: url("http://ethna.jp/image/navlogo.gif") right no-repeat;17 font-weight: bold; 18 background: url("http://ethna.jp/image/navlogo.gif") right no-repeat; 19 19 } 20 20 21 21 div#footer { 22 margin-bottom: 1em;23 padding: 5px 20px;24 background-color: #cee6e6;25 text-align: right;22 margin-bottom: 1em; 23 padding: 5px 20px; 24 background-color: #cee6e6; 25 text-align: right; 26 26 } 27 27 28 28 div#footer a { 29 color: #f35a21;29 color: #f35a21; 30 30 } 31 31 32 32 div#main { 33 margin-bottom: 1em;34 padding: 10px 20px;35 border: 1px solid #cee6e6;36 background-color: #ffffff;33 margin-bottom: 1em; 34 padding: 10px 20px; 35 border: 1px solid #cee6e6; 36 background-color: #ffffff; 37 37 } 38 38 39 39 div#main h2 { 40 color: #00cccc;41 border: 1px solid #cee6e6;42 border-width: 0 0 1px 0;40 color: #00cccc; 41 border: 1px solid #cee6e6; 42 border-width: 0 0 1px 0; 43 43 } 44 44 … … 50 50 color: #f29578; 51 51 } 52 53 span.ethna-error { 54 color: #ff0000; 55 } -
websites/planet.php.gr.jp/trunk/www/info.php
r12921 r12961 1 1 <?php 2 /** 3 * Delphinus Debug Info 4 * 5 * @package Delphinus 6 * @author halt <halt.hde@gmail.com> 7 */ 8 include_once('/home/halt/codes/delphinus/app/Delphinus_Controller.php'); 2 include_once( dirname( dirname(__FILE__) ). '/app/Delphinus_Controller.php'); 9 3 10 define('ETHNA_DEBUG', true); 11 12 Delphinus_Controller::main( 13 'Delphinus_Controller', 14 array('__ethna_info__') 4 Delphinus_Controller::main('Delphinus_Controller', array( 5 '__ethna_info__', 6 ) 15 7 ); 16 8 ?> -
websites/planet.php.gr.jp/trunk/www/unittest.php
r12921 r12961 1 1 <?php 2 2 error_reporting(E_ALL); 3 include_once '/home/halt/codes/delphinus/app/Delphinus_Controller.php';3 require_once '/home/ha1t/codes/delphinus/app/Delphinus_Controller.php'; 4 4 5 5 Delphinus_Controller::main('Delphinus_Controller', array( -
websites/planet.php.gr.jp/trunk/www/xmlrpc.php
r12921 r12961 1 1 <?php 2 include_once('/home/halt/codes/delphinus/app/Delphinus_Controller.php');2 require_once '/home/ha1t/codes/delphinus/app/Delphinus_Controller.php'; 3 3 4 4 Delphinus_Controller::main_XMLRPC('Delphinus_Controller');
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)