19 พฤษภาคม 2555, 05:33:45
ยินดีต้อนรับผู้เยี่ยมชม
  • noavata
  • ยินดีต้อนรับคุณ, ผู้เยี่ยมชม กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน
    เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น
Page Rank

ทำเว็บไซต์ | แต่งบอร์ด | ออกแบบ | SMF | Joomla | Drupal | WordPress | JQuery | CMS | ECommerce | Tel. +668-08577477

ส่งหัวข้อนี้พิมพ์ หน้า: 1 
icon message ผู้เขียน หัวข้อ: Password Protect Boards ล๊อคบอร์ดด้วยรหัสผ่านสำหรับ SMF 2.0  (อ่าน 274 ครั้ง)
0 สมาชิก และ 1 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
  • ชื่อ: Password Protect Boards
  • ผู้เขียน: Yağız...
  • นำเสนอโดย: DexMoreGroup
  • ประเภท: Security and Moderation
  • รองรับ: SMF 2.0.x
  • ปรับปรุงล่าสุด: 1 ตุลาคม 2554
  • ต้นฉบับ: Password Protect Boards

รายละเอียด
      mod นี้ใช้สำหรับกำหนดรหัสผ่านในการเข้าใช้งานบอร์ด ซึ่งสามารถกำหนดใช้ในแต่ละบอร์ดได้อย่างอิสระ และแต่ละบอร์ดก็สามารถกำหนดรหัสผ่านให้แตกต่างกันได้

ตัวอย่าง




แก้ไขไฟล์:

file $sourcedir/Load.php

ค้นหา -->>
โค๊ด: [Select]
b.id_theme, b.override_theme, b.count_posts, b.id_profile, b.redirect

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
, b.passwd

ค้นหา -->>
โค๊ด: [Select]
'posts_count' => empty($row['count_posts']),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'passwd' => $row['passwd'],

ค้นหา -->>
โค๊ด: [Select]
if ($user_info['is_mod'])
$user_info['groups'][] = 3;

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
// Can they view this board?
if (!$user_info['is_admin'] && !$user_info['is_mod'] && $board_info['passwd'] && !in_array($board, $_SESSION['board_access']))
{
if (!isset($_POST['passwd']) || sha1($board_info['name'] . $_POST['passwd']) != $board_info['passwd'])
{
loadPermissions();
loadTheme();
global $sourcedir;
require_once($sourcedir . '/passwdBoard.php');
passwdBoardFailed(!empty($board) ? "board=$board" : "topic=$topic");
}
else
$_SESSION['board_access'][] = $board;
}

ค้นหา -->>
โค๊ด: [Select]
$sc = $_SESSION['session_value'];

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (!isset($_SESSION['board_access']))
$_SESSION['board_access'] = array();

ค้นหา -->>
โค๊ด: [Select]
// Just build this here, it makes it easier to change/use - administrators can see all boards.
if ($user_info['is_admin'])
$user_info['query_see_board'] = '1=1';
// Otherwise just the groups in $user_info['groups'].
else
$user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.member_groups) != 0 OR FIND_IN_SET(', $user_info['groups']) . ', b.member_groups) != 0' . (isset($user_info['mod_cache']) ? ' OR ' . $user_info['mod_cache']['mq'] : '') . ')';

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
// Passwordify it!
if (!$user_info['is_admin'] && !empty($_SESSION['board_access']))
$user_info['query_see_board'] .= 'AND (b.id_board IN (' . implode(',', $_SESSION['board_access']) . ') OR CHAR_LENGTH(b.passwd) = 0)';
elseif (!$user_info['is_admin'])
$user_info['query_see_board'] .= 'AND CHAR_LENGTH(b.passwd) = 0';

file $sourcedir/Subs-BoardIndex.php

ค้นหา -->>
โค๊ด: [Select]
IFNULL(mods_mem.id_member, 0) AS id_moderator, mods_mem.real_name AS mod_real_name

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
, b.passwd

ค้นหา -->>
โค๊ด: [Select]
'href' => $scripturl . '?board=' . $row_board['id_board'] . '.0',

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'passwd' => !empty($row_board['passwd']),

