Installation instructions for "YubiKey Login module v1.0.3"
Introduction
The YubiKey phpBB module provides YubiKey based strong two-factor user authentication capabilities to phpBB forum.
The module is very flexible and provides the following capabilities:
- Support for four authentication schemes:
- Username + Password + YubiKey OTP (with administrative option to make OTP optional until a YubiKey is assigned)
- Password + YubiKey OTP
- (Username or YubiKey OTP) + Password
- YubiKey OTP only
- Exhaustive global settings:
- Ability to choose one of the four supported authentication schemes
- Ability to choose between Yubico online validation service and self-hosted validation service
- Configurable validation service API parameters
- YubiKey management
- Reporting of lost/damaged YubiKey
The purpose of this document is to guide readers through the steps to install YubiKey Login MOD v1.0.3 for phpBB forum.
Additional Guides
Prerequisites
Recommended: PHP 5.2.x
Required: PHP version 5.0.0 or higher
PHP installation must have the following PHP extensions installed and enabled:
- PEAR (http://pear.php.net/PEAR)
- cURL (http://php.net/manual/en/curl.setup.php)
Yubico PHP package
Auth_Yubico is a PHP class for verifying Yubico One-Time-Passwords. It is written as a PEAR module to make it easy to deploy.
Install latest Yubico PHP package from http://code.google.com/p/php-yubico/
For more information see the documentation: http://code.google.com/p/php-yubico/wiki/ReadMe
Installation
Download and extract the Yubikey_Login-1.0.3.tar.gz file using the following link:
http://code.google.com/p/yforum/downloads/detail?name=Yubikey_Login-1.0.3.tar.gz
Once you have downloaded and extracted the above file, you need to perform the file copy/edits described in the following sections.
However, we recommend that you open the Yubikey_Login-1.0.3/install.xml file in the browser to follow the remaining instructions as it is easier to copy and paste the code from there.
File copy
- Copy: root/adm/mods/yubikey_login_version.php
To: adm/mods/yubikey_login_version.php - Copy: root/adm/style/acp_yubikeys.html
To: adm/style/acp_yubikeys.html - Copy: root/images/yubico-icon-small.gif
To: images/yubico-icon-small.gif - Copy: root/includes/functions_yubikey.php
To: includes/functions_yubikey.php - Copy: root/includes/functions_yubikey_login.php
To: includes/functions_yubikey_login.php - Copy: root/includes/acp/acp_yubikey_login.php
To: includes/acp/acp_yubikey_login.php - Copy: root/includes/acp/info/acp_yubikey_login.php
To: includes/acp/info/acp_yubikey_login.php - Copy: root/includes/ucp/ucp_yubikey_confirmlost.php
To: includes/ucp/ucp_yubikey_confirmlost.php - Copy: root/includes/ucp/ucp_yubikey_login.php
To: includes/ucp/ucp_yubikey_login.php - Copy: root/includes/ucp/ucp_yubikey_reset.php
To: includes/ucp/ucp_yubikey_reset.php - Copy: root/includes/ucp/ucp_yubikey_reportlost.php
To: includes/ucp/ucp_yubikey_reportlost.php - Copy: root/includes/ucp/info/ucp_yubikey_login.php
To: includes/ucp/info/ucp_yubikey_login.php - Copy: root/install/index.php
To: install/index.php - Copy: root/language/en/email/user_lost_yubikey.txt
To: language/en/email/user_lost_yubikey.txt - Copy: root/language/en/mods/yubikey_login.php
To: language/en/mods/yubikey_login.php - Copy: root/styles/prosilver/template/ucp_yubikey_login.html
To: styles/prosilver/template/ucp_yubikey_login.html - Copy: root/styles/prosilver/template/ucp_yubikey_reportlost.html
To: styles/prosilver/template/ucp_yubikey_reportlost.html - Copy: root/styles/prosilver/template/ucp_yubikey_reset.html
To: styles/prosilver/template/ucp_yubikey_reset.html
Edits
Open:ucp.php
Find
Tip: This may be a partial find and not the whole line.
Code:
$message = $user->lang['PERMISSIONS_RESTORED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
trigger_error($message);
break;
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
case 'yubikey_reportlost':
$module->load('ucp', 'yubikey_reportlost');
$module->display($user->lang['YUBIKEY_REPORTLOST']);
break;
case 'yubikey_confirmlost':
$module->load('ucp', 'yubikey_confirmlost');
$module->display($user->lang['YUBIKEY_REPORTLOST']);
break;
case 'yubikey_reset':
$module->load('ucp', 'yubikey_reset');
$module->display($user->lang['YUBIKEY_RESET']);
break;
Open:adm/style/acp_users.html
Find
Tip: This may be a partial find and not the whole line.
Code:
<!-- ELSEIF S_ATTACHMENTS -->
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
<!-- ELSEIF S_YUBIKEY_LOGIN -->
<!-- IF S_YUBIKEYS_EXIST -->
<table cellspacing="1">
<thead>
<tr>
<th>{L_USERNAME}</th>
<th>{L_YUBIKEY_DEVICE_ID}</th>
<th>{L_YUBIKEY_LASTLOGIN}</th>
<th>{L_YUBIKEY_STATUS}</th>
<th colspan="2">{L_OPTIONS}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN yubikey -->
<!-- IF yubikey.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td style="width: 25%;">{yubikey.USER_NAME}</td>
<td style="width: 25%;">{yubikey.DEVICE_ID}</td>
<td style="width: 15%;">{yubikey.LASTLOGIN}</td>
<td style="width: 10%; white-space: nowrap;" align="center"> {yubikey.STATUS} </td>
<td style="text-align: center;"> <a href="{yubikey.U_ACTIVATE_DEACTIVATE}">{yubikey.L_ACTIVATE_DEACTIVATE}</a> </td>
<td style="text-align: center;"> <a href="{yubikey.U_DELETE}">Delete</a> </td>
</tr>
<!-- END yubikey -->
</tbody>
</table>
<!-- ELSE -->
<p>{L_NO_YUBIKEYS_USER}</p>
<!-- ENDIF -->
Open:includes/auth.php
Find
Tip: This may be a partial find and not the whole line.
Code:
function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)
In-line Find
Tip: This is a partial match of a line for in-line operations.
Code:
function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0
In-line Add after
Code:
, $yubikey_otp = null
Find
Tip: This may be a partial find and not the whole line.
Code:
if (function_exists($method))
{
$login = $method($username, $password);
Replace with
Tip: Replace the preceding line(s) to find with the following lines.
Code:
if (function_exists($method))
{
$multifactor = true;
if ($config['allow_yubikey_login'])
{
$yubikey_otp = strtolower(trim($yubikey_otp));
$yk_login_method = $config['yubikey_login_method'];
// YubiKey login code
include($phpbb_root_path . 'includes/functions_yubikey_login.' . $phpEx);
$login = yubikey_login($username, $password, $yubikey_otp);
if($login)
{
if($login['error_msg'] == LOGIN_ERROR_YUBIKEY_BAD_OTP && $yk_login_method == YUBIKEY_LOGIN_SCHEME_UN_OR_YK_PWD)
{
$username = $yubikey_otp;
}
else if($login['status'] != LOGIN_SUCCESS)
{
return $login;
}
if($config['yubikey_login_method'] == YUBIKEY_LOGIN_SCHEME_YK_ONLY)
{
$multifactor = false;
}
else
{
$username = $login['user_row']['username'];
}
}
}
if($multifactor)
{
$login = $method($username, $password);
}
Open:includes/constants.php
Find
Tip: This may be a partial find and not the whole line.
Code:
define('VOTE_CONVERTED', 127);
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
// YubiKey login constants
define('YUBIKEY_ACTIVE', 0);
define('YUBIKEY_INACTIVE', 1);
define('YUBIKEY_LOGIN_SCHEME_PWD_YK', 'PWD-YK');
define('YUBIKEY_LOGIN_SCHEME_UN_OR_YK_PWD', 'UN-OR-YK-PWD');
define('YUBIKEY_LOGIN_SCHEME_YK_ONLY', 'YK-ONLY');
define('YUBIKEY_LOGIN_SCHEME_UN_PWD_YK', 'UN-PWD-YK');
define('YUBIKEY_VAL_SERVICE_TYPE_ONLINE', 0);
define('YUBIKEY_VAL_SERVICE_TYPE_CUSTOM', 1);
Find
Tip: This may be a partial find and not the whole line.
Code:
// Additional tables
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
define('YUBIKEY_TABLE', $table_prefix . 'yubikey');
Open:includes/functions.php
Find
Tip: This may be a partial find and not the whole line.
Code:
$username = request_var('username', '', true);
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
$yubikey_otp = request_var('yubikey_otp', '');
Find
Tip: This may be a partial find and not the whole line.
Code:
$result = $auth->login($username, $password, $autologin, $viewonline, $admin);
In-line Find
Tip: This is a partial match of a line for in-line operations.
Code:
$result = $auth->login($username, $password, $autologin, $viewonline, $admin
In-line Add after
Code:
, $yubikey_otp
Find
Tip: This may be a partial find and not the whole line.
Code:
// Special cases... determine
switch ($result['status'])
{
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
case LOGIN_ERROR_EXTERNAL_AUTH:
$err = $user->lang[$result['error_msg']];
// Assign admin contact to some error messages
if (substr($result['error_msg'], 0, 19) == 'LOGIN_ERROR_YUBIKEY')
{
$err = (!$config['board_contact']) ? sprintf($user->lang[$result['error_msg']], '', '') : sprintf($user->lang[$result['error_msg']], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>');
}
/*
// Append YubiKey Reset Link
if ($result['error_msg'] == 'LOGIN_ERROR_YUBIKEY_REQUIRED')
{
$err .= ' <a href="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=yubikey_send') . '">' . $user->lang['YUBIKEY_RESET'] . '</a>';
}
*/
break;
Find
Tip: This may be a partial find and not the whole line.
Code:
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
'U_YUBIKEY_REPORTLOST' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=yubikey_reportlost') : '',
Find
Tip: This may be a partial find and not the whole line.
Code:
'PASSWORD_CREDENTIAL' => ($admin) ? 'password_' . $credential : 'password',
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
'YUBIKEY_CREDENTIAL' => 'yubikey_otp',
Find
Tip: This may be a partial find and not the whole line.
Code:
'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false,
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
'S_YUBIKEY_LOGIN_ENABLED' => ($config['allow_yubikey_login']) ? true : false,
'S_YUBIKEY_IS_OPTIONAL' => ($config['allow_yubikey_login'] && $config['yubikey_login_method'] == YUBIKEY_LOGIN_SCHEME_UN_PWD_YK && $config['yubikey_login_optional'] == 1) ? true : false,
'S_LOGIN_UN_REQD' => (!$config['allow_yubikey_login'] || ($config['allow_yubikey_login'] && ($config['yubikey_login_method'] == YUBIKEY_LOGIN_SCHEME_UN_OR_YK_PWD || $config['yubikey_login_method'] == YUBIKEY_LOGIN_SCHEME_UN_PWD_YK))) ? true : false,
'S_LOGIN_PWD_REQD' => (!$config['allow_yubikey_login'] || ($config['allow_yubikey_login'] && $config['yubikey_login_method'] != YUBIKEY_LOGIN_SCHEME_YK_ONLY)) ? true : false,
Open:includes/functions_user.php
Find
Tip: This may be a partial find and not the whole line.
Code:
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE);
In-line Find
Tip: This is a partial match of a line for in-line operations.
Code:
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE
In-line Add after
Code:
, YUBIKEY_TABLE
Find
Tip: This may be a partial find and not the whole line.
Code:
return $user_data['group_id'];
}
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
/**
* Check to see if YubiKey OTP is valid
*
* @param string $yubikey_otp The YubiKey OTP to check
*
*/
function validate_yubikey_otp($yubikey_otp)
{
global $config, $db, $user;
global $phpbb_root_path, $phpEx;
if (!function_exists('yubikey_validate_otp'))
{
include "{$phpbb_root_path}includes/functions_yubikey_login.$phpEx";
}
$yubikey_otp = strtolower(trim($yubikey_otp));
if(empty($yubikey_otp))
{
$yk_login_method = $config['yubikey_login_method'];
if($yk_login_method == YUBIKEY_LOGIN_SCHEME_UN_OR_YK_PWD
|| ($yk_login_method == YUBIKEY_LOGIN_SCHEME_UN_PWD_YK && $config['yubikey_login_optional'] == 1))
{
return false;
}
}
// Check if OTP is valid YubiKey OTP
$deviceid = yubikey_is_otp($yubikey_otp);
if(!$deviceid)
{
return 'LOGIN_ERROR_YUBIKEY_BAD_OTP';
}
// Validate OTP
$otp_val_status = yubikey_validate_otp($yubikey_otp);
if($otp_val_status)
{
return $otp_val_status;
}
// Check if YubiKey already exists
$row = yubikey_get_details($deviceid);
if($row)
{
return 'ERROR_YUBIKEY_ALREADY_EXISTS';
}
return false;
}
Open:includes/session.php
Find
Tip: This may be a partial find and not the whole line.
Code:
unset($lang_set);
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
$this->add_lang('mods/yubikey_login');
Open:includes/acp/acp_users.php
Find
Tip: This may be a partial find and not the whole line.
Code:
display_custom_bbcodes();
break;
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
case 'yubikey_login':
include $phpbb_root_path . 'includes/functions_yubikey.' . $phpEx;
$action = isset($_GET['action']) ? request_var('action', '') : false;
$u = isset($_GET['u']) ? '&u=' . request_var('u', 0) : '';
$deviceid = request_var('device', '0');
if($action)
{
if ($deviceid == '0')
{
trigger_error($user->lang['YUBIKEY_ERROR_INVALID'] . adm_back_link($this->u_action . "&u=" . $user_id), E_USER_WARNING);
}
// Perform the requested action
switch ($action)
{
case 'activate':
activate_deactivate_yubikey($deviceid, YUBIKEY_ACTIVE, ($this->u_action) ? $this->u_action . $u : null, true, true);
break;
case 'deactivate':
activate_deactivate_yubikey($deviceid, YUBIKEY_INACTIVE, ($this->u_action) ? $this->u_action . $u : null, true, true);
break;
case 'delete':
delete_yubikey($deviceid, ($this->u_action) ? $this->u_action . $u : null . $u, true, true);
break;
}
}
// Get YubiKeys to display
$yubikeys_exist = false;
$sql = ' SELECT ut.user_id, ut.username, yt.deviceid, yt.lastseen, yt.status';
$sql .= ' FROM ' . USERS_TABLE . ' ut INNER JOIN ' . YUBIKEY_TABLE . ' yt ON ut.user_id = yt.user_id';
$sql .= ' WHERE ut.user_id = ' . (int) $user_id;
$result = $db->sql_query_limit($sql, 50);
while ($row = $db->sql_fetchrow($result))
{
$yubikeys_exist = true;
$lastlogin = $row['lastseen'];
if ($lastlogin == 0)
{
$lastlogin = $user->lang['NEVER'];
}
elseif (time() - $lastlogin < 86400)
{
$lastlogin = date("g:i a", $lastlogin);
}
else
{
$lastlogin = date("F j, Y", $lastlogin);
}
$active_lang = ($row['status'] == YUBIKEY_ACTIVE)? 'YUBIKEY_DEACTIVATE' : 'YUBIKEY_ACTIVATE';
$active_value = ($row['status'] == YUBIKEY_ACTIVE) ? 'deactivate' : 'activate';
$template->assign_block_vars('yubikey', array(
'USER_NAME' => $row['username'],
'DEVICE_ID' => $row['deviceid'],
'LASTLOGIN' => $lastlogin,
'STATUS' => ($row['status'] == YUBIKEY_ACTIVE)? "Active": "Deactive",
'U_ACTIVATE_DEACTIVATE' => append_sid("{$this->u_action}&u={$user_id}&action=$active_value&device={$row['deviceid']}"),
'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang],
'U_DELETE' => append_sid("{$this->u_action}&u={$user_id}&action=delete&device={$row['deviceid']}"),
));
}
$db->sql_freeresult($result);
$template->assign_vars(array(
'S_YUBIKEY_LOGIN' => true,
'S_YUBIKEYS_EXIST' => $yubikeys_exist,
));
break;
Open:includes/acp/info/acp_users.php
Find
Tip: This may be a partial find and not the whole line.
Code:
'attach' => array('title' => 'ACP_USER_ATTACH', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
'yubikey_login' => array('title' => 'ACP_YUBIKEY_USERS', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
Open:includes/ucp/ucp_register.php
Find
Tip: This may be a partial find and not the whole line.
Code:
'lang' => basename(request_var('lang', $user->lang_name)),
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
'yubikey_otp' => strtolower(trim(request_var('yubikey_otp', ''))),
Find
Tip: This may be a partial find and not the whole line.
Code:
'tz' => array('num', false, -14, 14),
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
'yubikey_otp' => array('yubikey_otp'),
Find
Tip: This may be a partial find and not the whole line.
Code:
trigger_error('NO_USER', E_USER_ERROR);
}
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
// Add YubiKey...
if($config['allow_yubikey_login'])
{
$yubikey_otp = strtolower(trim(request_var('yubikey_otp', '')));
if($yubikey_otp != '')
{
if (!function_exists('insert_yubikey'))
{
include "{$phpbb_root_path}includes/functions_yubikey.$phpEx";
}
$deviceid = yubikey_get_deviceid($yubikey_otp);
insert_yubikey($deviceid, $user_id);
}
}
Find
Tip: This may be a partial find and not the whole line.
Code:
'L_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
'S_YUBIKEY_LOGIN_ENABLED' => ($config['allow_yubikey_login']) ? true : false,
'S_YUBIKEY_IS_OPTIONAL' => ($config['allow_yubikey_login'] == YUBIKEY_LOGIN_SCHEME_UN_OR_YK_PWD || ($config['yubikey_login_method'] == YUBIKEY_LOGIN_SCHEME_UN_PWD_YK && $config['yubikey_login_optional'] == 1)) ? true : false,
Open:language/en/ucp.php
Find
Tip: This may be a partial find and not the whole line.
Code:
'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your username and password.',
Replace with
Tip: Replace the preceding line(s) to find with the following lines.
Code:
'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your credentials.',
Open:styles/prosilver/template/forum_fn.js
Find
Tip: This may be a partial find and not the whole line.
Code:
if (element.type == 'text' || element.type == 'password')
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
if(element.id == 'yubikey_otp') continue;
Open:styles/prosilver/template/index_body.html
Find
Tip: This may be a partial find and not the whole line.
Code:
<!-- INCLUDE overall_header.html -->
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
<script type="text/javascript">
// <![CDATA[
<!-- IF S_YUBIKEY_LOGIN_ENABLED -->
function handle_enter(event)
{
var evt = event || window.event;
var code = evt.which || evt.keyCode || evt.charCode;
if (13 == code)
{
if(evt.which)
{
evt.preventDefault();
}
else if (evt.keyCode)
{
evt.keyCode = 9;
}
else
{
evt.charCode = 9;
}
document.getElementsByName('login')[0].click();
}
}
<!-- ENDIF -->
// ]]>
</script>
Find
Tip: This may be a partial find and not the whole line.
Code:
<label for="username">{L_USERNAME}:</label> <input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" />
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
<!-- IF S_LOGIN_UN_REQD -->
Find
Tip: This may be a partial find and not the whole line.
Code:
<label for="password">{L_PASSWORD}:</label> <input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" />
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
<!-- ENDIF -->
<!-- IF S_LOGIN_PWD_REQD -->
Find
Tip: This may be a partial find and not the whole line.
Code:
<label for="password">{L_PASSWORD}:</label> <input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" />
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
<!-- ENDIF -->
<!-- IF S_YUBIKEY_LOGIN_ENABLED -->
<label for="yubikey_otp">{L_YUBIKEY_OTP}:</label> <input type="text" name="yubikey_otp" id="yubikey_otp" size="44" class="yubikey-otp autowidth" title="{L_YUBIKEY_OTP_FULL}" onkeypress="javascript:handle_enter(event);" />
<!-- ENDIF -->
Open:styles/prosilver/template/login_body.html
Find
Tip: This may be a partial find and not the whole line.
Code:
<!-- INCLUDE overall_header.html -->
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
<script type="text/javascript">
// <![CDATA[
<!-- IF S_YUBIKEY_LOGIN_ENABLED -->
function handle_enter(event)
{
var evt = event || window.event;
var code = evt.which || evt.keyCode || evt.charCode;
if (13 == code)
{
if(evt.which)
{
evt.preventDefault();
}
else if (evt.keyCode)
{
evt.keyCode = 9;
}
else
{
evt.charCode = 9;
}
document.getElementsByName('login')[0].click();
}
}
<!-- ENDIF -->
// ]]>
</script>
Find
Tip: This may be a partial find and not the whole line.
Code:
<form action="{S_LOGIN_ACTION}" method="post" id="login">
Replace with
Tip: Replace the preceding line(s) to find with the following lines.
Code:
<form action="{S_LOGIN_ACTION}" method="post">
Find
Tip: This may be a partial find and not the whole line.
Code:
<dl>
<dt><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}:</label></dt>
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
<!-- IF S_LOGIN_UN_REQD -->
Find
Tip: This may be a partial find and not the whole line.
Code:
<dl>
<dt><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}:</label></dt>
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
<!-- ELSE -->
<input type="hidden" name="{USERNAME_CREDENTIAL}" id="{USERNAME_CREDENTIAL}" value="{USERNAME}"/>
<!-- ENDIF -->
<!-- IF S_LOGIN_PWD_REQD -->
Find and Delete
Tip: Find and delete this code.
Code:
<!-- IF S_DISPLAY_FULL_LOGIN and (U_SEND_PASSWORD or U_RESEND_ACTIVATION) -->
<!-- IF U_SEND_PASSWORD --><dd><a href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a></dd><!-- ENDIF -->
<!-- IF U_RESEND_ACTIVATION --><dd><a href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a></dd><!-- ENDIF -->
<!-- ENDIF -->
Find
Tip: This may be a partial find and not the whole line.
Code:
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
<!-- ENDIF -->
Find
Tip: This may be a partial find and not the whole line.
Code:
<!-- IF S_DISPLAY_FULL_LOGIN -->
<dl>
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
<!-- IF S_YUBIKEY_LOGIN_ENABLED -->
<dl>
<dt><label for="{YUBIKEY_CREDENTIAL}"><a href="http://www.yubico.com/products/yubikey/">{L_YUBIKEY_OTP}</a>:</label><!-- IF S_YUBIKEY_IS_OPTIONAL --><br/>{L_YUBIKEY_IS_OPTIONAL_UNTIL_REGISTERED}<!-- ENDIF --></dt>
<dd><input type="text" tabindex="4" name="{YUBIKEY_CREDENTIAL}" id="{YUBIKEY_CREDENTIAL}" size="44" class="yubikey-otp autowidth" onkeypress="javascript:handle_enter(event);" /></dd>
</dl>
<!-- ENDIF -->
Find
Tip: This may be a partial find and not the whole line.
Code:
<!-- IF S_DISPLAY_FULL_LOGIN -->
<dl>
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
<!-- IF U_SEND_PASSWORD or U_RESEND_ACTIVATION or (S_YUBIKEY_LOGIN_ENABLED and U_YUBIKEY_REPORTLOST) -->
<!-- IF U_SEND_PASSWORD and S_LOGIN_PWD_REQD --><dd><a href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a></dd><!-- ENDIF -->
<!-- IF U_RESEND_ACTIVATION --><dd><a href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a></dd><!-- ENDIF -->
<!-- IF S_YUBIKEY_LOGIN_ENABLED and U_YUBIKEY_REPORTLOST --><dd><a href="{U_YUBIKEY_REPORTLOST}">{L_LOST_YUBIKEY}</a></dd><!-- ENDIF -->
<!-- ENDIF -->
Open:styles/prosilver/template/ucp_register.html
Find
Tip: This may be a partial find and not the whole line.
Code:
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_REFRESH -->
Add before
Tip: Add these lines on a new blank line before the preceding line(s) to find.
Code:
<!-- IF S_YUBIKEY_LOGIN_ENABLED -->
function handle_enter(event)
{
var evt = event || window.event;
var code = evt.which || evt.keyCode || evt.charCode;
if (13 == code)
{
if(evt.which)
{
evt.preventDefault();
}
else if (evt.keyCode)
{
evt.keyCode = 9;
}
else
{
evt.charCode = 9;
}
}
}
<!-- ENDIF -->
Find
Tip: This may be a partial find and not the whole line.
Code:
<dd><input type="password" tabindex="5" name="password_confirm" id="password_confirm" size="25" value="{PASSWORD_CONFIRM}" class="inputbox autowidth" title="{L_CONFIRM_PASSWORD}" /></dd>
</dl>
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
<!-- IF S_YUBIKEY_LOGIN_ENABLED -->
<dl>
<dt><label for="yubikey_otp"><a href="http://www.yubico.com/products/yubikey/">{L_YUBIKEY_OTP}</a>:</label><br /><span>{L_YUBIKEY_OTP_FULL_EXPLAIN}</span></dt>
<dd><input type="text" tabindex="6" name="yubikey_otp" id="yubikey_otp" size="44" maxlength="44" class="yubikey-otp autowidth" title="{L_YUBIKEY_OTP}" onkeypress="javascript:handle_enter(event);" /><!-- IF S_YUBIKEY_IS_OPTIONAL --> {L_YUBIKEY_IS_OPTIONAL}<!-- ENDIF --></dd>
</dl>
<!-- ENDIF -->
Open:styles/prosilver/theme/common.css
Find
Tip: This may be a partial find and not the whole line.
Code:
.clear {
display: block;
clear: both;
font-size: 1px;
line-height: 1px;
background: transparent;
}
Add after
Tip: Add these lines on a new blank line after the preceding line(s) to find.
Code:
.yubikey-otp {
background-image: url("images/yubico-icon-small.gif");
background-position: 2px 50%;
background-repeat: no-repeat;
border: 1px solid #c0c0c0;
padding: 2px;
padding-left: 20px;
vertical-align: middle;
cursor: text;
width: 15%;
}
PHP install file
There is a PHP install file that needs to be run in order to complete the installation.
To run it point your browser to, for example, domain.tld/phpBB3/install/index.php
Code:
install/index.php
DIY instructions
Manual Steps
Uninstallation
To uninstall, remember to run install/index.php?action=uninstall
Save all files
You have finished the installation for this MOD. Upload all changed files to your website. If the installation went bad, simply restore your backed up files.