Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
111
Hasil Nilai Pretest
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
113
//id nomor soal $nomor=$id_soal[$i]; //jika user tidak memilih jawaban if (empty($pilihan[$nomor])){ $kosong++; }else{ //jawaban dari user $jawaban=$pilihan[$nomor]; //cocokan jawaban user dengan jawaban di database $query=mysql_query("select * from soal where id_soal='$nomor' and jawaban_benar='$jawaban'");
} $score = $benar*5; } } Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
114
?>
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
117
Hasil Nilai Posttest
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
119
//id nomor soal $nomor=$id_soal[$i]; //jika user tidak memilih jawaban if (empty($pilihan[$nomor])){ $kosong++; }else{ //jawaban dari user $jawaban=$pilihan[$nomor];
//cocokan jawaban user dengan jawaban di database $query=mysql_query("select * from soal where id_soal='$nomor' and jawaban_benar='$jawaban'");
} $score = $benar*5; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
3. Index Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
125
<span class="name">Jaringan Komputer <span class="skills">Topologi Jaringan - Konsep Jaringan - Piranti Jaringan PreTest!
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
129
HASIL NILAI PRE TEST
HASIL NILAI POST TEST
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
137
Close
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Sumber: <strong>Modul Sekolah Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
140
Close
Video Materi
Judul: <strong>Tutorial Jaringan Dasar Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Source: <strong>Youtube Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
5. Daftar
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
152
$nama = $_POST['nama']; $password = $_POST['password']; $q1 = mysql_query("SELECT nis from siswa WHERE nis='$nis'"); $f1 = mysql_fetch_array($q1); $n1 = mysql_num_rows($q1); if ($n1 == 1){ $warning="Username sudah terdaftar!"; }else{ $query1 = mysql_query("INSERT INTO siswa (nis, nama, password) values ('$nis','$nama','$password')"); if(mysql_affected_rows()!=0){ header('location:index.php'); }else{ $warning="Data anda tidak tersimpan!"; } } } ?> <meta charset="utf-8" /> Multimedia Pembelajaran <meta name="description" content="An admin template from Square Turtle Studios" /> <meta name="author" content="Square Turtle Studios" />
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
156
6. Freelance.css /*! * Start Bootstrap - Freelancer Bootstrap Theme (http://startbootstrap.com) * Code licensed under the Apache License v2.0. * For details, see http://www.apache.org/licenses/LICENSE-2.0. */ body { overflow-x: hidden; } p{ font-size: 20px; } p.small { font-size: 16px; } Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
158
hr.star-light { border-color: #fff; } hr.star-light:after { color: #fff; background-color: #18bc9c; } hr.star-primary { border-color: #2c3e50; } hr.star-primary:after { color: #2c3e50; background-color: #fff; } .img-centered { margin: -1px 154px; position: absolute; } header { text-align: center; color: #fff; background: #18bc9c; } header .container { padding-top: 100px; padding-bottom: 50px; } header img { display: block; margin: 0 auto 20px; } header .intro-text .name { display: block; text-transform: uppercase; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
159
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 2em; font-weight: 700; } header .intro-text .skills { font-size: 1.25em; font-weight: 300; } @media(min-width:768px) { header .container { padding-top: 200px; padding-bottom: 100px; } header .intro-text .name { font-size: 4.75em; } header .intro-text .skills { font-size: 1.75em; } } @media(min-width:768px) { .navbar-fixed-top { padding: 25px 0; -webkit-transition: padding .3s; -moz-transition: padding .3s; transition: padding .3s; } .navbar-fixed-top .navbar-brand { font-size: 2em; -webkit-transition: all .3s; -moz-transition: all .3s; transition: all .3s; } .navbar-fixed-top.navbar-shrink { padding: 10px 0; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
160
} .navbar-fixed-top.navbar-shrink .navbar-brand { font-size: 1.5em; } } .navbar { text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 700; } .navbar a:focus { outline: 0; } .navbar .navbar-nav { letter-spacing: 1px; } .navbar .navbar-nav li a:focus { outline: 0; } .navbar-default, .navbar-inverse { border: 0; } section { padding: 100px 0; } section h2 { margin: 0; font-size: 3em; } section.success { color: #fff; background: #18bc9c; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
161
} section.success a, section.success a:hover, section.success a:focus, section.success a:active, section.success a.active { outline: 0; color: #2c3e50; } @media(max-width:767px) { section { padding: 75px 0; } section.first { padding-top: 75px; } } #portfolio .portfolio-item { right: 0; margin: 0 0 15px; } #portfolio .portfolio-item .portfolio-link { display: block; position: relative; margin: 0 auto; max-width: 400px; } #portfolio .portfolio-item .portfolio-link .caption { position: absolute; width: 100%; height: 100%; opacity: 0; background: rgba(24,188,156,.9); -webkit-transition: all ease .5s; -moz-transition: all ease .5s; transition: all ease .5s; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
'action-in-url' => array('Source-File.php', 'FunctionToCall'), Then, you can access the FunctionToCall() function from SourceFile.php with the URL index.php?action=action-in-url. Relatively simple, no? */ $forum_version = 'SMF 2.0.11'; @ini_set('memory_limit', '128M'); // Get everything started up... define('SMF', 1); if (function_exists('set_magic_quotes_runtime')) @set_magic_quotes_runtime(0); error_reporting(defined('E_STRICT') ? E_ALL | E_STRICT : E_ALL); $time_start = microtime(); // This makes it so headers can be sent! ob_start(); // Do some cleaning, just in case. foreach (array('db_character_set', 'cachedir') as $variable) if (isset($GLOBALS[$variable])) unset($GLOBALS[$variable], $GLOBALS[$variable]); // Load the settings... require_once(dirname(__FILE__) . '/Settings.php'); // Make absolutely sure the cache directory is defined. if ((empty($cachedir) || !file_exists($cachedir)) && file_exists($boarddir . '/cache')) $cachedir = $boarddir . '/cache'; // And important includes. require_once($sourcedir . '/QueryString.php'); require_once($sourcedir . '/Subs.php'); require_once($sourcedir . '/Errors.php'); require_once($sourcedir . '/Load.php'); require_once($sourcedir . '/Security.php'); // Using an pre-PHP 5.1 version? Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
169
if (@version_compare(PHP_VERSION, '5.1') == -1) require_once($sourcedir . '/Subs-Compat.php'); // If $maintenance is set specifically to 2, then we're upgrading or something. if (!empty($maintenance) && $maintenance == 2) db_fatal_error(); // Create a variable to store some SMF specific functions in. $smcFunc = array(); // Initate the database connection and define some database functions to use. loadDatabase(); // Load the settings from the settings table, and perform operations like optimizing. reloadSettings(); // Clean the request variables, add slashes, etc. cleanRequest(); $context = array(); // Seed the random generator. if (empty($modSettings['rand_seed']) || mt_rand(1, 250) == 69) smf_seed_generator(); // Before we get carried away, are we doing a scheduled task? If so save CPU cycles by jumping out! if (isset($_GET['scheduled'])) { require_once($sourcedir . '/ScheduledTasks.php'); AutoTask(); } // Check if compressed output is enabled, supported, and not already being done. if (!empty($modSettings['enableCompressedOutput']) && !headers_sent()) { // If zlib is being used, turn off output compression. if (@ini_get('zlib.output_compression') == '1' || @ini_get('output_handler') == 'ob_gzhandler' || @version_compare(PHP_VERSION, '4.2.0') == -1) $modSettings['enableCompressedOutput'] = '0'; else Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
170
{ ob_end_clean(); ob_start('ob_gzhandler'); } } // Emit some headers for some modicum of protection against nasties. if (!headers_sent()) { // Future versions will make some of this configurable. This is primarily a 'safe' configuration for most cases for now. header('X-Frame-Options: SAMEORIGIN'); header('X-XSS-Protection: 1'); header('X-Content-Type-Options: nosniff'); } // Register an error handler. set_error_handler('error_handler'); // Start the session. (assuming it hasn't already been.) loadSession(); // Determine if this is using WAP, WAP2, or imode. Technically, we should check that wap comes before application/xhtml or text/html, but this doesn't work in practice as much as it should. if (isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode'])) unset($_SESSION['nowap']); elseif (isset($_REQUEST['nowap'])) $_SESSION['nowap'] = true; elseif (!isset($_SESSION['nowap'])) { if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false) $_REQUEST['wap2'] = 1; elseif (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false) { if (strpos($_SERVER['HTTP_USER_AGENT'], 'DoCoMo/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'portalmmm/') !== false) Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
171
$_REQUEST['imode'] = 1; else $_REQUEST['wap'] = 1; } } if (!defined('WIRELESS')) define('WIRELESS', isset($_REQUEST['wap']) || isset($_REQUEST['wap2']) || isset($_REQUEST['imode'])); // Some settings and headers are different for wireless protocols. if (WIRELESS) { define('WIRELESS_PROTOCOL', isset($_REQUEST['wap']) ? 'wap' : (isset($_REQUEST['wap2']) ? 'wap2' : (isset($_REQUEST['imode']) ? 'imode' : ''))); // Some cellphones can't handle output compression... $modSettings['enableCompressedOutput'] = '0'; // !!! Do we want these hard coded? $modSettings['defaultMaxMessages'] = 5; $modSettings['defaultMaxTopics'] = 9; // Wireless protocol header. if (WIRELESS_PROTOCOL == 'wap') header('Content-Type: text/vnd.wap.wml'); } // Restore post data if we are revalidating OpenID. if (isset($_GET['openid_restore_post']) && !empty($_SESSION['openid']['saved_data'][$_GET['openid_restore_post']]['p ost']) && empty($_POST)) { $_POST = $_SESSION['openid']['saved_data'][$_GET['openid_restore_post']]['post']; unset($_SESSION['openid']['saved_data'][$_GET['openid_restore_pos t']]); } // What function shall we execute? (done like this for memory's sake.) call_user_func(smf_main());
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
172
// Call obExit specially; we're coming from the main area ;). obExit(null, null, true); // The main controlling function. function smf_main() { global $modSettings, $settings, $user_info, $board, $topic, $board_info, $maintenance, $sourcedir; // Special case: session keep-alive, output a transparent pixel. if (isset($_GET['action']) && $_GET['action'] == 'keepalive') { header('Content-Type: image/gif'); die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x0 0\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\ x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"); } // Load the user's cookie (or set as guest) and load their settings. loadUserSettings(); // Load the current board's information. loadBoard(); // Load the current user's permissions. loadPermissions(); // Attachments don't require the entire theme to be loaded. if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'dlattach' && (!empty($modSettings['allow_guestAccess']) && $user_info['is_guest'])) detectBrowser(); // Load the current theme. (note that ?theme=1 will also work, may be used for guest theming.) else loadTheme(); // Check if the user should be disallowed access. is_not_banned();
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
173
// If we are in a topic and don't have permission to approve it then duck out now. if (!empty($topic) && empty($board_info['cur_topic_approved']) && !allowedTo('approve_posts') && ($user_info['id'] != $board_info['cur_topic_starter'] || $user_info['is_guest'])) fatal_lang_error('not_a_topic', false); // Do some logging, unless this is an attachment, avatar, toggle of editor buttons, theme option, XML feed etc. if (empty($_REQUEST['action']) || !in_array($_REQUEST['action'], array('dlattach', 'findmember', 'jseditor', 'jsoption', 'requestmembers', 'smstats', '.xml', 'xmlhttp', 'verificationcode', 'viewquery', 'viewsmfile'))) { // Log this user as online. writeLog(); // Track forum statistics and hits...? if (!empty($modSettings['hitStats'])) trackStats(array('hits' => '+')); } // Is the forum in maintenance mode? (doesn't apply to administrators.) if (!empty($maintenance) && !allowedTo('admin_forum')) { // You can only login.... otherwise, you're getting the "maintenance mode" display. if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'login2' || $_REQUEST['action'] == 'logout')) { require_once($sourcedir . '/LogInOut.php'); return $_REQUEST['action'] == 'login2' ? 'Login2' : 'Logout'; } // Don't even try it, sonny. else { require_once($sourcedir . '/Subs-Auth.php'); return 'InMaintenance'; } } // If guest access is off, a guest can only do one of the very few following actions. Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
174
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('coppa', 'login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', 'smstats', 'mailq', 'verificationcode', 'openidreturn')))) { require_once($sourcedir . '/Subs-Auth.php'); return 'KickGuest'; } elseif (empty($_REQUEST['action'])) { // Action and board are both empty... BoardIndex! if (empty($board) && empty($topic)) { require_once($sourcedir . '/BoardIndex.php'); return 'BoardIndex'; } // Topic is empty, and action is empty.... MessageIndex! elseif (empty($topic)) { require_once($sourcedir . '/MessageIndex.php'); return 'MessageIndex'; } // Board is not empty... topic is not empty... action is empty.. Display! else { require_once($sourcedir . '/Display.php'); return 'Display'; } } // Here's the monstrous $_REQUEST['action'] array $_REQUEST['action'] => array($file, $function). $actionArray = array( 'activate' => array('Register.php', 'Activate'), 'admin' => array('Admin.php', 'AdminMain'), 'announce' => array('Post.php', 'AnnounceTopic'), 'attachapprove' => array('ManageAttachments.php', 'ApproveAttach'), 'buddy' => array('Subs-Members.php', 'BuddyListToggle'), 'calendar' => array('Calendar.php', 'CalendarMain'), Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
177
// Get the function and file to include - if it's not there, do the board index. if (!isset($_REQUEST['action']) || !isset($actionArray[$_REQUEST['action']])) { // Catch the action with the theme? if (!empty($settings['catch_action'])) { require_once($sourcedir . '/Themes.php'); return 'WrapAction'; } // Fall through to the board index then... require_once($sourcedir . '/BoardIndex.php'); return 'BoardIndex'; } // Otherwise, it was set - so let's go to that action. require_once($sourcedir . '/' . $actionArray[$_REQUEST['action']][0]); return $actionArray[$_REQUEST['action']][1]; } ?>
8. Register
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
178
/*
This file has two main jobs, but they really are one. It registers new members, and it helps the administrator moderate member registrations. Similarly, it handles account activation as well. void Register() // !!! void Register2() // !!! void Activate() // !!! void CoppaForm() // !!! void VerificationCode() // Show the verification code or let it hear. void RegisterCheckUsername() // !!! */ // Begin the registration process. function Register($reg_errors = array()) { global $txt, $boarddir, $context, $settings, $modSettings, $user_info; global $language, $scripturl, $smcFunc, $sourcedir, $smcFunc, $cur_profile; // Is this an incoming AJAX check? if (isset($_GET['sa']) && $_GET['sa'] == 'usernamecheck') return RegisterCheckUsername(); // Check if the administrator has it disabled. if (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 3) fatal_lang_error('registration_disabled', false);
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
179
// If this user is an admin - redirect them to the admin registration page. if (allowedTo('moderate_forum') && !$user_info['is_guest']) redirectexit('action=admin;area=regcenter;sa=register'); // You are not a guest, so you are a member - and members don't get to register twice! elseif (empty($user_info['is_guest'])) redirectexit(); loadLanguage('Login'); loadTemplate('Register'); // Do we need them to agree to the registration agreement, first? $context['require_agreement'] = !empty($modSettings['requireAgreement']); $context['registration_passed_agreement'] = !empty($_SESSION['registration_agreed']); $context['show_coppa'] = !empty($modSettings['coppaAge']); // Under age restrictions? if ($context['show_coppa']) { $context['skip_coppa'] = false; $context['coppa_agree_above'] = sprintf($txt['agreement_agree_coppa_above'], $modSettings['coppaAge']); $context['coppa_agree_below'] = sprintf($txt['agreement_agree_coppa_below'], $modSettings['coppaAge']); } // What step are we at? $current_step = isset($_REQUEST['step']) ? (int) $_REQUEST['step'] : ($context['require_agreement'] ? 1 : 2); // Does this user agree to the registation agreement? if ($current_step == 1 && (isset($_POST['accept_agreement']) || isset($_POST['accept_agreement_coppa']))) { $context['registration_passed_agreement'] = $_SESSION['registration_agreed'] = true; $current_step = 2; // Skip the coppa procedure if the user says he's old enough. Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
180
if ($context['show_coppa']) { $_SESSION['skip_coppa'] = !empty($_POST['accept_agreement']); // Are they saying they're under age, while under age registration is disabled? if (empty($modSettings['coppaType']) && empty($_SESSION['skip_coppa'])) { loadLanguage('Login'); fatal_lang_error('under_age_registration_prohibited', false, array($modSettings['coppaAge'])); } } } // Make sure they don't squeeze through without agreeing. elseif ($current_step > 1 && $context['require_agreement'] && !$context['registration_passed_agreement']) $current_step = 1; // Show the user the right form. $context['sub_template'] = $current_step == 1 ? 'registration_agreement' : 'registration_form'; $context['page_title'] = $current_step == 1 ? $txt['registration_agreement'] : $txt['registration_form']; // Add the register chain to the link tree. $context['linktree'][] = array( 'url' => $scripturl . '?action=register', 'name' => $txt['register'], ); // If you have to agree to the agreement, it needs to be fetched from the file. if ($context['require_agreement']) { // Have we got a localized one? if (file_exists($boarddir . '/agreement.' . $user_info['language'] . '.txt'))
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
181
$context['agreement'] = parse_bbc(file_get_contents($boarddir . '/agreement.' . $user_info['language'] . '.txt'), true, 'agreement_' . $user_info['language']); elseif (file_exists($boarddir . '/agreement.txt')) $context['agreement'] = parse_bbc(file_get_contents($boarddir . '/agreement.txt'), true, 'agreement'); else $context['agreement'] = ''; } if (!empty($modSettings['userLanguage'])) { $selectedLanguage = empty($_SESSION['language']) ? $language : $_SESSION['language']; // Do we have any languages? if (empty($context['languages'])) getLanguages(); // Try to find our selected language. foreach ($context['languages'] as $key => $lang) { $context['languages'][$key]['name'] = strtr($lang['name'], array('-utf8' => '')); // Found it! if ($selectedLanguage == $lang['filename']) $context['languages'][$key]['selected'] = true; } } // Any custom fields we want filled in? require_once($sourcedir . '/Profile.php'); loadCustomFields(0, 'register'); // Or any standard ones? if (!empty($modSettings['registration_fields'])) { require_once($sourcedir . '/Profile-Modify.php'); // Setup some important context. loadLanguage('Profile'); Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
182
loadTemplate('Profile'); $context['user']['is_owner'] = true; // Here, and here only, emulate the permissions the user would have to do this. $user_info['permissions'] = array_merge($user_info['permissions'], array('profile_account_own', 'profile_extra_own')); $reg_fields = explode(',', $modSettings['registration_fields']); // We might have had some submissions on this front - go check. foreach ($reg_fields as $field) if (isset($_POST[$field])) $cur_profile[$field] = $smcFunc['htmlspecialchars']($_POST[$field]); // Load all the fields in question. setupProfileContext($reg_fields); } // Generate a visual verification code to make sure the user is no bot. if (!empty($modSettings['reg_verification'])) { require_once($sourcedir . '/Subs-Editor.php'); $verificationOptions = array( 'id' => 'register', ); $context['visual_verification'] = create_control_verification($verificationOptions); $context['visual_verification_id'] = $verificationOptions['id']; } // Otherwise we have nothing to show. else $context['visual_verification'] = false; // Are they coming from an OpenID login attempt? if (!empty($_SESSION['openid']['verified']) && !empty($_SESSION['openid']['openid_uri'])) { $context['openid'] = $_SESSION['openid']['openid_uri']; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
183
$context['username'] = $smcFunc['htmlspecialchars'](!empty($_POST['user']) ? $_POST['user'] : $_SESSION['openid']['nickname']); $context['email'] = $smcFunc['htmlspecialchars'](!empty($_POST['email']) ? $_POST['email'] : $_SESSION['openid']['email']); } // See whether we have some prefiled values. else { $context += array( 'openid' => isset($_POST['openid_identifier']) ? $_POST['openid_identifier'] : '', 'username' => isset($_POST['user']) ? $smcFunc['htmlspecialchars']($_POST['user']) : '', 'email' => isset($_POST['email']) ? $smcFunc['htmlspecialchars']($_POST['email']) : '', ); } // !!! Why isn't this a simple set operation? // Were there any errors? $context['registration_errors'] = array(); if (!empty($reg_errors)) foreach ($reg_errors as $error) $context['registration_errors'][] = $error; } // Actually register the member. function Register2($verifiedOpenID = false) { global $scripturl, $txt, $modSettings, $context, $sourcedir; global $user_info, $options, $settings, $smcFunc; // Start collecting together any errors. $reg_errors = array(); // Did we save some open ID fields? if ($verifiedOpenID && !empty($context['openid_save_fields'])) { foreach ($context['openid_save_fields'] as $id => $value) $_POST[$id] = $value; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
184
} // You can't register if it's disabled. if (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 3) fatal_lang_error('registration_disabled', false); // Things we don't do for people who have already confirmed their OpenID allegances via register. if (!$verifiedOpenID) { // Well, if you don't agree, you can't register. if (!empty($modSettings['requireAgreement']) && empty($_SESSION['registration_agreed'])) redirectexit(); // Make sure they came from *somewhere*, have a session. if (!isset($_SESSION['old_url'])) redirectexit('action=register'); // Are they under age, and under age users are banned? if (!empty($modSettings['coppaAge']) && empty($modSettings['coppaType']) && empty($_SESSION['skip_coppa'])) { // !!! This should be put in Errors, imho. loadLanguage('Login'); fatal_lang_error('under_age_registration_prohibited', false, array($modSettings['coppaAge'])); } // Check whether the visual verification code was entered correctly. if (!empty($modSettings['reg_verification'])) { require_once($sourcedir . '/Subs-Editor.php'); $verificationOptions = array( 'id' => 'register', ); $context['visual_verification'] = create_control_verification($verificationOptions, true); if (is_array($context['visual_verification'])) Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
185
{ loadLanguage('Errors'); foreach ($context['visual_verification'] as $error) $reg_errors[] = $txt['error_' . $error]; } } } foreach ($_POST as $key => $value) { if (!is_array($_POST[$key])) $_POST[$key] = htmltrim__recursive(str_replace(array("\n", "\r"), '', $_POST[$key])); } // Collect all extra registration fields someone might have filled in. $possible_strings = array( 'website_url', 'website_title', 'aim', 'yim', 'location', 'birthdate', 'time_format', 'buddy_list', 'pm_ignore_list', 'smiley_set', 'signature', 'personal_text', 'avatar', 'lngfile', 'secret_question', 'secret_answer', ); $possible_ints = array( 'pm_email_notify', 'notify_types', 'icq', 'gender', 'id_theme', ); $possible_floats = array( 'time_offset', ); $possible_bools = array( 'notify_announcements', 'notify_regularity', 'notify_send_body', 'hide_email', 'show_online', Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
186
); if (isset($_POST['secret_answer']) && $_POST['secret_answer'] != '') $_POST['secret_answer'] = md5($_POST['secret_answer']); // Needed for isReservedName() and registerMember(). require_once($sourcedir . '/Subs-Members.php'); // Validation... even if we're not a mall. if (isset($_POST['real_name']) && (!empty($modSettings['allow_editDisplayName']) || allowedTo('moderate_forum'))) { $_POST['real_name'] = trim(preg_replace('~[\t\n\r \x0B\0' . ($context['utf8'] ? ($context['server']['complex_preg_chars'] ? '\x{A0}\x{AD}\x{2000}-\x{200F}\x{201F}\x{202F}\x{3000}\x{FEFF}' : "\xC2\xA0\xC2\xAD\xE2\x80\x80\xE2\x80\x8F\xE2\x80\x9F\xE2\x80\xAF\xE2\x80\x9F\xE3\x80\x80\xEF\xB B\xBF") : '\x00-\x08\x0B\x0C\x0E-\x19\xA0') . ']+~' . ($context['utf8'] ? 'u' : ''), ' ', $_POST['real_name'])); if (trim($_POST['real_name']) != '' && !isReservedName($_POST['real_name']) && $smcFunc['strlen']($_POST['real_name']) < 60) $possible_strings[] = 'real_name'; } if (isset($_POST['msn']) && preg_match('~^[0-9A-Za-z=_+\-/][0-9AZa-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $_POST['msn']) != 0) $profile_strings[] = 'msn'; // Handle a string as a birthdate... if (isset($_POST['birthdate']) && $_POST['birthdate'] != '') $_POST['birthdate'] = strftime('%Y-%m-%d', strtotime($_POST['birthdate'])); // Or birthdate parts... elseif (!empty($_POST['bday1']) && !empty($_POST['bday2'])) $_POST['birthdate'] = sprintf('%04d-%02d-%02d', empty($_POST['bday3']) ? 0 : (int) $_POST['bday3'], (int) $_POST['bday1'], (int) $_POST['bday2']); // By default assume email is hidden, only show it if we tell it to. $_POST['hide_email'] = !empty($_POST['allow_email']) ? 0 : 1; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
187
// Validate the passed language file. if (isset($_POST['lngfile']) && !empty($modSettings['userLanguage'])) { // Do we have any languages? if (empty($context['languages'])) getLanguages(); // Did we find it? if (isset($context['languages'][$_POST['lngfile']])) $_SESSION['language'] = $_POST['lngfile']; else unset($_POST['lngfile']); } else unset($_POST['lngfile']); // Some of these fields we may not want. if (!empty($modSettings['registration_fields'])) { // But we might want some of them if the admin asks for them. $standard_fields = array('icq', 'msn', 'aim', 'yim', 'location', 'gender'); $reg_fields = explode(',', $modSettings['registration_fields']); $exclude_fields = array_diff($standard_fields, $reg_fields); // Website is a little different if (!in_array('website', $reg_fields)) $exclude_fields = array_merge($exclude_fields, array('website_url', 'website_title')); // We used to accept signature on registration but it's being abused by spammers these days, so no more. $exclude_fields[] = 'signature'; } else $exclude_fields = array('signature', 'icq', 'msn', 'aim', 'yim', 'location', 'gender', 'website_url', 'website_title'); $possible_strings = array_diff($possible_strings, $exclude_fields); Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
188
$possible_ints = array_diff($possible_ints, $exclude_fields); $possible_floats = array_diff($possible_floats, $exclude_fields); $possible_bools = array_diff($possible_bools, $exclude_fields); // Set the options needed for registration. $regOptions = array( 'interface' => 'guest', 'username' => !empty($_POST['user']) ? $_POST['user'] : '', 'email' => !empty($_POST['email']) ? $_POST['email'] : '', 'password' => !empty($_POST['passwrd1']) ? $_POST['passwrd1'] : '', 'password_check' => !empty($_POST['passwrd2']) ? $_POST['passwrd2'] : '', 'openid' => !empty($_POST['openid_identifier']) ? $_POST['openid_identifier'] : '', 'auth_method' => !empty($_POST['authenticate']) ? $_POST['authenticate'] : '', 'check_reserved_name' => true, 'check_password_strength' => true, 'check_email_ban' => true, 'send_welcome_email' => !empty($modSettings['send_welcomeEmail']), 'require' => !empty($modSettings['coppaAge']) && !$verifiedOpenID && empty($_SESSION['skip_coppa']) ? 'coppa' : (empty($modSettings['registration_method']) ? 'nothing' : ($modSettings['registration_method'] == 1 ? 'activation' : 'approval')), 'extra_register_vars' => array(), 'theme_vars' => array(), ); // Include the additional options that might have been filled in. foreach ($possible_strings as $var) if (isset($_POST[$var])) $regOptions['extra_register_vars'][$var] = $smcFunc['htmlspecialchars']($_POST[$var], ENT_QUOTES); foreach ($possible_ints as $var) if (isset($_POST[$var])) $regOptions['extra_register_vars'][$var] = (int) $_POST[$var]; foreach ($possible_floats as $var) if (isset($_POST[$var]))
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
189
$regOptions['extra_register_vars'][$var] = (float) $_POST[$var]; foreach ($possible_bools as $var) if (isset($_POST[$var])) $regOptions['extra_register_vars'][$var] = empty($_POST[$var]) ? 0 : 1; // Registration options are always default options... if (isset($_POST['default_options'])) $_POST['options'] = isset($_POST['options']) ? $_POST['options'] + $_POST['default_options'] : $_POST['default_options']; $regOptions['theme_vars'] = isset($_POST['options']) && is_array($_POST['options']) ? $_POST['options'] : array(); // Make sure they are clean, dammit! $regOptions['theme_vars'] = htmlspecialchars__recursive($regOptions['theme_vars']); // If Quick Reply hasn't been set then set it to be shown but collapsed. if (!isset($regOptions['theme_vars']['display_quick_reply'])) $regOptions['theme_vars']['display_quick_reply'] = 1; // Check whether we have fields that simply MUST be displayed? $request = $smcFunc['db_query']('', ' SELECT col_name, field_name, field_type, field_length, mask, show_reg FROM {db_prefix}custom_fields WHERE active = {int:is_active}', array( 'is_active' => 1, ) ); $custom_field_errors = array(); while ($row = $smcFunc['db_fetch_assoc']($request)) { // Don't allow overriding of the theme variables. if (isset($regOptions['theme_vars'][$row['col_name']])) unset($regOptions['theme_vars'][$row['col_name']]); // Not actually showing it then? if (!$row['show_reg']) continue; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
190
// Prepare the value! $value = isset($_POST['customfield'][$row['col_name']]) ? trim($_POST['customfield'][$row['col_name']]) : ''; // We only care for text fields as the others are valid to be empty. if (!in_array($row['field_type'], array('check', 'select', 'radio'))) { // Is it too long? if ($row['field_length'] && $row['field_length'] < $smcFunc['strlen']($value)) $custom_field_errors[] = array('custom_field_too_long', array($row['field_name'], $row['field_length'])); // Any masks to apply? if ($row['field_type'] == 'text' && !empty($row['mask']) && $row['mask'] != 'none') { //!!! We never error on this - just ignore it at the moment... if ($row['mask'] == 'email' && (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\]+)*(\.[\w]{2,6})$~', $value) === 0 || strlen($value) > 255)) $custom_field_errors[] = array('custom_field_invalid_email', array($row['field_name'])); elseif ($row['mask'] == 'number' && preg_match('~[^\d]~', $value)) $custom_field_errors[] = array('custom_field_not_number', array($row['field_name'])); elseif (substr($row['mask'], 0, 5) == 'regex' && trim($value) != '' && preg_match(substr($row['mask'], 5), $value) === 0) $custom_field_errors[] = array('custom_field_inproper_format', array($row['field_name'])); } } // Is this required but not there? if (trim($value) == '' && $row['show_reg'] > 1) $custom_field_errors[] = array('custom_field_empty', array($row['field_name'])); Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
191
} $smcFunc['db_free_result']($request); // Process any errors. if (!empty($custom_field_errors)) { loadLanguage('Errors'); foreach ($custom_field_errors as $error) $reg_errors[] = vsprintf($txt['error_' . $error[0]], $error[1]); } // Lets check for other errors before trying to register the member. if (!empty($reg_errors)) { $_REQUEST['step'] = 2; return Register($reg_errors); } // If they're wanting to use OpenID we need to validate them first. if (empty($_SESSION['openid']['verified']) && !empty($_POST['authenticate']) && $_POST['authenticate'] == 'openid') { // What do we need to save? $save_variables = array(); foreach ($_POST as $k => $v) if (!in_array($k, array('sc', 'sesc', $context['session_var'], 'passwrd1', 'passwrd2', 'regSubmit'))) $save_variables[$k] = $v; require_once($sourcedir . '/Subs-OpenID.php'); smf_openID_validate($_POST['openid_identifier'], false, $save_variables); } // If we've come from OpenID set up some default stuff. elseif ($verifiedOpenID || (!empty($_POST['openid_identifier']) && $_POST['authenticate'] == 'openid')) { $regOptions['username'] = !empty($_POST['user']) && trim($_POST['user']) != '' ? $_POST['user'] : $_SESSION['openid']['nickname'];
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
192
$regOptions['email'] = !empty($_POST['email']) && trim($_POST['email']) != '' ? $_POST['email'] : $_SESSION['openid']['email']; $regOptions['auth_method'] = 'openid'; $regOptions['openid'] = !empty($_POST['openid_identifier']) ? $_POST['openid_identifier'] : $_SESSION['openid']['openid_uri']; } $memberID = registerMember($regOptions, true); // What there actually an error of some kind dear boy? if (is_array($memberID)) { $reg_errors = array_merge($reg_errors, $memberID); $_REQUEST['step'] = 2; return Register($reg_errors); } // Do our spam protection now. spamProtection('register'); // We'll do custom fields after as then we get to use the helper function! if (!empty($_POST['customfield'])) { require_once($sourcedir . '/Profile.php'); require_once($sourcedir . '/Profile-Modify.php'); makeCustomFieldChanges($memberID, 'register'); } // If COPPA has been selected then things get complicated, setup the template. if (!empty($modSettings['coppaAge']) && empty($_SESSION['skip_coppa'])) redirectexit('action=coppa;member=' . $memberID); // Basic template variable setup. elseif (!empty($modSettings['registration_method'])) { loadTemplate('Register'); $context += array( 'page_title' => $txt['register'], Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
193
'title' => $txt['registration_successful'], 'sub_template' => 'after', 'description' => $modSettings['registration_method'] == 2 ? $txt['approval_after_registration'] : $txt['activate_after_registration'] ); } else { call_integration_hook('integrate_activate', array($row['member_name'])); setLoginCookie(60 * $modSettings['cookieTime'], $memberID, sha1(sha1(strtolower($regOptions['username']) . $regOptions['password']) . $regOptions['register_vars']['password_salt'])); redirectexit('action=login2;sa=check;member=' . $memberID, $context['server']['needs_login_fix']); } } function Activate() { global $context, $txt, $modSettings, $scripturl, $sourcedir, $smcFunc, $language; loadLanguage('Login'); loadTemplate('Login'); if (empty($_REQUEST['u']) && empty($_POST['user'])) { if (empty($modSettings['registration_method']) || $modSettings['registration_method'] == 3) fatal_lang_error('no_access', false); $context['member_id'] = 0; $context['sub_template'] = 'resend'; $context['page_title'] = $txt['invalid_activation_resend']; $context['can_activate'] = empty($modSettings['registration_method']) || $modSettings['registration_method'] == 1; $context['default_username'] = isset($_GET['user']) ? $_GET['user'] : ''; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
194
return; } // Get the code from the database... $request = $smcFunc['db_query']('', ' SELECT id_member, validation_code, member_name, real_name, email_address, is_activated, passwd, lngfile FROM {db_prefix}members' . (empty($_REQUEST['u']) ? ' WHERE member_name = {string:email_address} OR email_address = {string:email_address}' : ' WHERE id_member = {int:id_member}') . ' LIMIT 1', array( 'id_member' => isset($_REQUEST['u']) ? (int) $_REQUEST['u'] : 0, 'email_address' => isset($_POST['user']) ? $_POST['user'] : '', ) ); // Does this user exist at all? if ($smcFunc['db_num_rows']($request) == 0) { $context['sub_template'] = 'retry_activate'; $context['page_title'] = $txt['invalid_userid']; $context['member_id'] = 0; return; } $row = $smcFunc['db_fetch_assoc']($request); $smcFunc['db_free_result']($request); // Change their email address? (they probably tried a fake one first :P.) if (isset($_POST['new_email'], $_REQUEST['passwd']) && sha1(strtolower($row['member_name']) . $_REQUEST['passwd']) == $row['passwd'] && ($row['is_activated'] == 0 || $row['is_activated'] == 2)) { if (empty($modSettings['registration_method']) || $modSettings['registration_method'] == 3) fatal_lang_error('no_access', false); Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
195
// !!! Separate the sprintf? if (preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', $_POST['new_email']) == 0) fatal_error(sprintf($txt['valid_email_needed'], htmlspecialchars($_POST['new_email'])), false); // Make sure their email isn't banned. isBannedEmail($_POST['new_email'], 'cannot_register', $txt['ban_register_prohibited']); // Ummm... don't even dare try to take someone else's email!! $request = $smcFunc['db_query']('', ' SELECT id_member FROM {db_prefix}members WHERE email_address = {string:email_address} LIMIT 1', array( 'email_address' => $_POST['new_email'], ) ); // !!! Separate the sprintf? if ($smcFunc['db_num_rows']($request) != 0) fatal_lang_error('email_in_use', false, array(htmlspecialchars($_POST['new_email']))); $smcFunc['db_free_result']($request); updateMemberData($row['id_member'], array('email_address' => $_POST['new_email'])); $row['email_address'] = $_POST['new_email']; $email_change = true; } // Resend the password, but only if the account wasn't activated yet. if (!empty($_REQUEST['sa']) && $_REQUEST['sa'] == 'resend' && ($row['is_activated'] == 0 || $row['is_activated'] == 2) && (!isset($_REQUEST['code']) || $_REQUEST['code'] == '')) { require_once($sourcedir . '/Subs-Post.php'); $replacements = array( Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
196
'REALNAME' => $row['real_name'], 'USERNAME' => $row['member_name'], 'ACTIVATIONLINK' => $scripturl . '?action=activate;u=' . $row['id_member'] . ';code=' . $row['validation_code'], 'ACTIVATIONLINKWITHOUTCODE' => $scripturl . '?action=activate;u=' . $row['id_member'], 'ACTIVATIONCODE' => $row['validation_code'], 'FORGOTPASSWORDLINK' => $scripturl . '?action=reminder', ); $emaildata = loadEmailTemplate('resend_activate_message', $replacements, empty($row['lngfile']) || empty($modSettings['userLanguage']) ? $language : $row['lngfile']); sendmail($row['email_address'], $emaildata['subject'], $emaildata['body'], null, null, false, 0); $context['page_title'] = $txt['invalid_activation_resend']; // This will ensure we don't actually get an error message if it works! $context['error_title'] = ''; fatal_lang_error(!empty($email_change) ? 'change_email_success' : 'resend_email_success', false); } // Quit if this code is not right. if (empty($_REQUEST['code']) || $row['validation_code'] != $_REQUEST['code']) { if (!empty($row['is_activated'])) fatal_lang_error('already_activated', false); elseif ($row['validation_code'] == '') { loadLanguage('Profile'); fatal_error($txt['registration_not_approved'] . ' ' . $txt['here'] . '.', false); }
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
197
$context['sub_template'] = 'retry_activate'; $context['page_title'] = $txt['invalid_activation_code']; $context['member_id'] = $row['id_member']; return; } // Let the integration know that they've been activated! call_integration_hook('integrate_activate', array($row['member_name'])); // Validation complete - update the database! updateMemberData($row['id_member'], array('is_activated' => 1, 'validation_code' => '')); // Also do a proper member stat re-evaluation. updateStats('member', false); if (!isset($_POST['new_email'])) { require_once($sourcedir . '/Subs-Post.php'); adminNotify('activation', $row['id_member'], $row['member_name']); } $context += array( 'page_title' => $txt['registration_successful'], 'sub_template' => 'login', 'default_username' => $row['member_name'], 'default_password' => '', 'never_expire' => false, 'description' => $txt['activate_success'] ); } // This function will display the contact information for the forum, as well a form to fill in. function CoppaForm() { global $context, $modSettings, $txt, $smcFunc;
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
198
loadLanguage('Login'); loadTemplate('Register'); // No User ID?? if (!isset($_GET['member'])) fatal_lang_error('no_access', false); // Get the user details... $request = $smcFunc['db_query']('', ' SELECT member_name FROM {db_prefix}members WHERE id_member = {int:id_member} AND is_activated = {int:is_coppa}', array( 'id_member' => (int) $_GET['member'], 'is_coppa' => 5, ) ); if ($smcFunc['db_num_rows']($request) == 0) fatal_lang_error('no_access', false); list ($username) = $smcFunc['db_fetch_row']($request); $smcFunc['db_free_result']($request); if (isset($_GET['form'])) { // Some simple contact stuff for the forum. $context['forum_contacts'] = (!empty($modSettings['coppaPost']) ? $modSettings['coppaPost'] . '
' : '') . (!empty($modSettings['coppaFax']) ? $modSettings['coppaFax'] . ' ' : ''); $context['forum_contacts'] = !empty($context['forum_contacts']) ? $context['forum_name_html_safe'] . ' ' . $context['forum_contacts'] : ''; // Showing template? if (!isset($_GET['dl'])) { // Shortcut for producing underlines. $context['ul'] = ' &nb sp; '; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
'body' => str_replace('{MINIMUM_AGE}', $modSettings['coppaAge'], $txt['coppa_after_registration']), 'many_options' => !empty($modSettings['coppaPost']) && !empty($modSettings['coppaFax']), 'post' => empty($modSettings['coppaPost']) ? '' : $modSettings['coppaPost'], 'fax' => empty($modSettings['coppaFax']) ? '' : $modSettings['coppaFax'], 'phone' => empty($modSettings['coppaPhone']) ? '' : str_replace('{PHONE_NUMBER}', $modSettings['coppaPhone'], $txt['coppa_send_by_phone']), 'id' => $_GET['member'], ); } } // Show the verification code or let it hear. function VerificationCode() { global $sourcedir, $modSettings, $context, $scripturl; $verification_id = isset($_GET['vid']) ? $_GET['vid'] : ''; $code = $verification_id && isset($_SESSION[$verification_id . '_vv']) ? $_SESSION[$verification_id . '_vv']['code'] : (isset($_SESSION['visual_verification_code']) ? $_SESSION['visual_verification_code'] : ''); // Somehow no code was generated or the session was lost. if (empty($code)) { header('Content-Type: image/gif'); die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x0 0\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\ x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"); } // Show a window that will play the verification code. elseif (isset($_REQUEST['sound'])) { loadLanguage('Login'); loadTemplate('Register'); Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
201
$context['verification_sound_href'] = $scripturl . '?action=verificationcode;rand=' . md5(mt_rand()) . ($verification_id ? ';vid=' . $verification_id : '') . ';format=.wav'; $context['sub_template'] = 'verification_sound'; $context['template_layers'] = array(); obExit(); } // If we have GD, try the nice code. elseif (empty($_REQUEST['format'])) { require_once($sourcedir . '/Subs-Graphics.php'); if (in_array('gd', get_loaded_extensions()) && !showCodeImage($code)) header('HTTP/1.1 400 Bad Request'); // Otherwise just show a pre-defined letter. elseif (isset($_REQUEST['letter'])) { $_REQUEST['letter'] = (int) $_REQUEST['letter']; if ($_REQUEST['letter'] > 0 && $_REQUEST['letter'] <= strlen($code) && !showLetterImage(strtolower($code{$_REQUEST['letter'] - 1}))) { header('Content-Type: image/gif'); die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x0 0\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\ x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"); } } // You must be up to no good. else { header('Content-Type: image/gif'); die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x0 0\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\ x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B"); Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
202
} } elseif ($_REQUEST['format'] === '.wav') { require_once($sourcedir . '/Subs-Sound.php'); if (!createWaveFile($code)) header('HTTP/1.1 400 Bad Request'); } // We all die one day... die(); } // See if a username already exists. function RegisterCheckUsername() { global $sourcedir, $smcFunc, $context, $txt; // This is XML! loadTemplate('Xml'); $context['sub_template'] = 'check_username'; $context['checked_username'] = isset($_GET['username']) ? $_GET['username'] : ''; $context['valid_username'] = true; // Clean it up like mother would. $context['checked_username'] = preg_replace('~[\t\n\r \x0B\0' . ($context['utf8'] ? ($context['server']['complex_preg_chars'] ? '\x{A0}\x{AD}\x{2000}-\x{200F}\x{201F}\x{202F}\x{3000}\x{FEFF}' : "\xC2\xA0\xC2\xAD\xE2\x80\x80\xE2\x80\x8F\xE2\x80\x9F\xE2\x80\xAF\xE2\x80\x9F\xE3\x80\x80\xEF\xB B\xBF") : '\x00-\x08\x0B\x0C\x0E-\x19\xA0') . ']+~' . ($context['utf8'] ? 'u' : ''), ' ', $context['checked_username']); if ($smcFunc['strlen']($context['checked_username']) > 25) $context['checked_username'] = $smcFunc['htmltrim']($smcFunc['substr']($context['checked_username'], 0, 25)); // Only these characters are permitted.
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
9. Login dan Log Out
This file is concerned pretty entirely, as you see from its name, with logging in and out members, and the validation of that. It contains:
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
204
void Login() - shows a page for the user to type in their username and password. - caches the referring URL in $_SESSION['login_url']. - uses the Login template and language file with the login sub template. - if you are using a wireless device, uses the protocol_login sub template in the Wireless template. - accessed from ?action=login. void Login2() - actually logs you in and checks that login was successful. - employs protection against a specific IP or user trying to brute force a login to an account. - on error, uses the same templates Login() uses. - upgrades password encryption on login, if necessary. - after successful login, redirects you to $_SESSION['login_url']. - accessed from ?action=login2, by forms. void Logout(bool internal = false) - logs the current user out of their account. - requires that the session hash is sent as well, to prevent automatic logouts by images or javascript. - doesn't check the session if internal is true. - redirects back to $_SESSION['logout_url'], if it exists. - accessed via ?action=logout;session_var=... string md5_hmac(string data, string key) - old style SMF 1.0.x/YaBB SE 1.5.x hashing. - returns the HMAC MD5 of data with key. string phpBB3_password_check(string passwd, string passwd_hash) - custom encryption for phpBB3 based passwords. void validatePasswordFlood(id_member, password_flood_value = false, was_correct = false) - this function helps protect against brute force attacks on a member's password. */ Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
205
// Ask them for their login information. function Login() { global $txt, $context, $scripturl; // In wireless? If so, use the correct sub template. if (WIRELESS) $context['sub_template'] = WIRELESS_PROTOCOL . '_login'; // Otherwise, we need to load the Login template/language file. else { loadLanguage('Login'); loadTemplate('Login'); $context['sub_template'] = 'login'; } // Get the template ready.... not really much else to do. $context['page_title'] = $txt['login']; $context['default_username'] = &$_REQUEST['u']; $context['default_password'] = ''; $context['never_expire'] = false; // Add the login chain to the link tree. $context['linktree'][] = array( 'url' => $scripturl . '?action=login', 'name' => $txt['login'], ); // Set the login URL - will be used when the login process is done (but careful not to send us to an attachment). if (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0) $_SESSION['login_url'] = $_SESSION['old_url']; else unset($_SESSION['login_url']); } // Perform the actual logging-in. function Login2() Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
206
{ global $txt, $scripturl, $user_info, $user_settings, $smcFunc; global $cookiename, $maintenance, $modSettings, $context, $sc, $sourcedir; // Load cookie authentication stuff. require_once($sourcedir . '/Subs-Auth.php'); if (isset($_GET['sa']) && $_GET['sa'] == 'salt' && !$user_info['is_guest']) { if (isset($_COOKIE[$cookiename]) && preg_match('~^a:[34]:\{i:0;(i:\d{1,6}|s:[1-8]:"\d{1,8}");i:1;s:(0|40):"([a-fAF0-9]{40})?";i:2;[id]:\d{1,14};(i:3;i:\d;)?\}$~', $_COOKIE[$cookiename]) === 1) list (, , $timeout) = safe_unserialize($_COOKIE[$cookiename]); elseif (isset($_SESSION['login_' . $cookiename])) list (, , $timeout) = safe_unserialize($_SESSION['login_' . $cookiename]); else trigger_error('Login2(): Cannot be logged in without a session or cookie', E_USER_ERROR); $user_settings['password_salt'] = substr(md5(mt_rand()), 0, 4); updateMemberData($user_info['id'], array('password_salt' => $user_settings['password_salt'])); setLoginCookie($timeout - time(), $user_info['id'], sha1($user_settings['passwd'] . $user_settings['password_salt'])); redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']); } // Double check the cookie... elseif (isset($_GET['sa']) && $_GET['sa'] == 'check') { // Strike! You're outta there! if ($_GET['member'] != $user_info['id']) fatal_lang_error('login_cookie_error', false); // Some whitelisting for login_url... Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
207
if (empty($_SESSION['login_url'])) redirectexit(); else { // Best not to clutter the session data too much... $temp = $_SESSION['login_url']; unset($_SESSION['login_url']); redirectexit($temp); } } // Beyond this point you are assumed to be a guest trying to login. if (!$user_info['is_guest']) redirectexit(); // Are you guessing with a script? spamProtection('login'); // Set the login_url if it's not already set (but careful not to send us to an attachment). if (empty($_SESSION['login_url']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0) $_SESSION['login_url'] = $_SESSION['old_url']; // Been guessing a lot, haven't we? if (isset($_SESSION['failed_login']) && $_SESSION['failed_login'] >= $modSettings['failed_login_threshold'] * 3) fatal_lang_error('login_threshold_fail', 'critical'); // Set up the cookie length. (if it's invalid, just fall through and use the default.) if (isset($_POST['cookieneverexp']) || (!empty($_POST['cookielength']) && $_POST['cookielength'] == -1)) $modSettings['cookieTime'] = 3153600; elseif (!empty($_POST['cookielength']) && ($_POST['cookielength'] >= 1 || $_POST['cookielength'] <= 525600)) $modSettings['cookieTime'] = (int) $_POST['cookielength']; loadLanguage('Login'); // Load the template stuff - wireless or normal. Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
208
if (WIRELESS) $context['sub_template'] = WIRELESS_PROTOCOL . '_login'; else { loadTemplate('Login'); $context['sub_template'] = 'login'; } // Set up the default/fallback stuff. $context['default_username'] = isset($_POST['user']) ? preg_replace('~(\\d{1,7}|x[0-9a-fA-F]{1,6});~', '\\1;', htmlspecialchars($_POST['user'])) : ''; $context['default_password'] = ''; $context['never_expire'] = $modSettings['cookieTime'] == 525600 || $modSettings['cookieTime'] == 3153600; $context['login_errors'] = array($txt['error_occured']); $context['page_title'] = $txt['login']; // Add the login chain to the link tree. $context['linktree'][] = array( 'url' => $scripturl . '?action=login', 'name' => $txt['login'], ); if (!empty($_POST['openid_identifier']) && !empty($modSettings['enableOpenID'])) { require_once($sourcedir . '/Subs-OpenID.php'); if (($open_id = smf_openID_validate($_POST['openid_identifier'])) !== 'no_data') return $open_id; } // You forgot to type your username, dummy! if (!isset($_POST['user']) || $_POST['user'] == '') { $context['login_errors'] = array($txt['need_username']); return; } // Hmm... maybe 'admin' will login with no password. Uhh... NO! Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
209
if ((!isset($_POST['passwrd']) || $_POST['passwrd'] == '') && (!isset($_POST['hash_passwrd']) || strlen($_POST['hash_passwrd']) != 40)) { $context['login_errors'] = array($txt['no_password']); return; } // No funky symbols either. if (preg_match('~[<>&"\'=\\\]~', preg_replace('~((\\d{1,7}|x[0-9afA-F]{1,6});)~', '', $_POST['user'])) != 0) { $context['login_errors'] = array($txt['error_invalid_characters_username']); return; } // And if it's too long, trim it back. if ($smcFunc['strlen']($_POST['user']) > 80) { $_POST['user'] = $smcFunc['substr']($_POST['user'], 0, 79); $context['default_username'] = preg_replace('~(\\d{1,7}|x[0-9a-fA-F]{1,6});~', '\\1;', $smcFunc['htmlspecialchars']($_POST['user'])); } // Are we using any sort of integration to validate the login? if (in_array('retry', call_integration_hook('integrate_validate_login', array($_POST['user'], isset($_POST['hash_passwrd']) && strlen($_POST['hash_passwrd']) == 40 ? $_POST['hash_passwrd'] : null, $modSettings['cookieTime'])), true)) { $context['login_errors'] = array($txt['login_hash_error']); $context['disable_login_hashing'] = true; return; } // Load the data up! $request = $smcFunc['db_query']('', ' SELECT passwd, id_member, id_group, lngfile, is_activated, email_address, additional_groups, member_name, password_salt, openid_uri, passwd_flood FROM {db_prefix}members Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
210
WHERE ' . ($smcFunc['db_case_sensitive'] ? 'LOWER(member_name) = LOWER({string:user_name})' : 'member_name = {string:user_name}') . ' LIMIT 1', array( 'user_name' => $smcFunc['db_case_sensitive'] ? strtolower($_POST['user']) : $_POST['user'], ) ); // Probably mistyped or their email, try it as an email address. (member_name first, though!) if ($smcFunc['db_num_rows']($request) == 0) { $smcFunc['db_free_result']($request); $request = $smcFunc['db_query']('', ' SELECT passwd, id_member, id_group, lngfile, is_activated, email_address, additional_groups, member_name, password_salt, openid_uri, passwd_flood FROM {db_prefix}members WHERE email_address = {string:user_name} LIMIT 1', array( 'user_name' => $_POST['user'], ) ); // Let them try again, it didn't match anything... if ($smcFunc['db_num_rows']($request) == 0) { $context['login_errors'] = array($txt['username_no_exist']); return; } } $user_settings = $smcFunc['db_fetch_assoc']($request); $smcFunc['db_free_result']($request); // Figure out the password using SMF's encryption - if what they typed is right.
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
211
if (isset($_POST['hash_passwrd']) && strlen($_POST['hash_passwrd']) == 40) { // Needs upgrading? if (strlen($user_settings['passwd']) != 40) { $context['login_errors'] = array($txt['login_hash_error']); $context['disable_login_hashing'] = true; unset($user_settings); return; } // Challenge passed. elseif ($_POST['hash_passwrd'] == sha1($user_settings['passwd'] . $sc)) $sha_passwd = $user_settings['passwd']; else { // Don't allow this! validatePasswordFlood($user_settings['id_member'], $user_settings['passwd_flood']); $_SESSION['failed_login'] = @$_SESSION['failed_login'] + 1; if ($_SESSION['failed_login'] >= $modSettings['failed_login_threshold']) redirectexit('action=reminder'); else { log_error($txt['incorrect_password'] . ' - <span class="remove">' . $user_settings['member_name'] . '', 'user'); $context['disable_login_hashing'] = true; $context['login_errors'] = array($txt['incorrect_password']); unset($user_settings); return; } } } else Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
212
$sha_passwd = sha1(strtolower($user_settings['member_name']) . un_htmlspecialchars($_POST['passwrd'])); // Bad password! Thought you could fool the database?! if ($user_settings['passwd'] != $sha_passwd) { // Let's be cautious, no hacking please. thanx. validatePasswordFlood($user_settings['id_member'], $user_settings['passwd_flood']); // Maybe we were too hasty... let's try some other authentication methods. $other_passwords = array(); // None of the below cases will be used most of the time (because the salt is normally set.) if ($user_settings['password_salt'] == '') { // YaBB SE, Discus, MD5 (used a lot), SHA-1 (used some), SMF 1.0.x, IkonBoard, and none at all. $other_passwords[] = crypt($_POST['passwrd'], substr($_POST['passwrd'], 0, 2)); $other_passwords[] = crypt($_POST['passwrd'], substr($user_settings['passwd'], 0, 2)); $other_passwords[] = md5($_POST['passwrd']); $other_passwords[] = sha1($_POST['passwrd']); $other_passwords[] = md5_hmac($_POST['passwrd'], strtolower($user_settings['member_name'])); $other_passwords[] = md5($_POST['passwrd'] . strtolower($user_settings['member_name'])); $other_passwords[] = md5(md5($_POST['passwrd'])); $other_passwords[] = $_POST['passwrd']; // This one is a strange one... MyPHP, crypt() on the MD5 hash. $other_passwords[] = crypt(md5($_POST['passwrd']), md5($_POST['passwrd'])); // Snitz style - SHA-256. Technically, this is a downgrade, but most PHP configurations don't support sha256 anyway.
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
213
if (strlen($user_settings['passwd']) == 64 && function_exists('mhash') && defined('MHASH_SHA256')) $other_passwords[] = bin2hex(mhash(MHASH_SHA256, $_POST['passwrd'])); // phpBB3 users new hashing. We now support it as well ;). $other_passwords[] = phpBB3_password_check($_POST['passwrd'], $user_settings['passwd']); // APBoard 2 Login Method. $other_passwords[] = md5(crypt($_POST['passwrd'], 'CRYPT_MD5')); } // The hash should be 40 if it's SHA-1, so we're safe with more here too. elseif (strlen($user_settings['passwd']) == 32) { // vBulletin 3 style hashing? Let's welcome them with open arms \o/. $other_passwords[] = md5(md5($_POST['passwrd']) . $user_settings['password_salt']); // Hmm.. p'raps it's Invision 2 style? $other_passwords[] = md5(md5($user_settings['password_salt']) . md5($_POST['passwrd'])); // Some common md5 ones. $other_passwords[] = md5($user_settings['password_salt'] . $_POST['passwrd']); $other_passwords[] = md5($_POST['passwrd'] . $user_settings['password_salt']); } elseif (strlen($user_settings['passwd']) == 40) { // Maybe they are using a hash from before the password fix. $other_passwords[] = sha1(strtolower($user_settings['member_name']) . un_htmlspecialchars($_POST['passwrd'])); // BurningBoard3 style of hashing. Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
214
$other_passwords[] = sha1($user_settings['password_salt'] . sha1($user_settings['password_salt'] . sha1($_POST['passwrd']))); // Perhaps we converted to UTF-8 and have a valid password being hashed differently. if ($context['character_set'] == 'utf8' && !empty($modSettings['previousCharacterSet']) && $modSettings['previousCharacterSet'] != 'utf8') { // Try iconv first, for no particular reason. if (function_exists('iconv')) $other_passwords['iconv'] = sha1(strtolower(iconv('UTF-8', $modSettings['previousCharacterSet'], $user_settings['member_name'])) . un_htmlspecialchars(iconv('UTF-8', $modSettings['previousCharacterSet'], $_POST['passwrd']))); // Say it aint so, iconv failed! if (empty($other_passwords['iconv']) && function_exists('mb_convert_encoding')) $other_passwords[] = sha1(strtolower(mb_convert_encoding($user_settings['member_name'], 'UTF8', $modSettings['previousCharacterSet'])) . un_htmlspecialchars(mb_convert_encoding($_POST['passwrd'], 'UTF-8', $modSettings['previousCharacterSet']))); } } // SMF's sha1 function can give a funny result on Linux (Not our fault!). If we've now got the real one let the old one be valid! if (strpos(strtolower(PHP_OS), 'win') !== 0) { require_once($sourcedir . '/Subs-Compat.php'); $other_passwords[] = sha1_smf(strtolower($user_settings['member_name']) . un_htmlspecialchars($_POST['passwrd'])); } // Whichever encryption it was using, let's make it use SMF's now ;). if (in_array($user_settings['passwd'], $other_passwords)) { Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
215
$user_settings['passwd'] = $sha_passwd; $user_settings['password_salt'] = substr(md5(mt_rand()), 0, 4); // Update the password and set up the hash. updateMemberData($user_settings['id_member'], array('passwd' => $user_settings['passwd'], 'password_salt' => $user_settings['password_salt'], 'passwd_flood' => '')); } // Okay, they for sure didn't enter the password! else { // They've messed up again - keep a count to see if they need a hand. $_SESSION['failed_login'] = @$_SESSION['failed_login'] + 1; // Hmm... don't remember it, do you? Here, try the password reminder ;). if ($_SESSION['failed_login'] >= $modSettings['failed_login_threshold']) redirectexit('action=reminder'); // We'll give you another chance... else { // Log an error so we know that it didn't go well in the error log. log_error($txt['incorrect_password'] . ' - <span class="remove">' . $user_settings['member_name'] . '', 'user'); $context['login_errors'] = array($txt['incorrect_password']); return; } } } elseif (!empty($user_settings['passwd_flood'])) { // Let's be sure they weren't a little hacker. validatePasswordFlood($user_settings['id_member'], $user_settings['passwd_flood'], true);
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
216
// If we got here then we can reset the flood counter. updateMemberData($user_settings['id_member'], array('passwd_flood' => '')); } // Correct password, but they've got no salt; fix it! if ($user_settings['password_salt'] == '') { $user_settings['password_salt'] = substr(md5(mt_rand()), 0, 4); updateMemberData($user_settings['id_member'], array('password_salt' => $user_settings['password_salt'])); } // Check their activation status. if (!checkActivation()) return; DoLogin(); } function checkActivation() { global $context, $txt, $scripturl, $user_settings, $modSettings; if (!isset($context['login_errors'])) $context['login_errors'] = array(); // What is the true activation status of this account? $activation_status = $user_settings['is_activated'] > 10 ? $user_settings['is_activated'] - 10 : $user_settings['is_activated']; // Check if the account is activated - COPPA first... if ($activation_status == 5) { $context['login_errors'][] = $txt['coppa_no_concent'] . ' ' . $txt['coppa_need_more_details'] . ''; return false; } // Awaiting approval still? elseif ($activation_status == 3) fatal_lang_error('still_awaiting_approval', 'user'); Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
217
// Awaiting deletion, changed their mind? elseif ($activation_status == 4) { if (isset($_REQUEST['undelete'])) { updateMemberData($user_settings['id_member'], array('is_activated' => 1)); updateSettings(array('unapprovedMembers' => ($modSettings['unapprovedMembers'] > 0 ? $modSettings['unapprovedMembers'] - 1 : 0))); } else { $context['disable_login_hashing'] = true; $context['login_errors'][] = $txt['awaiting_delete_account']; $context['login_show_undelete'] = true; return false; } } // Standard activation? elseif ($activation_status != 1) { log_error($txt['activate_not_completed1'] . ' - <span class="remove">' . $user_settings['member_name'] . '', false); $context['login_errors'][] = $txt['activate_not_completed1'] . ' ' . $txt['activate_not_completed2'] . ''; return false; } return true; } function DoLogin() { global $txt, $scripturl, $user_info, $user_settings, $smcFunc; global $cookiename, $maintenance, $modSettings, $context, $sourcedir; // Load cookie authentication stuff. require_once($sourcedir . '/Subs-Auth.php'); Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
218
// Call login integration functions. call_integration_hook('integrate_login', array($user_settings['member_name'], isset($_POST['hash_passwrd']) && strlen($_POST['hash_passwrd']) == 40 ? $_POST['hash_passwrd'] : null, $modSettings['cookieTime'])); // Get ready to set the cookie... $username = $user_settings['member_name']; $user_info['id'] = $user_settings['id_member']; // Bam! Cookie set. A session too, just in case. setLoginCookie(60 * $modSettings['cookieTime'], $user_settings['id_member'], sha1($user_settings['passwd'] . $user_settings['password_salt'])); // Reset the login threshold. if (isset($_SESSION['failed_login'])) unset($_SESSION['failed_login']); $user_info['is_guest'] = false; $user_settings['additional_groups'] = explode(',', $user_settings['additional_groups']); $user_info['is_admin'] = $user_settings['id_group'] == 1 || in_array(1, $user_settings['additional_groups']); // Are you banned? is_not_banned(true); // An administrator, set up the login so they don't have to type it again. if ($user_info['is_admin'] && isset($user_settings['openid_uri']) && empty($user_settings['openid_uri'])) { $_SESSION['admin_time'] = time(); unset($_SESSION['just_registered']); } // Don't stick the language or theme after this point. unset($_SESSION['language'], $_SESSION['id_theme']); // First login? $request = $smcFunc['db_query']('', ' Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
219
SELECT last_login FROM {db_prefix}members WHERE id_member = {int:id_member} AND last_login = 0', array( 'id_member' => $user_info['id'], ) ); if ($smcFunc['db_num_rows']($request) == 1) $_SESSION['first_login'] = true; else unset($_SESSION['first_login']); $smcFunc['db_free_result']($request); // You've logged in, haven't you? updateMemberData($user_info['id'], array('last_login' => time(), 'member_ip' => $user_info['ip'], 'member_ip2' => $_SERVER['BAN_CHECK_IP'])); // Get rid of the online entry for that old guest.... $smcFunc['db_query']('', ' DELETE FROM {db_prefix}log_online WHERE session = {string:session}', array( 'session' => 'ip' . $user_info['ip'], ) ); $_SESSION['log_time'] = 0; // Just log you back out if it's in maintenance mode and you AREN'T an admin. if (empty($maintenance) || allowedTo('admin_forum')) redirectexit('action=login2;sa=check;member=' . $user_info['id'], $context['server']['needs_login_fix']); else redirectexit('action=logout;' . $context['session_var'] . '=' . $context['session_id'], $context['server']['needs_login_fix']); } // Log the user out. function Logout($internal = false, $redirect = true) { Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
220
global $sourcedir, $user_info, $user_settings, $context, $modSettings, $smcFunc; // Make sure they aren't being auto-logged out. if (!$internal) checkSession('get'); require_once($sourcedir . '/Subs-Auth.php'); if (isset($_SESSION['pack_ftp'])) $_SESSION['pack_ftp'] = null; // They cannot be open ID verified any longer. if (isset($_SESSION['openid'])) unset($_SESSION['openid']); // It won't be first login anymore. unset($_SESSION['first_login']); // Just ensure they aren't a guest! if (!$user_info['is_guest']) { // Pass the logout information to integrations. call_integration_hook('integrate_logout', array($user_settings['member_name'])); // If you log out, you aren't online anymore :P. $smcFunc['db_query']('', ' DELETE FROM {db_prefix}log_online WHERE id_member = {int:current_member}', array( 'current_member' => $user_info['id'], ) ); } $_SESSION['log_time'] = 0; // Empty the cookie! (set it in the past, and for id_member = 0) setLoginCookie(-3600, 0); // And some other housekeeping while we're at it. Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
221
session_destroy(); if (!empty($user_info['id'])) updateMemberData($user_info['id'], array('password_salt' => substr(md5(mt_rand()), 0, 4))); // Off to the merry board index we go! if ($redirect) { if (empty($_SESSION['logout_url'])) redirectexit('', $context['server']['needs_login_fix']); else { $temp = $_SESSION['logout_url']; unset($_SESSION['logout_url']); redirectexit($temp, $context['server']['needs_login_fix']); } } } // MD5 Encryption used for older passwords. function md5_hmac($data, $key) { $key = str_pad(strlen($key) <= 64 ? $key : pack('H*', md5($key)), 64, chr(0x00)); return md5(($key ^ str_repeat(chr(0x5c), 64)) . pack('H*', md5(($key ^ str_repeat(chr(0x36), 64)) . $data))); } // Special encryption used by phpBB3. function phpBB3_password_check($passwd, $passwd_hash) { // Too long or too short? if (strlen($passwd_hash) != 34) return; // Range of characters allowed. $range = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr stuvwxyz';
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
222
// Tests $strpos = strpos($range, $passwd_hash[3]); $count = 1 << $strpos; $count2 = $count; $salt = substr($passwd_hash, 4, 8); // Things are done differently for PHP 5. if (@version_compare(PHP_VERSION, '5') >= 0) { $hash = md5($salt . $passwd, true); for (; $count != 0; --$count) $hash = md5($hash . $passwd, true); } else { $hash = pack('H*', md5($salt . $passwd)); for (; $count != 0; --$count) $hash = pack('H*', md5($hash . $passwd)); } $output = substr($passwd_hash, 0, 12); $i = 0; while ($i < 16) { $value = ord($hash[$i++]); $output .= $range[$value & 0x3f]; if ($i < 16) $value |= ord($hash[$i]) << 8; $output .= $range[($value >> 6) & 0x3f]; if ($i++ >= 16) break; if ($i < 16) $value |= ord($hash[$i]) << 16; $output .= $range[($value >> 12) & 0x3f]; if ($i++ >= 16) break; Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
223
$output .= $range[($value >> 18) & 0x3f]; } // Return now. return $output; } // This protects against brute force attacks on a member's password. Importantly even if the password was right we DON'T TELL THEM! function validatePasswordFlood($id_member, $password_flood_value = false, $was_correct = false) { global $smcFunc, $cookiename, $sourcedir; // As this is only brute protection, we allow 5 attempts every 10 seconds. // Destroy any session or cookie data about this member, as they validated wrong. require_once($sourcedir . '/Subs-Auth.php'); setLoginCookie(-3600, 0); if (isset($_SESSION['login_' . $cookiename])) unset($_SESSION['login_' . $cookiename]); // We need a member! if (!$id_member) { // Redirect back! redirectexit(); // Probably not needed, but still make sure... fatal_lang_error('no_access', false); } // Right, have we got a flood value? if ($password_flood_value !== false) @list ($time_stamp, $number_tries) = explode('|', $password_flood_value); // Timestamp or number of tries invalid? if (empty($number_tries) || empty($time_stamp)) Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu
224
{ $number_tries = 0; $time_stamp = time(); } // They've failed logging in already if (!empty($number_tries)) { // Give them less chances if they failed before $number_tries = $time_stamp < time() - 20 ? 2 : $number_tries; // They are trying too fast, make them wait longer if ($time_stamp < time() - 10) $time_stamp = time(); } $number_tries++; // Broken the law? if ($number_tries > 5) fatal_lang_error('login_threshold_brute_fail', 'critical'); // Otherwise set the members data. If they correct on their first attempt then we actually clear it, otherwise we set it! updateMemberData($id_member, array('passwd_flood' => $was_correct && $number_tries == 1 ? '' : $time_stamp . '|' . $number_tries)); } ?>
Raksa Griya Ramadhan, 2016 PENERAPAN PEMBELAJARAN PROBLEM POSING BERBANTU MULTIMEDIA INTERAKTIF PADA MATA PELAJARAN JARINGAN DASAR UNTUK MENINGKATKAN PEMAHAMAN SISWA SMK. Universitas Pendidikan Indonesia | repository.upi.edu | perpustakaan.upi.edu