ค้นหา -->>
โค๊ด: [Select]
// Find all boards and categories, as well as related information.  This will be sorted by the natural order of boards and categories, which we control.

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
if ($user_info['is_guest'])
$query_see_board = 'FIND_IN_SET(-1, b.member_groups)';
elseif ($user_info['is_admin'])
$query_see_board = '1';
else
$query_see_board = '(FIND_IN_SET(' . implode(', b.member_groups) OR FIND_IN_SET(', $user_info['groups']) . ', b.member_groups))';

ค้นหา -->>
โค๊ด: [Select]
WHERE {query_see_board}'

แก้เป็น -->>
โค๊ด: [Select]
WHERE ' . $query_see_board

ค้นหา -->>
โค๊ด: [Select]
// Determine a global most recent topic.
if (!empty($boardIndexOptions['set_latest_post']) && !empty($row_board['poster_time']) && $row_board['poster_time'] > $latest_post['timestamp'] && !$ignoreThisBoard)
$latest_post = array(
'timestamp' => $row_board['poster_time'],
'ref' => &$this_category[$isChild ? $row_board['id_parent'] : $row_board['id_board']]['last_post'],
);

แก้เป็น -->>
โค๊ด: [Select]
// Determine a global most recent topic.
// Edited by Password Protect boards
if (!empty($boardIndexOptions['set_latest_post']) && !empty($row_board['poster_time']) && $row_board['poster_time'] > $latest_post['timestamp'] && !$ignoreThisBoard && (empty($row_board['passwd']) || in_array($row_board['id_board'], $_SESSION['board_access']) || $user_info['is_admin']))
$latest_post = array(
'timestamp' => $row_board['poster_time'],
'ref' => &$this_category[$isChild ? $row_board['id_parent'] : $row_board['id_board']]['last_post'],
);

file $sourcedir/Subs-Boards.php

โค๊ด: [Select]
if (isset($boardOptions['board_name']))
{
$boardUpdates[] = 'name = {string:board_name}';
$boardUpdateParameters['board_name'] = $boardOptions['board_name'];
}

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
if (isset($boardOptions['passwd']))
{
$boardUpdates[] = 'passwd = {string:passwd}';
$boardUpdateParameters['passwd'] = $boardOptions['passwd'];
}

ค้นหา -->>
โค๊ด: [Select]
b.num_posts, b.num_topics, c.id_cat, c.name AS cat_name, c.cat_order, c.can_collapse

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
, b.passwd

ค้นหา -->>
โค๊ด: [Select]
'prev_board' => $prevBoard

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
'passwd' => !empty($row['passwd']),

file $sourcedir/ManageBoards.php

ค้นหา -->>
โค๊ด: [Select]
'override_theme' => 0,

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
'passwd' => '',

ค้นหา -->>
โค๊ด: [Select]
$boardOptions['board_description'] = preg_replace('~[&]([^;]{8}|[^;]{0,8}$)~', '&$1', $_POST['desc']);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if ( $_POST['passwdBoard'] != "#FAKEPASSWORD" )
$boardOptions['passwd'] = !empty($_POST['passwdBoard']) ? sha1($boardOptions['board_name'] . $_POST['passwdBoard']) : '';

file $themedir/ManageBoards.template.php

ค้นหา -->>
โค๊ด: [Select]
if (!empty($context['board']['is_recycle']))

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
echo '
<div id="passwd_div">
<dl class="settings">
<dt>
<strong>', $txt['mpasswd_board'], ':</strong><br />
<span class="smalltext">', $txt['mpasswd_board_desc'], '</span><br />
</dt>
<dd>
<input type="password" name="passwdBoard" value="', $context['board']['passwd'] ? '#FAKEPASSWORD' : '', '" class="input_text" />
</dd>
</dl>
</div>';

file $themedir/BoardIndex.template.php

ค้นหา -->>
โค๊ด: [Select]
// Show some basic information about the number of posts, etc.

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
echo '
<p>';
if (!$context['user']['is_admin'] && !$context['user']['is_mod'] && !isset($board['moderators'][$context['user']['id']]) && $board['passwd'] && !in_array($board['id'], $_SESSION['board_access']))
echo '
', $txt['passwd_board'], '
<form style="display:inline" action="', $board['href'], '" method="post">
<input type="password" name="passwd" />
<input type="submit" value="', $txt['passwd_board_enter'], '" />
</form>';
else if ($board['passwd'])
echo '
<img src="', $settings['images_url'], '/icons/quick_lock.gif" style="vertical-align: bottom;" alt="', $txt['passwd_board_notice'], '" title="', $txt['passwd_board_notice'], '" />';
echo '
</p>';

