• R/O
  • SSH
  • HTTPS

epitta-bbs: Commit


Commit MetaInfo

Revision36 (tree)
Time2011-10-02 19:23:36
Authorwajett

Log Message

2011/10/02 管理系認証。

Change Summary

Incremental Difference

--- app/actions/admin_action.php (revision 35)
+++ app/actions/admin_action.php (nonexistent)
@@ -1,133 +0,0 @@
1-<?php if ( !defined('ADMINIDTF') or !defined('BASEPATH') ) exit('Denied Access');
2-/**
3- * Epitta BB
4- *
5- * @author Wajett
6- * @copyright Copyright (c) 2011 - 2012, Wajett Systems
7- *
8- *
9- */
10-
11-
12-
13-class Admin_Action extends Base_Action {
14-
15-
16- public function __construct()
17- {
18- //管理者画面専用の設定
19-
20-
21- $this->action = $GLOBALS['APP']['actStr'];
22-
23- //セット
24- $this->id = $GLOBALS['APP']['id'];
25- $this->platform = $GLOBALS['APP']['platform'];
26- $this->skin = $GLOBALS['APP']['skin'];
27-
28- //platform
29- if ( isset( $_POST['plfm']) ) {
30- $this->platform = $_POST['plfm'];
31- } else if ( isset( $_GET['plfm']) ) {
32- $this->platform = $_GET['plfm'];
33- }
34-
35- //Set
36- $this->baseSet['script'] = $_SERVER["SCRIPT_NAME"];
37- $this->baseSet['id'] = $this->id;
38- $this->baseSet['act'] = $this->action;
39- $this->baseSet['plfm'] = $this->platform;
40- $this->baseSet['skin'] = $this->skin;
41-
42- //リンクURL
43- $this->baseSet['linkBaseUrl'] = SCRIPTURL . "?";
44- $query = '';
45- if ( $this->id and $this->id != 'default' ) {
46- $query = "id=" . $this->id;
47- }
48- if ( $this->platform and $this->platform != 'default' ) {
49- if ( ! $query ) $query >= "&";
50- $query .= "plfm=" . $this->platform;
51- }
52- $this->baseSet['linkBaseUrl'] .= $query;
53-
54- //pubURL & dataURL
55- if ( $this->id ) {
56- $this->baseSet['pubURL'] = PUBURL ."/". $this->id;
57- $this->baseSet['dataURL'] = DATAURL ."/". $this->id;
58- } else {
59- $this->baseSet['pubURL'] = PUBURL ."/default";
60- $this->baseSet['dataURL'] = DATAURL ."/default";
61- }
62- $this->baseSet['dataCmn'] = DATAURL ."/common";
63- $this->baseSet['pubCmn'] = PUBURL;
64-
65- //スキンパス
66- $this->skinPath = VIEWPATH . '/admin';
67-
68- //スキンエレメント
69- require_once( $this->skinPath . '/base_elements.php' );
70-
71- }
72-
73-
74- public function loginInput()
75- {
76-
77- $this->postSet['errMessage'] = '';
78- $this->postSet['errMsgAry'] = null;
79- $this->postSet['password'] = '';
80-
81-
82- if ( $_POST ) {
83-
84- if ( empty($_POST['password']) ) {
85- $this->postSet['password'] = '';
86- $this->postSet['errMessage'] = $GLOBALS['LNG']['adminAuthFailed'];
87- $this->postSet['errMsgAry'][0] = '';
88-
89- } else {
90-
91- //認証チェック
92- $brdMdl = $this->loadModel('Board');
93- $admPass = $brdMdl->getAdminPass();
94-
95- echo $admPass;
96-
97- //TODO 管理者パスワード暗号化
98-
99-
100- //
101- $this->postSet['password'] = $_POST['password'];
102-
103- //$this->postSet['errMessage'] = $GLOBALS['LNG']['postInvalid'];
104- //$this->postSet['errMsgAry'][0] = $GLOBALS['LNG']['searchWordLess'];
105-
106-
107- }
108-
109-
110-
111-
112- }
113-
114-
115- //スキン
116- $this->readSkin('login');
117- $this->content = getLoginHtml($this->baseSet, $this->postSet);
118-
119- $this->set['view'] = 'login';
120- $this->setLayout('admin');
121- return true;
122-
123- }
124-
125-
126-
127-
128-
129-
130-
131-}
132-
133-?>
\ No newline at end of file
--- app/actions/adminboard_action.php (nonexistent)
+++ app/actions/adminboard_action.php (revision 36)
@@ -0,0 +1,89 @@
1+<?php if ( !defined('ADMINIDTF') or !defined('BASEPATH') ) exit('Denied Access');
2+/**
3+ * Epitta BB
4+ *
5+ * @author Wajett
6+ * @copyright Copyright (c) 2011 - 2012, Wajett Systems
7+ *
8+ *
9+ */
10+
11+
12+
13+class AdminBoard_Action extends AdminBase_Action {
14+
15+
16+ public function __construct()
17+ {
18+ parent::__construct();
19+
20+
21+ require_once( APPPATH . '/models/board_model.php' );
22+ require_once( APPPATH . '/app_view.php' );
23+
24+ }
25+
26+
27+ public function createInput($mode=1)
28+ {
29+
30+ $bb = $this->getBoardHash();
31+
32+
33+
34+ if ( $mode == 1 ) {
35+ $this->postSet = $this->getBoardHash();
36+ $this->postSet['errMessage'] = '';
37+ $this->postSet['errMsgAry'] = array();
38+
39+ }
40+
41+ $this->postSet['targetAct'] = 'create';
42+
43+
44+/*
45+ //スキン
46+ $this->readSkin('article_input');
47+ $this->readSkin('article');
48+
49+
50+ //返信モード切り替え
51+ if ( $this->getPost('parent_id') ){
52+ $this->postSet['parent_id'] = $this->getPost('parent_id');
53+ }
54+
55+
56+ //1:投稿 2:投稿戻り 3:確認
57+ if ( $mode == 1 or $this->action=='crtipt' ) {
58+ $arc = $this->getArtcleHash();
59+
60+ } else if ( $mode == 2 ) {
61+ $arc = $this->stripslashes_deep($_POST);
62+ $arc = array_merge( $this->getArtcleHash(), $arc );
63+
64+ } else {
65+ //$arc = $this->getArtcleHash();
66+ $arc = $this->stripslashes_deep($_POST);
67+ $arc = array_merge( $this->getArtcleHash(), $arc );
68+ }
69+*/
70+
71+
72+
73+
74+
75+ //スキン
76+ $this->readSkin('board_input');
77+ $this->content = getCreateInputHtml($this->baseSet, $this->postSet, $bb);
78+
79+
80+ $this->set['view'] = 'admin';
81+ $this->setLayout('admin');
82+ return true;
83+
84+ }
85+
86+
87+}
88+
89+?>
\ No newline at end of file
--- app/actions/image_action.php (revision 35)
+++ app/actions/image_action.php (revision 36)
@@ -41,7 +41,7 @@
4141 //echo $decNum;
4242
4343 $img = @imagecreate(70, 20)
44- or die("Cannot Initialize new GD image stream!");
44+ or die("Cannot Create new GD image!");
4545
4646
4747 $col_ellipse = imagecolorallocate($img, 255, 255, 255);
--- app/actions/adminbase_action.php (nonexistent)
+++ app/actions/adminbase_action.php (revision 36)
@@ -0,0 +1,160 @@
1+<?php if ( !defined('ADMINIDTF') or !defined('BASEPATH') ) exit('Denied Access');
2+/**
3+ * Epitta BB
4+ *
5+ * @author Wajett
6+ * @copyright Copyright (c) 2011 - 2012, Wajett Systems
7+ *
8+ *
9+ */
10+
11+
12+
13+class AdminBase_Action extends Base_Action {
14+
15+
16+
17+ public function __construct()
18+ {
19+
20+ //セッション
21+ session_start();
22+
23+
24+ $this->action = $GLOBALS['APP']['actStr'];
25+
26+ //セット
27+ $this->id = $GLOBALS['APP']['id'];
28+ $this->platform = $GLOBALS['APP']['platform'];
29+ $this->skin = $GLOBALS['APP']['skin'];
30+
31+ //platform
32+ $this->platform = '';
33+
34+ //Set
35+ $this->baseSet['script'] = SCRIPTURL;
36+ $this->baseSet['id'] = $this->id;
37+ $this->baseSet['act'] = $this->action;
38+ $this->baseSet['plfm'] = $this->platform;
39+ $this->baseSet['skin'] = $this->skin;
40+
41+ //リンクURL
42+ $this->baseSet['linkBaseUrl'] = SCRIPTURL . "?";
43+ //$query = 'id=defalult&'; //仮
44+ //$this->baseSet['linkBaseUrl'] .= $query;
45+
46+ //pubURL & dataURL
47+ if ( $this->id ) {
48+ $this->baseSet['pubURL'] = PUBURL ."/". $this->id;
49+ $this->baseSet['dataURL'] = DATAURL ."/". $this->id;
50+ } else {
51+ $this->baseSet['pubURL'] = PUBURL ."/default";
52+ $this->baseSet['dataURL'] = DATAURL ."/default";
53+ }
54+ $this->baseSet['pubCmn'] = PUBURL."/common";
55+
56+
57+ //スキンパス
58+ $this->skinPath = VIEWPATH . '/admin';
59+
60+ //スキンエレメント
61+ require_once( $this->skinPath . '/base_elements.php' );
62+
63+
64+ //認証確認
65+
66+ if ( isset($_SESSION[ADMINSSN]) ) {
67+ $dh = $this->loadLib('DataHelper');
68+
69+ //echo $_SESSION[ADMINSSN];
70+ if ( $dh->makePasswordHash(ADMINIDTF) != $_SESSION[ADMINSSN] ) {
71+ if ( $this->action != 'login' ) {
72+ session_destroy();
73+ $this->redirect('act=login');
74+ }
75+ }
76+
77+
78+ } else {
79+ if ( $this->action != 'login' and $this->action != 'logout' ) {
80+ session_destroy();
81+ $this->redirect('act=login');
82+ }
83+
84+ }
85+
86+
87+
88+ }
89+
90+
91+
92+
93+ protected function getBoardHash() {
94+
95+ return array(
96+
97+ 'board_id' => '', //id
98+ 'id' => '',
99+ 'name' => '',
100+ 'remarks' => '',
101+ 'topurl' => '',
102+ 'homepage' => '',
103+ 'defaultview' => '',
104+ 'defaultplfm' => '',
105+
106+ 'newpost_on' => '',
107+ 'top_on' => '',
108+ 'tree_on' => '',
109+ 'plain_on' => '',
110+ 'thread_on' => '',
111+ 'topic_on' => '',
112+ 'list_on' => '',
113+ 'notice_on' => '',
114+ 'search_on' => '',
115+ 'home_on' => '',
116+ 'tree_max' => '',
117+ 'plain_max' => '',
118+ 'threadhas_max' => '',
119+
120+ 'delete_mode' => '',
121+ 'edit_mode' => '',
122+ 'img_view' => '',
123+ 'new_days' => '',
124+ 'clipfile' => '',
125+ 'clipfile_types' => '',
126+ 'clipfile_maxsize' => '',
127+ 'icon_on' => '',
128+ 'icons' => '',
129+ 'ftcolor_on' => '',
130+ 'ftcolors' => '',
131+ 'ticket_limit' => '',
132+ 'captcha_on' => '',
133+ 'keyword_on' => '',
134+ 'keyword_q' => '',
135+ 'keyword_a' => '',
136+
137+ 'writecert_code' => '',
138+ 'readcert_code' => '',
139+ 'mail_server' => '',
140+ 'mailto_admin' => '',
141+
142+ 'vw_title' => '',
143+ 'vw_robots' => '',
144+ 'vw_keywords' => '',
145+ 'vw_description' => '',
146+ 'vw_header' => '',
147+ 'vw_footer' => '',
148+
149+ 'created' => '',
150+ 'modified' => '',
151+
152+ );
153+
154+ }
155+
156+
157+
158+}
159+
160+?>
\ No newline at end of file
--- app/actions/base_action.php (revision 35)
+++ app/actions/base_action.php (revision 36)
@@ -135,8 +135,6 @@
135135
136136
137137
138-
139-
140138 protected function loadLib($className)
141139 {
142140 require_once( APPPATH. '/libs/' . strtolower($className). '.php' );
--- app/actions/adminauth_action.php (nonexistent)
+++ app/actions/adminauth_action.php (revision 36)
@@ -0,0 +1,144 @@
1+<?php if ( !defined('ADMINIDTF') or !defined('BASEPATH') ) exit('Denied Access');
2+/**
3+ * Epitta BB
4+ *
5+ * @author Wajett
6+ * @copyright Copyright (c) 2011 - 2012, Wajett Systems
7+ *
8+ *
9+ */
10+
11+
12+
13+class AdminAuth_Action extends AdminBase_Action {
14+
15+
16+ public function __construct()
17+ {
18+ parent::__construct();
19+
20+
21+ require_once( APPPATH . '/models/board_model.php' );
22+
23+ }
24+
25+
26+ public function login()
27+ {
28+
29+ $this->postSet['errMessage'] = '';
30+ $this->postSet['errMsgAry'] = array();
31+ $this->postSet['password'] = '';
32+
33+
34+ if ( $_POST ) {
35+
36+ if ( empty($_POST['password']) ) {
37+ $this->postSet['errMessage'] = $GLOBALS['LNG']['adminAuthFailed'];
38+
39+ echo "1";
40+
41+ } else {
42+
43+ $inPass = $this->getPost('password');
44+
45+ //認証チェック
46+ $dh = $this->loadLib('DataHelper');
47+ if ( $dh->makePasswordHash(ADMINIDTF) == $dh->makePasswordHash($inPass) ) {
48+
49+ $_SESSION[ADMINSSN] = $dh->makePasswordHash($inPass);
50+ //echo "logon";
51+ //exit;
52+ $this->redirect('act=menu');
53+
54+
55+ } else {
56+ $this->postSet['errMessage'] = $GLOBALS['LNG']['adminAuthFailed'];
57+ echo "logfail";
58+ }
59+
60+ echo "2 " . ADMINIDTF. " / ". $inPass;
61+ }
62+
63+ echo "<br>\n3";
64+ } else {
65+ echo "4";
66+
67+
68+ }
69+
70+ echo "5";
71+ //exit;
72+
73+ //スキン
74+ $this->readSkin('login');
75+ $this->content = getLoginHtml($this->baseSet, $this->postSet);
76+
77+ $this->set['view'] = 'login';
78+ $this->setLayout('admin');
79+ return true;
80+
81+ }
82+
83+
84+ public function logout()
85+ {
86+
87+ if ( isset($_SESSION[ADMINSSN]) and $_SESSION[ADMINSSN] ) {
88+
89+ //
90+ $_SESSION[ADMINSSN] = "";
91+ //
92+ $_SESSION = array();
93+
94+
95+ setcookie("PHPSESSID", '', time() - 36000, '/');
96+
97+ session_destroy();
98+
99+
100+ //ヘッダー出力
101+ $this->redirect('act=login');
102+
103+ } else {
104+
105+ $_SESSION["test"] = "test";
106+
107+ //スキン
108+ $this->readSkin('logout');
109+ $this->content = getLogoutHtml($this->baseSet, $this->postSet);
110+
111+ $this->set['view'] = 'logout';
112+ $this->setLayout('admin');
113+ return true;
114+
115+ }
116+
117+ }
118+
119+
120+ public function menu()
121+ {
122+
123+
124+ //掲示板リスト
125+ $cmnMdl = new Board_Model($GLOBALS['APP']['coreDbPath']);
126+ $result = $cmnMdl->getAllBoards();
127+
128+
129+ //スキン
130+ $this->readSkin('menu');
131+ $this->content = getMenuHtml($this->baseSet, $result);
132+
133+ $this->set['view'] = 'admin';
134+ $this->setLayout('admin');
135+
136+
137+ return true;
138+
139+ }
140+
141+
142+}
143+
144+?>
\ No newline at end of file
--- app/models/article_model.php (revision 35)
+++ app/models/article_model.php (revision 36)
@@ -94,9 +94,9 @@
9494 $maxTree = $onPage * $pageNum;
9595
9696 $sql =
97- " SELECT tree_updated, id FROM epitta_articles" .
98- " WHERE status_code=1 AND parent_id=0" .
99- " ORDER BY tree_updated DESC, id DESC LIMIT " . $maxTree;
97+ "SELECT tree_updated, id FROM epitta_articles" .
98+ " WHERE status_code=1 AND parent_id=0" .
99+ " ORDER BY tree_updated DESC, id DESC LIMIT " . $maxTree;
100100
101101 //echo $sql;
102102 $rows = $this->getRecord($sql);
@@ -117,9 +117,9 @@
117117 if ( $mode==2 ) $fields = $this->mainFields;
118118
119119 $sql =
120- " SELECT * FROM epitta_articles" .
121- " WHERE id IN (" . $ids . ")" .
122- " ORDER BY tree_updated DESC, id DESC";
120+ "SELECT * FROM epitta_articles" .
121+ " WHERE id IN (" . $ids . ")" .
122+ " ORDER BY tree_updated DESC, id DESC";
123123
124124 //echo $sql;
125125 $rows = $this->getRecord($sql);
--- app/models/board_model.php (revision 35)
+++ app/models/board_model.php (revision 36)
@@ -4,14 +4,36 @@
44 *
55 */
66
7+class Board_Model extends Base_Model {
78
89
10+ public function __construct($setDbPath = "")
11+ {
12+ parent::__construct($setDbPath);
913
10-class Board_Model extends Base_Model {
14+ $this->mainFields =
15+ "id, tree_number, parent_id, subject, author, iconfile, clipfile1, clipfile2, clipfile3," .
16+ "status_code, tree_updated, created, modified";
1117
18+ }
19+
20+
21+ function getAllBoards() {
1222
23+ $this->openConn();
1324
25+ $sql = "SELECT * FROM epitta_boards ORDER BY created;";
26+ $rows = $this->getRecord($sql);
1427
28+
29+ $this->closeConn();
30+
31+ return $rows;
32+
33+ }
34+
35+
36+/*
1537 function readConfig($id='default') {
1638
1739 $id = sqlite_escape_string($id);
@@ -21,19 +43,21 @@
2143 $sql = "SELECT * FROM epitta_boards WHERE id='" . $id . "'";
2244 $rows = $this->getRecord($sql, true);
2345
24- /*
25- $result = sqlite_query($this->conn, $sql, SQLITE_ASSOC, $this->dbError);
26- if (!$result) trigger_error ('Failed Query!' . $this->dbError);
46+
47+ //$result = sqlite_query($this->conn, $sql, SQLITE_ASSOC, $this->dbError);
48+ //if (!$result) trigger_error ('Failed Query!' . $this->dbError);
2749
28- $rows = sqlite_fetch_array($result, SQLITE_ASSOC);
50+ //$rows = sqlite_fetch_array($result, SQLITE_ASSOC);
2951
30- */
3152
53+
3254 $this->closeConn();
3355
3456 return $rows;
3557
3658 }
59+*/
3760
3861
62+
3963 }
\ No newline at end of file
--- app/app_controller.php (revision 35)
+++ app/app_controller.php (revision 36)
@@ -118,99 +118,108 @@
118118 *
119119 */
120120 class AppAdmin_Controller {
121-
122- protected $ctrl = array();
123-
124-
125- public function __construct()
126- {
127-
128- //for Debug
129- if ( ENV == 'dev' ) {
130- array_push( $GLOBALS['DBG'], "Mem=" . round((memory_get_usage()/(1024*1024) ),2) . "MB\n" );
131- }
132-
133- $this->ctrl = array(
134- //このモッサリ感はださいけど、Mod_Rwriteは利用者のハードルがあがる
135-
136- //
137- 'index' =>array( 'act'=>'Admin', 'func'=>'loginInput' ),
138- 'login' =>array( 'act'=>'Admin', 'func'=>'loginInput' ),
139- 'logout' =>array( 'act'=>'Admin', 'func'=>'logout' ),
140- 'menu' =>array( 'act'=>'Admin', 'func'=>'menu' ),
141-
142- 'cgfipt' =>array( 'act'=>'Admin', 'func'=>'configInput' ),
143- 'cgfsv' =>array( 'act'=>'Admin', 'func'=>'cpmfogSave' ),
144-
145- 'artlst' =>array( 'act'=>'Admin', 'func'=>'articleList' ),
146- 'artedt' =>array( 'act'=>'Admin', 'func'=>'articleEdit' ),
147- 'artsv' =>array( 'act'=>'Admin', 'func'=>'articleSave' ),
148-
149- 'artlst' =>array( 'act'=>'Admin', 'func'=>'articleList' ),
150- 'artedt' =>array( 'act'=>'Admin', 'func'=>'articleEdit' ),
151- 'artsv' =>array( 'act'=>'Admin', 'func'=>'articleSave' ),
152-
153- 'acs' =>array( 'act'=>'Admin', 'func'=>'access' ),
154-
155- );
156-
157- //
158- $this->action();
159-
160- }
161-
162-
163- public function Action()
164- {
165-
166- //
167- $act = 'index';
168- if ( isset( $_POST['act'] ) ) {
169- $act = $_POST['act'];
170- } else if ( isset( $_GET['act'] ) ) {
171- $act = $_GET['act'];
172- }
173- $GLOBALS['APP']['actStr'] = $act;
174-
175- $actionSet = null;
176- if ( isset( $this->ctrl[$act] ) ) {
177- $actionSet = $this->ctrl[$act];
178- } else {
179- $actionSet = $this->ctrl['index'];
180- }
181-
182-
183- //読み込み
184- require_once( APPPATH . '/actions/base_action.php' );
185- require_once( APPPATH . '/actions/' . strtolower($actionSet['act']) . "_action.php" );
186-
187- //echo $actionSet['act'];
188-
189-
190- //インスタンス
191- //$ins = new ReflectionClass( $actionSet['act'] );
192- $className = $actionSet['act'] . '_Action';
193- $ins = new $className();
194-
195- //ファンクション
196- $ins->$actionSet['func']();
197- //$ret = ReflectionFunction::export( $actionSet['func']);
198-
199- exit;
200-
201-
202- }
203-
204- function __destruct() {
205-
206- if ( $GLOBALS['ENV'] == 'dev' ) {
207- echo "<div>Now Developing!</div>\n";
121+
122+ protected $ctrl = array();
123+
124+
125+ public function __construct()
126+ {
127+
128+ //for Debug
129+ if ( $GLOBALS['ENV'] == 'dev' ) {
208130 array_push( $GLOBALS['DBG'], "Mem=" . round((memory_get_usage()/(1024*1024) ),2) . "MB\n" );
131+ }
209132
210- print_r( $GLOBALS['DBG']);
211- }
133+ $this->ctrl = array(
134+ //このモッサリ感はださいけど、Mod_Rwriteは利用者のハードルがあがる
135+
136+ 'index' =>array( 'act'=>'AdminAuth', 'func'=>'login' ),
137+ //
138+ 'login' =>array( 'act'=>'AdminAuth', 'func'=>'login' ),
139+ 'logout' =>array( 'act'=>'AdminAuth', 'func'=>'logout' ),
140+ 'menu' =>array( 'act'=>'AdminAuth', 'func'=>'menu' ),
141+
142+ 'cfgipt' =>array( 'act'=>'AdminConfig', 'func'=>'configInput' ),
143+ 'cfgsv' =>array( 'act'=>'AdminConfig', 'func'=>'cpmfogSave' ),
144+
145+ 'artlst' =>array( 'act'=>'AdminArticle', 'func'=>'articleList' ),
146+ 'modify' =>array( 'act'=>'AdminArticle', 'func'=>'articleModiry' ),
147+ 'delete' =>array( 'act'=>'AdminArticle', 'func'=>'articleDelete' ),
148+
149+ 'bdcrip' =>array( 'act'=>'AdminBoard', 'func'=>'createInput' ),
150+ 'bdcrt' =>array( 'act'=>'AdminBoard', 'func'=>'save' ),
151+ 'bdmdip' =>array( 'act'=>'AdminBoard', 'func'=>'modifyInput' ),
152+ 'bdmod' =>array( 'act'=>'AdminBoard', 'func'=>'modify' ),
153+ 'bdcfm' =>array( 'act'=>'AdminBoard', 'func'=>'deleteComfirm' ),
154+ 'bddlt' =>array( 'act'=>'AdminBoard', 'func'=>'delete' ),
155+
156+ 'acs' =>array( 'act'=>'AdminAccess', 'func'=>'access' ),
157+
158+ );
159+
160+ //
161+ $this->action();
162+
163+ }
164+
165+
166+ public function Action()
167+ {
168+
169+ //
170+ $act = 'index';
171+ if ( isset( $_POST['act'] ) ) {
172+ $act = $_POST['act'];
173+ } else if ( isset( $_GET['act'] ) ) {
174+ $act = $_GET['act'];
175+ }
176+ $GLOBALS['APP']['actStr'] = $act;
177+
178+ $actionSet = null;
179+ if ( isset( $this->ctrl[$act] ) ) {
180+ $actionSet = $this->ctrl[$act];
181+ } else {
182+ $actionSet = $this->ctrl['index'];
183+ }
184+
185+
186+ //読み込み
187+ require_once( APPPATH . '/actions/base_action.php' );
188+ require_once( APPPATH . '/actions/adminbase_action.php' );
189+ require_once( APPPATH . '/actions/' . strtolower($actionSet['act']) . "_action.php" );
190+
191+ //echo $actionSet['act'];
192+
193+
194+ //インスタンス
195+ //$ins = new ReflectionClass( $actionSet['act'] );
196+ $className = $actionSet['act'] . '_Action';
197+ $ins = new $className();
198+
199+ //ファンクション
200+ $ins->$actionSet['func']();
201+ //$ret = ReflectionFunction::export( $actionSet['func']);
202+
203+ exit;
204+
205+
206+ }
207+
208+
209+
210+ function __destruct() {
211+
212+ if ( $GLOBALS['ENV'] == 'dev' ) {
213+ echo "<div>Now Developing!</div>\n";
214+ array_push( $GLOBALS['DBG'], "Mem=" . round((memory_get_usage()/(1024*1024) ),2) . "MB\n" );
215+
216+ print_r( $GLOBALS['DBG']);
217+
218+ }
219+
220+
221+ }
212222
213- }
214223
215224 }
216225 ?>
\ No newline at end of file
--- app/app_config.php (revision 35)
+++ app/app_config.php (revision 36)
@@ -7,7 +7,7 @@
77
88 //バージョン表記など
99 define('EPTNAME', 'Epitta BB');
10-define('EPTVER', 'ver 0.22 dev');
10+define('EPTVER', 'ver 0.30 dev');
1111 define('EPTSITE', 'Epitta PHP Project');
1212 define('EPTURL', 'http://');
1313
--- system/epitta_core.php (revision 35)
+++ system/epitta_core.php (revision 36)
@@ -120,8 +120,11 @@
120120 //コンフィグ読み込み
121121 $cmnMdl = new Common_model($GLOBALS['APP']['coreDbPath']);
122122 $result = $cmnMdl->readConfig($GLOBALS['APP']['id']);
123- if (!$result) trigger_error ('Unknown BB\'s id!');
123+ if (!$result) trigger_error ('Unknown1 BB\'s id!');
124124
125+ //var_dump($GLOBALS['APP']);
126+
127+
125128 //配列へ
126129 $GLOBALS['CNF'] = $result;
127130 //var_dump($GLOBALS['CNF']);
--- system/locals/ja/wordlist.php (revision 35)
+++ system/locals/ja/wordlist.php (revision 36)
@@ -113,6 +113,8 @@
113113 'failedFileSize' => '添付するファイルのサイズが制限を超えています。',
114114
115115
116+
117+
116118 'adminAuth' => '管理者ログイン',
117119 'adminLogout' => '管理者ログアウト',
118120 'adminAuthButton' => '認 証',
@@ -121,6 +123,72 @@
121123 'adminBoardList' => '掲示板一覧',
122124
123125
126+
127+'id' => 'ID',
128+'name' => 'DB名',
129+'remarks' => '備考',
130+'topurl' => 'トップURL',
131+'homepage' => 'ホームページURL',
132+
133+'defaultview' => '初期表示ビュー',
134+'defaultplfm' => '初期プラットフォーム',
135+'newpost_on' => '新規投稿可否',
136+'top_on' => 'トップ表示可否',
137+'tree_on' => 'ツリー表示可否',
138+'plain_on' => 'プレイン表示可否',
139+'thread_on' => 'スレッド表示可否',
140+'topic_on' => 'トピック表示可否',
141+'list_on' => 'リスト表示可否',
142+'notice_on' => '注意事項表示可否',
143+'search_on' => '検索表示可否',
144+'home_on' => 'ホーム表示可否',
145+
146+'tree_max' => 'ツリー表示最大親記事数',
147+'plain_max' => 'プレイン表示最大記事数',
148+'threadhas_max' => 'スレッド表示最大親記事数',
149+
150+'delete_mode' => '削除モード',
151+'edit_mode' => '編集モード',
152+'img_view' => '記事添付画像表示モード',
153+'new_days' => '新規投稿マーク表示日数',
154+
155+'clipfile' => '記事ファイル添付可否',
156+'clipfile_types' => '添付ファイル許可形式',
157+'clipfile_maxsize' => '添付ファイル最大サイズ',
158+'icon_on' => 'アイコン利用',
159+'icons' => 'アイコン内容',
160+'ftcolor_on ' => '文字色選択',
161+'ftcolors' => '文字色',
162+'ticket_limit' => '投稿時間制限最大秒数',
163+'captcha_on' => '画像認識キー利用',
164+'keyword_on' => '投稿キーワード利用',
165+'keyword_q' => '投稿キーワード設問',
166+'keyword_a' => '投稿キーワード回答',
167+
168+'writecert_code' => '',
169+'readcert_code' => '',
170+'mail_server' => 'SendMailパス',
171+'mailto_admin' => '管理者メールアドレス',
172+
173+'vw_title' => '掲示板タイトル',
174+'vw_robots' => '掲示板検索対応(robots)',
175+'vw_keywords' => '掲示板検索キーワード',
176+'vw_description' => '掲示板説明文',
177+'vw_header' => 'ヘッダー',
178+'vw_footer' => 'フッター',
179+
180+'created' => '作成日時',
181+'modified' => '更新日時',
182+
183+
184+
185+
186+
187+
188+
189+
190+
191+
124192 );
125193
126194
--- views/admin/menu.php (revision 35)
+++ views/admin/menu.php (revision 36)
@@ -1,32 +1,54 @@
11 <?php
22
33
4-function getMenuHtml($baseSet, $postSet) {
4+function getMenuHtml($baseSet, $boards) {
55
6+ $now = date('y-m-d s:h:i');
7+
68 $myContent = '';
79 $myContent .=<<< HTML
810
9-<div class="searchInput" style="text-align:center;">
11+<div class="adminMenuTitle"><h3>{$GLOBALS['LNG']['adminMenu']}</h3></div>
1012
11-<div style="width:500px; border:1px solid #777; margin :10px auto;">
13+<div style="text-align:left;"><a href="{$baseSet['script']}?act=bdcrip">【掲示板新規作成】</a></div>
14+
15+<table border="1" width="765" cellspacing="0">
16+ <tr>
17+ <th width="120">ID</th><th width="120">DBファイル名</th><th>タイトル</th><th width="120">作成日時</th><th width="200">操作</th>
18+ </tr>
1219
13- <div class="adminMenuTitle">{$GLOBALS['LNG']['adminMenu']}</div>
20+HTML;
1421
15- <div class="searchBody">
22+//var_dump($boards);
1623
24+if ( $boards ) {
25+
26+ $myContent .= "";
1727
28+ foreach ( $boards as $brd ) {
29+
30+ $myContent .= "<tr>";
31+ $myContent .= "<td>{$brd['id']}</td>";
32+ $myContent .= "<td>{$brd['name']}</td>";
33+ $myContent .= "<td>{$brd['vw_title']}</td>";
34+
35+ $myContent .= "<td>{$brd['created']}</td>";
36+ $myContent .= "<td width=\"200\" align=\"center\">記事管理 アクセス解析<br />掲示板設定 掲示板削除</td>";
37+
38+ $myContent .= "</tr>";
39+
40+ }
1841
19- <div>
42+}
2043
21- </div>
44+
45+$myContent .=<<< HTML
46+
47+</table>
2248
23- </div>
24-
25-
26-</div>
49+<br class="clr" />
50+ {$now}
2751
28-</div>
29-
3052 HTML;
3153
3254 return $myContent;
--- views/admin/admin_layout.php (revision 35)
+++ views/admin/admin_layout.php (revision 36)
@@ -4,7 +4,7 @@
44 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
55 <meta http-equiv="content-script-type" content="text/javascript" />
66 <meta http-equiv="content-style-type" content="text/css" />
7-<link rel="stylesheet" type="text/css" href="<?php echo $this->baseSet['pubCmn']; ?>/common/css/base.css" />
7+<link rel="stylesheet" type="text/css" href="<?php echo $this->baseSet['pubCmn']; ?>/css/base.css" />
88 <script type="text/javascript" src="<?php echo $this->baseSet['pubCmn']; ?>/js/common.js"></script>
99 <title>管理画面</title>
1010 </head>
@@ -11,39 +11,37 @@
1111 <body <?php echo $this->set['vw_body']; ?>>
1212
1313
14-<div class="container">
14+<div class="adminContainer">
1515
1616 <!-- header -->
17-<div style="background-color:#ffffcc;">
18-ヘッダー
17+<div style="background-color:#ccc;">
18+<h2>Epitta BB Administration</h2>
1919
20+<div style="text-align:right;"><a href="{$baseSet['script']}?act=logout">【ログアウト】</a></div>
21+
2022 </div>
21-<br clear="all" class="clear" />
23+<br clear="all" class="clr" />
2224 <!-- header -->
2325
2426
25-<div class="mainContentOuter">
26-<div class="mainContent <?php echo $this->set['view']; ?>View">
27+<div class="adminMainContentOuter">
28+<div class="adminMainContent <?php echo $this->set['view']; ?>View">
2729
2830 <?php echo $this->content; ?>
2931
3032 </div>
3133 </div>
32-<div style="text-align:right;"><a href="">ログアウト</a></div>
3334
35+<br clear="all" class="clr" />
3436
35-<br clear="all" class="clear" />
36-
3737 <!-- footer -->
38-<div style="background-color:#ffffcc;">
39-<br />
40-フッター
38+<div style="background-color:#ccc;">
4139
40+<div class="appFoot"><?php echo $this->set['app_info']; ?></div>
41+
4242 </div>
4343 <!-- footer -->
4444
45-<div class="appCount"></div>
46-<div class="appFoot"><?php echo $this->set['app_info']; ?></div>
4745
4846 </div>
4947
--- views/admin/base_elements.php (revision 35)
+++ views/admin/base_elements.php (revision 36)
@@ -159,7 +159,7 @@
159159
160160 $myContent = '';
161161 $myContent .=<<< HTML
162- <span class="new"><img src="{$pubUrl}/img/new_icon.gif" alt="new_icon.gif" class="newIcon" /></span>
162+ <span class="new"><img src="{$pubUrl}/img/icon_new.gif" alt="新投稿" class="newIcon" /></span>
163163 HTML;
164164 return $myContent;
165165 }
@@ -224,17 +224,17 @@
224224
225225 if ( $clip1 ) {
226226 $myContent .=<<< HTML
227- <span class="clip"><a href="{$dataUrl2}{$clip1}" target="_blank"><img src="{$pubUrl}/img/clip_icon.gif"></a></span>
227+ <span class="clip"><a href="{$dataUrl2}{$clip1}" target="_blank"><img src="{$pubUrl}/img/icon_clip.gif"></a></span>
228228 HTML;
229229 }
230230 if ( $clip2 ) {
231231 $myContent .=<<< HTML
232- <span class="clip"><a href="{$dataUrl2}{$clip2}" target="_blank"><img src="{$pubUrl}/img/clip.gif"></a></span>
232+ <span class="clip"><a href="{$dataUrl2}{$clip2}" target="_blank"><img src="{$pubUrl}/img/icon_clip.gif"></a></span>
233233 HTML;
234234 }
235235 if ( $clip3 ) {
236236 $myContent .=<<< HTML
237- <span class="clip"><a href="{$dataUrl2}{$clip3}" target="_blank"><img src="{$pubUrl}/img/clip.gif"></a></span>
237+ <span class="clip"><a href="{$dataUrl2}{$clip3}" target="_blank"><img src="{$pubUrl}/img/icon_clip.gif"></a></span>
238238 HTML;
239239 }
240240
@@ -297,15 +297,15 @@
297297 $action = 'modipt';
298298 $btnName = '';
299299 if ( $artlSet['edit_mode'] == 1 ) {
300- $btnName = $GLOBALS['LNG']['modify'];
300+ $btnName = '編集';
301301
302302 } else if ( $artlSet['edit_mode'] == 2 ) {
303- $btnName = $GLOBALS['LNG']['addMod'];
303+ $btnName = '追記';
304304
305305 } else {
306306
307307 if ( $artlSet['delete_mode'] == 1 ) {
308- $btnName = $GLOBALS['LNG']['delete'];
308+ $btnName = '削除';
309309 $action = 'delipt';
310310 }
311311 }
@@ -330,7 +330,7 @@
330330
331331
332332
333-function makeBranch($branches, $parent_id, $branchMap, &$depthBranch, $depth=1) {
333+function makeBranch($branches, $parent_id, $branchMap, &$depthBranch, $depth=1, $pubUrl) {
334334
335335 $myContent = "";
336336 $myChild = "";
@@ -337,8 +337,8 @@
337337 $baseIndent = '&nbsp;';
338338 $depthEnd = false;
339339
340- $shapes = array( 0=>$GLOBALS['LNG']['branchShape0'], 1=>$GLOBALS['LNG']['branchShape0'],
341- 2=>$GLOBALS['LNG']['branchShape0'], 3=>$GLOBALS['LNG']['branchShape0'] );
340+ $shapes = array( 0=>$GLOBALS['LNG']['branchShape0'], 1=>$GLOBALS['LNG']['branchShape1'],
341+ 2=>$GLOBALS['LNG']['branchShape2'], 3=>$GLOBALS['LNG']['branchShape3'] );
342342
343343
344344 foreach($branches as $key => $row) {
@@ -350,7 +350,7 @@
350350 $map = $branchMap[$row['id']];
351351 $depthBranch[$depth] = $map['shape'];
352352
353- $myChild = makeBranch($branches, $row['id'], $branchMap, $depthBranch, $depth + 1);
353+ $myChild = makeBranch($branches, $row['id'], $branchMap, $depthBranch, $depth + 1, $pubUrl);
354354
355355 if ( $depth > 1 ) {
356356 #$myChild .= $depthBranch[$depth]-1;
@@ -396,7 +396,7 @@
396396
397397 #if ( $brc==3 ) $myContent . "end";
398398
399- $myContent .= getBranchHtml($row, $twig, PUBURL); //ここはグローバル変数で
399+ $myContent .= getBranchHtml($row, $twig, $pubUrl);
400400
401401 $myContent .= $myChild;
402402
--- views/admin/board_input.php (nonexistent)
+++ views/admin/board_input.php (revision 36)
@@ -0,0 +1,119 @@
1+<?php
2+
3+
4+function getCreateInputHtml($baseSet, $postSet, $bb) {
5+
6+ $err = makeError($postSet['errMessage'], $postSet['errMsgAry']);
7+
8+
9+ $myContent = '';
10+$myContent .=<<< HTML
11+
12+<div class="inputForm">
13+<form method="post" action="{$baseSet['script']}?act={$postSet['targetAct']}" enctype="multipart/form-data" accept-charset="UTF-8">
14+<div class="articleItems">
15+
16+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['author']}:</div>
17+ <div class="itemInput"><input name="name" type="text" value="{$bb['name']}" class="ime_ac" /></div><div class="clear"></div>
18+
19+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
20+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
21+
22+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
23+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
24+
25+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
26+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
27+
28+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
29+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
30+
31+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['author']}:</div>
32+ <div class="itemInput"><input name="name" type="text" value="{$bb['name']}" class="ime_ac" /></div><div class="clear"></div>
33+
34+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
35+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
36+
37+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
38+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
39+
40+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
41+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
42+
43+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
44+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
45+
46+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['author']}:</div>
47+ <div class="itemInput"><input name="name" type="text" value="{$bb['name']}" class="ime_ac" /></div><div class="clear"></div>
48+
49+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
50+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
51+
52+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
53+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
54+
55+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
56+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
57+
58+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
59+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
60+
61+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['author']}:</div>
62+ <div class="itemInput"><input name="name" type="text" value="{$bb['name']}" class="ime_ac" /></div><div class="clear"></div>
63+
64+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
65+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
66+
67+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
68+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
69+
70+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
71+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
72+
73+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
74+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
75+
76+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['author']}:</div>
77+ <div class="itemInput"><input name="name" type="text" value="{$bb['name']}" class="ime_ac" /></div><div class="clear"></div>
78+
79+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
80+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
81+
82+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
83+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
84+
85+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
86+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
87+
88+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
89+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
90+
91+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['author']}:</div>
92+ <div class="itemInput"><input name="name" type="text" value="{$bb['name']}" class="ime_ac" /></div><div class="clear"></div>
93+
94+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
95+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
96+
97+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
98+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
99+
100+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
101+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
102+
103+ <div class="itemName"><span class="rqd">*</span>{$GLOBALS['LNG']['subject']}:</div>
104+ <div class="itemInput"><input name="subject" type="text" value="{$bb['name']}" size="40" class="ime_ac" /></div><div class="clear"></div>
105+
106+
107+
108+</div>
109+</form>
110+<br clear="all" class="clear" />
111+</div>
112+
113+HTML;
114+
115+ return $myContent;
116+}
117+
118+
119+?>
\ No newline at end of file
--- views/admin/login.php (revision 35)
+++ views/admin/login.php (revision 36)
@@ -24,7 +24,7 @@
2424 <br />
2525 </div>
2626
27- <input type="submit" value="{$GLOBALS['LNG']['searchButton']}" />
27+ <input type="submit" value="{$GLOBALS['LNG']['adminAuthButton']}" />
2828
2929 </form>
3030 </div>
--- public/common/css/base.css (revision 35)
+++ public/common/css/base.css (revision 36)
@@ -8,7 +8,7 @@
88
99
1010 body {
11- color: #777777;
11+ color: #555;
1212 font-size:14px;
1313 text-align: center;
1414 }
@@ -42,7 +42,7 @@
4242 }
4343
4444 div.mainContent {
45- border: 1px solid black;
45+ border: 0px solid black;
4646 width:96%;
4747 text-align:left;
4848 margin:5px auto 5px auto ;
@@ -49,7 +49,7 @@
4949
5050 }
5151
52-br.clear, div.clear {
52+br.clr, br.clear, div.clear {
5353 font-size:0px;
5454 height:0px;
5555 visibility: hidden;
@@ -246,3 +246,30 @@
246246 }
247247
248248
249+
250+
251+/*** Admin ***/
252+
253+div.adminContainer {
254+ width:780px;
255+ border: 0px solid #ccc;
256+
257+}
258+
259+div.adminMainContentOuter {
260+ text-align:center;
261+}
262+
263+div.adminView {
264+ border:1px solid #777;
265+ margin :10px auto;
266+}
267+
268+div.adminView h3 {
269+ display:inline;
270+}
271+
272+div.adminView adminMenuTitle {
273+ margin-top: 5px;
274+}
275+
Show on old repository browser