[auth] support Feebee hardware authentication
This commit is contained in:
@@ -57,6 +57,8 @@ danbarry
|
||||
+ [interface] Display options (work in progress); thanks to Dave Grijalva
|
||||
for the idea about showing the display field while browsing
|
||||
- bug #1910621 [display] part 2: do not display a BINARY content as text
|
||||
+ [auth] support Feebee hardware authentication (todo: Documentation.html,
|
||||
improve code formatting)
|
||||
|
||||
2.11.7.0 (not yet released)
|
||||
- bug #1908719 [interface] New field cannot be auto-increment and primary key
|
||||
|
9
contrib/feebees.sample.conf
Normal file
9
contrib/feebees.sample.conf
Normal file
@@ -0,0 +1,9 @@
|
||||
# This is a typical file used to enable Feebee hardware authentication.
|
||||
# Each line must contain the Feebee Id and the user associated with it
|
||||
# Hardware authentication is enabled only if the file 'feebees.conf' exists.
|
||||
# To get the id of your feebee just go on the http://auth-sample.musbe.com while
|
||||
# your feebee is connected
|
||||
|
||||
0000000000000000000000000000763A:root
|
||||
000000000000000000000000000089E4:steve
|
||||
0000000000000000000000000000231E:scott
|
@@ -1075,4 +1075,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1074,4 +1074,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1076,4 +1076,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1071,4 +1071,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1050,4 +1050,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1068,4 +1068,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1051,4 +1051,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1050,4 +1050,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1074,4 +1074,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1048,4 +1048,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1071,4 +1071,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1046,4 +1046,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1076,4 +1076,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1055,4 +1055,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1049,4 +1049,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1050,4 +1050,8 @@ $strZip = '„zazipováno“';
|
||||
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1050,4 +1050,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1072,4 +1072,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -288,6 +288,10 @@ $strExtendedInserts = 'Extended inserts';
|
||||
$strExtra = 'Extra';
|
||||
|
||||
$strFailedAttempts = 'Failed attempts';
|
||||
$strFeebeeAuthenticating = 'Authenticating...';
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed';
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id';
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged';
|
||||
$strField = 'Field';
|
||||
$strFieldHasBeenDropped = 'Field %s has been dropped';
|
||||
$strFieldInsertFromFileTempDirNotExists = 'Error moving the uploaded file, see FAQ 1.11';
|
||||
|
@@ -1056,4 +1056,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1050,4 +1050,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1047,4 +1047,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1049,4 +1049,8 @@ $strZip = 'comprimido no formato "zip"';
|
||||
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1076,4 +1076,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1056,4 +1056,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1073,4 +1073,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1068,4 +1068,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1076,4 +1076,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1067,4 +1067,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1066,4 +1066,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1051,4 +1051,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1067,4 +1067,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1071,4 +1071,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1073,4 +1073,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1066,4 +1066,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1051,4 +1051,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1088,4 +1088,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1071,4 +1071,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1048,4 +1048,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1073,4 +1073,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1044,4 +1044,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1077,4 +1077,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1065,4 +1065,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1052,4 +1052,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1050,4 +1050,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1050,4 +1050,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1053,4 +1053,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1051,4 +1051,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1070,4 +1070,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1046,4 +1046,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1049,4 +1049,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1062,4 +1062,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1072,4 +1072,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1056,4 +1056,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -1070,4 +1070,8 @@ $strViewHasAtLeast = 'This view has at least this number of rows. Please refer t
|
||||
$strUserDefined = 'User-defined'; //to translate
|
||||
$strRelationalKey = 'Relational key'; //to translate
|
||||
$strRelationalDisplayField = 'Relational display field'; //to translate
|
||||
$strFeebeeNoKey = 'No valid authentication key plugged'; //to translate
|
||||
$strFeebeeNoKeyId = 'File %s does not contain any key id'; //to translate
|
||||
$strFeebeeAuthFailed = 'Hardware authentication failed'; //to translate
|
||||
$strFeebeeAuthenticating = 'Authenticating...'; //to translate
|
||||
?>
|
||||
|
@@ -12,6 +12,8 @@ if (! defined('PMA_COMING_FROM_COMMON')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require './libraries/auth/feebee/feebee.auth.lib.php';
|
||||
|
||||
if (function_exists('mcrypt_encrypt') || PMA_dl('mcrypt')) {
|
||||
/**
|
||||
* Uses faster mcrypt library if available
|
||||
@@ -216,6 +218,32 @@ if (top != self) {
|
||||
echo '</body></html>';
|
||||
exit;
|
||||
}
|
||||
|
||||
// BEGIN Feebee Integration
|
||||
$feebeeErr = Feebee_auth_error();
|
||||
if ($feebeeErr != null) {
|
||||
PMA_Message::error($feebeeErr)->display();
|
||||
if ($GLOBALS['error_handler']->hasDisplayErrors()) {
|
||||
echo '<div>';
|
||||
$GLOBALS['error_handler']->dispErrors();
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</div>' . "\n";
|
||||
if (file_exists('./config.footer.inc.php')) {
|
||||
require './config.footer.inc.php';
|
||||
}
|
||||
echo '</body></html>';
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_SESSION['PHP_AUTH_FORCE_USER'])) {
|
||||
$default_user = $_SESSION['PHP_AUTH_FORCE_USER'];
|
||||
$user_input_disabled = 'readonly="readonly"';
|
||||
}
|
||||
else
|
||||
$user_input_disabled = '';
|
||||
// END Feebee Integration
|
||||
|
||||
?>
|
||||
<br />
|
||||
<!-- Login form -->
|
||||
@@ -243,7 +271,7 @@ if (top != self) {
|
||||
<?php } ?>
|
||||
<div class="item">
|
||||
<label for="input_username"><?php echo $GLOBALS['strLogUsername']; ?></label>
|
||||
<input type="text" name="pma_username" id="input_username" value="<?php echo htmlspecialchars($default_user); ?>" size="24" class="textfield" />
|
||||
<input type="text" name="pma_username" id="input_username" value="<?php echo htmlspecialchars($default_user); ?>" size="24" class="textfield" <?php echo $user_input_disabled; ?>/>
|
||||
</div>
|
||||
<div class="item">
|
||||
<label for="input_password"><?php echo $GLOBALS['strLogPassword']; ?></label>
|
||||
@@ -389,6 +417,11 @@ function PMA_auth_check()
|
||||
return false;
|
||||
}
|
||||
|
||||
// BEGIN Feebee Integration
|
||||
if (! Feebee_auth_check())
|
||||
return false;
|
||||
// END Feebee Integration
|
||||
|
||||
if (defined('PMA_CLEAR_COOKIES')) {
|
||||
foreach($GLOBALS['cfg']['Servers'] as $key => $val) {
|
||||
PMA_removeCookie('pmaPass-' . $key);
|
||||
|
122
libraries/auth/feebee/authentication.inc.php
Normal file
122
libraries/auth/feebee/authentication.inc.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
require_once "libraries/auth/feebee/fbauth.php";
|
||||
|
||||
$_SESSION['PHP_AUTH_FEEBEE_RND_TOKEN'] = FbAuth_GetFastRndToken();
|
||||
|
||||
?>
|
||||
<embed type="application/fbauth-plugin" width=1 height=1 hidden="true" id="fbauth"><br>
|
||||
<script>
|
||||
var glob_FbAuthPlugin = document.embeds["fbauth"];
|
||||
var glob_ValidFeebeeId;
|
||||
var glob_ValidFeebeeOtp;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// List the id of the Feebee connected to the PC
|
||||
// Returns a string containing comma separated Feebee Ids
|
||||
// A Feebee id is a 32 char hexadecimal value.
|
||||
function FbAuth_ListKeyIds()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (window.ActiveXObject)
|
||||
{
|
||||
var x = new ActiveXObject("FbAuthAx.FbAuthCtl");
|
||||
return x.list();
|
||||
}
|
||||
else
|
||||
return glob_FbAuthPlugin.list();
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// alert("FbAuth_ListKeyIds" + e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Ask the Connected Feebee to generate an OTP
|
||||
// fbid: The id of the connected Feebee (returne by FbAuth_ListKeyIds())
|
||||
// rt: A random token
|
||||
// return: The calculated OTP encoded in a 64 chars hexadecimal value.
|
||||
function FbAuth_GetOtp(fbid, rt)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (window.ActiveXObject)
|
||||
{
|
||||
var x = new ActiveXObject("FbAuthAx.FbAuthCtl");
|
||||
return x.getotp(fbid, rt);
|
||||
}
|
||||
else
|
||||
return glob_FbAuthPlugin.getotp(fbid, rt);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// alert("FbAuth_GetOtp " + e);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Set a unplug handler (url) to the specified connected feebee
|
||||
// fbid: The id of the connected Feebee (returne by FbAuth_ListKeyIds())
|
||||
// key: The key that index that url, (aplhanumeric values only)
|
||||
// url: The url that will be launched ("" deletes the url)
|
||||
function FbAuth_SetUnplugUrl(fbid, key, url)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (window.ActiveXObject)
|
||||
{
|
||||
var x = new ActiveXObject("FbAuthAx.FbAuthCtl");
|
||||
return x.setunplugurl(fbid, key, url);
|
||||
}
|
||||
else
|
||||
return glob_FbAuthPlugin.setunplugurl(fbid, key, url);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// alert("FbAuth_SetUnplugUrl " + e);
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Return a valid connected key id
|
||||
function Feebee_GetValidKey()
|
||||
{
|
||||
var valids = <?php echo '"'.$_SESSION['PHP_AUTH_VALID_FEEBEES'].'"';?>;
|
||||
var connected_keys = FbAuth_ListKeyIds().split(",");
|
||||
for (i in connected_keys)
|
||||
if (connected_keys[i] != null && connected_keys[i].length == 32)
|
||||
if (valids.indexOf(connected_keys[i]) >= 0)
|
||||
return connected_keys[i];
|
||||
|
||||
return "none";
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Return a valid connected key id
|
||||
function Feebee_GetOtp()
|
||||
{
|
||||
var key = Feebee_GetValidKey();
|
||||
if (key.length != 32)
|
||||
return "";
|
||||
|
||||
var url = "" + window.location;
|
||||
|
||||
if (url.indexOf("?") > 0)
|
||||
url = url.substr(0, url.indexOf("?"));
|
||||
|
||||
if (url.lastIndexOf("/") > 0)
|
||||
url = url.substr(0, url.lastIndexOf("/"));
|
||||
|
||||
FbAuth_SetUnplugUrl(key, "pma_login", url + "/libraries/auth/feebee/unplugged.php?session_to_unset=<?php echo session_id();?>");
|
||||
|
||||
return FbAuth_GetOtp(key, <?php echo '"'.$_SESSION['PHP_AUTH_FEEBEE_RND_TOKEN'].'"';?>);
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
?>
|
224
libraries/auth/feebee/fbauth.php
Normal file
224
libraries/auth/feebee/fbauth.php
Normal file
@@ -0,0 +1,224 @@
|
||||
<?php
|
||||
/**
|
||||
* Library that provides common functions that are used to help integrating Feebee Authentication in a PHP web site
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Errors codes
|
||||
*/
|
||||
define ("FBAUTH_ERR_INVALID_DEV_STATUS",901); // The satus of the device is not FBAUTH_STATUS_OK
|
||||
define ("FBAUTH_ERR_INTERNAL",902); // Should never occurd
|
||||
define ("FBAUTH_ERR_OUTDATED_RND_TOKEN",910); // You random token is too old
|
||||
define ("FBAUTH_ERR_INVALID_OTP",911); // The otp was not correct
|
||||
|
||||
/**
|
||||
* Those errors are considered as an attack and your site will be blacklisted during one minute
|
||||
* if you receive one of those errors
|
||||
*/
|
||||
define ("FBAUTH_ERR_BADLY_ENCODED_REQUEST",920);
|
||||
define ("FBAUTH_ERR_INVALID_RND_TOKEN",921);
|
||||
define ("FBAUTH_ERR_DEV_NOT_FOUND",922);
|
||||
|
||||
/**
|
||||
* The last error of an operation is alway put in this global var
|
||||
*/
|
||||
global $gAuthErr;
|
||||
|
||||
$gAuthErr = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Get a Random Token from a Token Server
|
||||
* The RT is a 64 vhars hexadecimal value
|
||||
* You should better use FbAuth_GetFastRndToken() for performance
|
||||
* @access public
|
||||
*/
|
||||
function FbAuth_GetRndToken()
|
||||
{
|
||||
return @file_get_contents('http://auth-rnd-gen.musbe.net/FULL-RND-TOKEN');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a Half Random Token from a Token Server
|
||||
* The RT is a 64 vhars hexadecimal value
|
||||
* Use this value if you want to make your own FbAuth_GetFastRndToken()
|
||||
* @access public
|
||||
*/
|
||||
function FbAuth_GetHalfRndToken()
|
||||
{
|
||||
return @file_get_contents('http://auth-rnd-gen.musbe.net/HALF-RND-TOKEN');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a Random Token
|
||||
* The RT is a 64 vhars hexadecimal value
|
||||
* This function generates a unique random token for each call but call the
|
||||
* server only once every 30 seconds.
|
||||
* You should always use this function to get random token.
|
||||
* @access public
|
||||
*/
|
||||
function FbAuth_GetFastRndToken()
|
||||
{
|
||||
$res = "";
|
||||
|
||||
// We check if we have a valid RT is the session
|
||||
if (isset($_SESSION['rnd-token-date']))
|
||||
if (time() - $_SESSION['rnd-token-date'] < 30)
|
||||
$res = $_SESSION['rnd-token'];
|
||||
|
||||
// If not we try to get it from a temp file (PHP >= 5.2.1 only)
|
||||
if (strlen($res) != 32)
|
||||
{
|
||||
if (function_exists('sys_get_temp_dir') )
|
||||
{
|
||||
$tempdir = sys_get_temp_dir();
|
||||
$modif = filemtime($tempdir."/feebee-rnd-token");
|
||||
if ($modif != false)
|
||||
if (time() - $modif < 30)
|
||||
{
|
||||
$res = @file_get_contents($tempdir."/feebee-rnd-token");
|
||||
if (strlen($res) != 32)
|
||||
$res = "";
|
||||
else
|
||||
{
|
||||
$_SESSION['rnd-token'] = $res;
|
||||
$_SESSION['rnd-token-date'] = $modif;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If we don't have a valid RT here we have to get it from the server
|
||||
if (strlen($res) != 32)
|
||||
{
|
||||
$res = substr(FbAuth_GetHalfRndToken(), 0, 32);
|
||||
$_SESSION['rnd-token'] = $res;
|
||||
$_SESSION['rnd-token-date'] = time();
|
||||
if (isset($tempdir))
|
||||
{
|
||||
$file = fopen ($tempdir."/feebee-rnd-token" , "w");
|
||||
@fwrite($file, $res);
|
||||
@fclose($file);
|
||||
}
|
||||
}
|
||||
|
||||
return $res.strtoupper(md5("Musbe Authentication Key" + mt_rand() + date(DATE_ATOM)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks the result of an http request
|
||||
*
|
||||
* @param res the result of the http request
|
||||
* @param header the header returned by the http request
|
||||
* @access private
|
||||
*/
|
||||
function FbAuth_CheckForOK($res, $header)
|
||||
{
|
||||
$err = substr($header, 9, 3); //HTTP/1.0
|
||||
|
||||
if ($res == "OK" && $err == 200)
|
||||
return true;
|
||||
|
||||
global $gAuthErr;
|
||||
if ($err != "")
|
||||
$gAuthErr = $err;
|
||||
else
|
||||
$gAuthErr = "Unknown Error";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks that an OTP generated by a Feebee is valid
|
||||
*
|
||||
* @param fbid The id of the feebee
|
||||
* @param rt The random token used to generate the otp
|
||||
* @param otp The otp generated by the feebee
|
||||
* @return true or false
|
||||
* @access public
|
||||
*/
|
||||
function FbAuth_CheckOtp($fbid, $rt, $otp)
|
||||
{
|
||||
global $http_response_header;
|
||||
$res = file_get_contents('http://auth-check.musbe.net/CHECK-OTP/'.$fbid.'/'.$rt.'/'.$otp);
|
||||
return FbAuth_CheckForOK($res, $http_response_header[0]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Values that are associated with a key.
|
||||
* The following values can be returned by the FbAuth_GetStatus() function
|
||||
*/
|
||||
define ("FBAUTH_STATUS_OK",0);
|
||||
define ("FBAUTH_STATUS_NOT_FOUND",1); // The key does not exist in the db
|
||||
define ("FBAUTH_STATUS_INACTIVE",2); // The key has never been activated
|
||||
define ("FBAUTH_STATUS_LOST",3); // The user has lost his key
|
||||
define ("FBAUTH_STATUS_STOLLEN",4); // The key was stollen
|
||||
define ("FBAUTH_STATUS_FEE_DUE",5); // The annual fee was not paid
|
||||
define ("FBAUTH_STATUS_OBSOLETE",6); // The hardware is no longer supported
|
||||
define ("FBAUTH_STATUS_UNKOWN",201); // We could not connect to the authentication server
|
||||
|
||||
/**
|
||||
* Values that are associated with a key.
|
||||
* The Javascript Api can also return the following values
|
||||
*/
|
||||
define ("FBAUTH_STATUS_REPLACED",100); // This key has been replaced by a backup key
|
||||
define ("FBAUTH_STATUS_BACKUP_KEY",101); // This key is a backup key that is not activated yet
|
||||
define ("FBAUTH_STATUS_NOTPLUGGED",200); // This key is not plugged in the computer
|
||||
|
||||
|
||||
/**
|
||||
* Return the text corresponding to the integer status of a key
|
||||
*
|
||||
* @param status The status
|
||||
* @return The text corresponding to the status
|
||||
* @access public
|
||||
*/
|
||||
function FbAuth_GetStatusStr($status)
|
||||
{
|
||||
switch($status)
|
||||
{
|
||||
case FBAUTH_STATUS_OK : return 'OK';
|
||||
case FBAUTH_STATUS_NOT_FOUND : return 'Key does not exist in the db';
|
||||
case FBAUTH_STATUS_INACTIVE : return 'Key not activated';
|
||||
case FBAUTH_STATUS_LOST : return 'Key was lost';
|
||||
case FBAUTH_STATUS_STOLLEN : return 'Key was stollen';
|
||||
case FBAUTH_STATUS_FEE_DUE : return 'The annual fee was not paid';
|
||||
case FBAUTH_STATUS_OBSOLETE : return 'Key no longer supported';
|
||||
case FBAUTH_STATUS_REPLACED : return 'This key has been replaced by a backup key';
|
||||
case FBAUTH_STATUS_BACKUP_KEY : return 'This key is a backup key that is not activated yet';
|
||||
case FBAUTH_STATUS_NOTPLUGGED : return 'This key is not plugged in the computer';
|
||||
case FBAUTH_STATUS_UNKOWN : return 'Unknow Status, could not connect to the authentication server';
|
||||
}
|
||||
return 'unknown status '.$status;
|
||||
}
|
||||
|
||||
/**
|
||||
* If your web site requires a key to login you should check that the key
|
||||
* is still valid (has not been lost or stolen) before requiring it.
|
||||
* A key can be authenticated only if its status is FBAUTH_STATUS_OK
|
||||
* @param fbid The id of the feebee
|
||||
* @return The status of the feebee
|
||||
* @access public
|
||||
*/
|
||||
function FbAuth_GetStatus($fbid)
|
||||
{
|
||||
global $http_response_header;
|
||||
$res = file_get_contents('http://auth-status.musbe.net/GET-STATUS/'.$fbid);
|
||||
|
||||
$err = substr($http_response_header[0], 9, 3); //HTTP/1.0
|
||||
if ($err == "200")
|
||||
return intval($res);
|
||||
|
||||
// in case of connection failure we return OK but it should never occurd
|
||||
return FBAUTH_STATUS_UNKOWN;
|
||||
}
|
||||
|
||||
|
||||
?>
|
103
libraries/auth/feebee/feebee.auth.lib.php
Normal file
103
libraries/auth/feebee/feebee.auth.lib.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
function Feebee_auth_check()
|
||||
{
|
||||
// Load the feebee.conf file the first time
|
||||
if (empty($_SESSION['PHP_AUTH_REQUIRED_FEEBEE'])) {
|
||||
global $cfg;
|
||||
$confFile = $cfg['Server']['auth_feebee_config'];
|
||||
$_SESSION['PHP_AUTH_REQUIRES_FEEBEE'] = (! empty($confFile) && file_exists($confFile));
|
||||
// $_SESSION['PHP_AUTH_REQUIRES_FEEBEE'] = file_exists($confFile);
|
||||
if ($_SESSION['PHP_AUTH_REQUIRES_FEEBEE']) {
|
||||
$_SESSION['PHP_AUTH_VALID_FEEBEES'] = "";
|
||||
$valid_feebees = split("\n",@file_get_contents($confFile));
|
||||
foreach ($valid_feebees as $line) {
|
||||
if (ereg("^[0-9A-F]{32}:.+$", $line) != false)
|
||||
$_SESSION['PHP_AUTH_VALID_FEEBEES'] .= $line . ",";
|
||||
}
|
||||
}
|
||||
else
|
||||
unset($_SESSION['PHP_AUTH_VALID_FEEBEES']);
|
||||
}
|
||||
|
||||
// check if a web key has been authenticated
|
||||
if ($_SESSION['PHP_AUTH_REQUIRES_FEEBEE']) {
|
||||
if (empty($_SESSION['PHP_AUTH_AUTHENTICATED_FEEBEE']))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function Feebee_auth_error()
|
||||
{
|
||||
if (! $_SESSION['PHP_AUTH_REQUIRES_FEEBEE'])
|
||||
return null;
|
||||
|
||||
if (! empty($_SESSION['PHP_AUTH_AUTHENTICATED_FEEBEE']))
|
||||
return null;
|
||||
|
||||
if (empty($_SESSION['PHP_AUTH_VALID_FEEBEES']))
|
||||
return sprintf($GLOBALS['strFeebeeNoKeyId'], $GLOBALS['cfg']['Server']['auth_feebee_config']);
|
||||
|
||||
$result = null;
|
||||
parse_str($_SERVER['QUERY_STRING']);
|
||||
if (isset($feebee_id)) {
|
||||
unset($_SESSION['PHP_AUTH_AUTHENTICATED_FEEBEE']);
|
||||
if (! isset($_SESSION['PHP_AUTH_FEEBEE_RND_TOKEN'])) {
|
||||
unset($feebee_id);
|
||||
}
|
||||
else {
|
||||
if (strlen($feebee_id) == 32) {
|
||||
$res = file_get_contents('http://auth-check.musbe.net/CHECK-OTP/'.$feebee_id.'/'.$_SESSION['PHP_AUTH_FEEBEE_RND_TOKEN'].'/'.$feebee_otp);
|
||||
unset($_SESSION['PHP_AUTH_FEEBEE_RND_TOKEN']);
|
||||
if ($res != "OK") {
|
||||
$result = $GLOBALS['strFeebeeAuthFailed'] . ' (' . $res . ')';
|
||||
}
|
||||
else {
|
||||
$_SESSION['PHP_AUTH_AUTHENTICATED_FEEBEE'] = $feebee_id;
|
||||
unset($_SESSION['PHP_AUTH_FORCE_USER']);
|
||||
$valid_feebees = split(",",$_SESSION['PHP_AUTH_VALID_FEEBEES']);
|
||||
foreach ($valid_feebees as $line) {
|
||||
if (substr($line,0,32) == $feebee_id) {
|
||||
$_SESSION['PHP_AUTH_FORCE_USER'] = substr($line,33);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
$result = $GLOBALS['strFeebeeNoKey'];
|
||||
}
|
||||
}
|
||||
|
||||
require_once './libraries/auth/feebee/authentication.inc.php';
|
||||
|
||||
if (! isset($feebee_id)) {
|
||||
?>
|
||||
<script>
|
||||
window.location.search="?feebee_id=" + Feebee_GetValidKey() + "&feebee_otp=" + Feebee_GetOtp();
|
||||
</script>
|
||||
<?php
|
||||
return $GLOBALS['strFeebeeAuthenticating'];
|
||||
}
|
||||
|
||||
?>
|
||||
<script>
|
||||
var key = Feebee_GetValidKey();
|
||||
function timedCheck()
|
||||
{
|
||||
if (key != Feebee_GetValidKey())
|
||||
window.location.search="";
|
||||
|
||||
setTimeout("timedCheck()",1000);
|
||||
}
|
||||
timedCheck();
|
||||
</script>
|
||||
<?php
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
9
libraries/auth/feebee/unplugged.php
Normal file
9
libraries/auth/feebee/unplugged.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
// This url is triggered when a feebee is unplugged
|
||||
|
||||
parse_str($_SERVER['QUERY_STRING']);
|
||||
session_id($session_to_unset);
|
||||
session_start();
|
||||
session_unset();
|
||||
?>
|
@@ -153,6 +153,14 @@ $cfg['Servers'][$i]['controlpass'] = '';
|
||||
*/
|
||||
$cfg['Servers'][$i]['auth_type'] = 'config';
|
||||
|
||||
/**
|
||||
* File containing Feebee ids and login names (see /contrib);
|
||||
* leave empty to deactivate Feebee hardware authentication
|
||||
*
|
||||
* @global string $cfg['Servers'][$i]['auth_feebee_config']
|
||||
*/
|
||||
$cfg['Servers'][$i]['auth_feebee_config'] = '';
|
||||
|
||||
/**
|
||||
* MySQL user
|
||||
*
|
||||
|
Reference in New Issue
Block a user