ค้นหา -->>
โค๊ด: [Select]
if (!empty($board['last_post']['id']))

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($board['last_post']['id']) && (empty($board['passwd']) || in_array($board['id'], $_SESSION['board_access']) || $context['user']['is_admin']))

file $themedir/languages/Modifications.english.php

เพิ่ม -->>
โค๊ด: [Select]
// Password Protected Board
$txt['passwd_board'] = 'Please enter the board password: ';
$txt['mpasswd_board'] = 'Password for this board';
$txt['mpasswd_board_desc'] = 'Leave blank for no password';
$txt['passwd_board_enter'] = 'Enter Board';
$txt['passwd_board_notice'] = 'Board is protected';
$txt['passwd_board_error'] = 'This board is password protected and you have not provided the correct password during this session';

file $themedir/languages/Modifications.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
// Password Protected Board
$txt['passwd_board'] = 'กรุณาใส่รหัสผ่านบอร์ด: ';
$txt['mpasswd_board'] = 'รหัสผ่านสำหรับบอร์ดนี้';
$txt['mpasswd_board_desc'] = 'ปล่อยว่าง = ไม่มีรหัสผ่าน';
$txt['passwd_board_enter'] = 'ใส่ชื่อบอร์ด';
$txt['passwd_board_notice'] = 'บอร์ดมีการป้องกัน';
$txt['passwd_board_error'] = 'บอร์ดนี้มีรหัสผ่านป้องกันและคุณยังไม่ได้ใส่รหัสผ่านที่ถูกต้องในระหว่างเซสชันนี้';

ดาวน์โหลด: passwdBoard2.rar
ขออภัย! ส่วนนี้สงวนไว้เฉพาะสมาชิกเท่านั้น กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

แตกไฟล์แล้วอัพโหลดไปไว้ที่
file passwdBoard.php -->> $sourcedir
file passwdBoard.template.php -->> $themesdir/default

สร้างไฟล์: add_settings_20.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/add_settings_20.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?php

// If SSI.php is in the same place as this file, and SMF isn't defined, this is being run standalone.
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
// Hmm... no SSI.php and no SMF?
elseif (!defined('SMF'))
die('<b>Error:</b> Cannot install - please verify you put this in the same place as SMF\'s index.php.');
db_extend('Packages');

$smcFunc['db_add_column']('{db_prefix}boards', array('name' => 'passwd''type' => 'varchar''size' => 64), array(), 'ignore');
?>

การตั้งค่า: ผู้ดูแล -->> แก้ไขบอร์ด -->> รหัสผ่านสำหรับบอร์ดนี้

ลิงค์หัวข้อ: http://dexmore.com/topic/10847
Thx by 9mKunG
Windows NT 6.1    Firefox 10.0   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
*



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 1 เมื่อ: 5 กุมภาพันธ์ 2555, 22:55:11
ต้องขอบคุณมากๆครับ ลองทำตามดูแล้วใช้ได้เลยครับ ผมอ่านในเว็บของ SMF แล้วแต่ไม่มีไฟล์ password ให้เลยใช้งานไม่ได้ ต้องขอบคุณจริงๆครับ

ลิงค์หัวข้อ: http://dexmore.com/topic/10847
Windows XP    Firefox 10.0   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
*



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 2 เมื่อ: 22 มีนาคม 2555, 02:20:41
ขอบคุณครับ มีประโยชน์มาก เอาไว้ล๊อกโซนให้ความรู้การเจาะระบบ เข้าง่ายเดี๋ยวคนจะเอาไป Hack มั่ว

ลิงค์หัวข้อ: http://dexmore.com/topic/10847
Windows XP    Chrome 17.0.963.79   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
ส่งหัวข้อนี้พิมพ์ หน้า: 1 
กระโดดไป:  

Creative Commons License

SMF Thai Translation Powered by SMF © 2006–2012, Simple Machines LLC

WordPress Google เข้าเยี่ยมชมหน้านี้ล่าสุดเมื่อ : 12 พฤษภาคม 2555, 04:56:57

jQuery Plugin Copyright © 2551-2555 Themes Design & Hosting by DexMoreGroup

Sitemap | Thai Simple Machines Forum support SMF Thai

Web Begining | SMF Modifications | SMF Thai Translation Web Begining

Drupal | WordPress | CMS Joomla | jQuery Plugin | Web Graphics CMS Joomla