-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Added Yubikey field to user settings
Closes #10
- Loading branch information
Showing
3 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
namespace DERHANSEN\SfYubikey\Hooks; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
|
||
/** | ||
* User Settings class | ||
*/ | ||
class UserSettings | ||
{ | ||
|
||
/** | ||
* Returns a textarea with the YubiKey IDs | ||
* | ||
* @return string | ||
*/ | ||
public function user_yubikeyId() | ||
{ | ||
$html = '<textarea id="field_tx_sfyubikey_yubikey_id" name="data[be_users][tx_sfyubikey_yubikey_id]" | ||
rows="5" class="form-control t3js-formengine-textarea formengine-textarea">' . | ||
htmlspecialchars($GLOBALS['BE_USER']->user['tx_sfyubikey_yubikey_id']) . '</textarea>'; | ||
return $html; | ||
} | ||
|
||
/** | ||
* Returns the current BE user. | ||
* | ||
* @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication | ||
*/ | ||
protected function getBackendUser() | ||
{ | ||
return $GLOBALS['BE_USER']; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters