-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Expand file tree
/
Copy pathsignon-script.php
More file actions
32 lines (28 loc) · 762 Bytes
/
signon-script.php
File metadata and controls
32 lines (28 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* Single signon for phpMyAdmin
*
* This is just example how to use script based single signon with
* phpMyAdmin, it is not intended to be perfect code and look, only
* shows how you can integrate this functionality in your application.
*/
declare(strict_types=1);
// phpcs:disable Squiz.Functions.GlobalFunction
/**
* This function returns username and password.
*
* It can optionally use configured username as parameter.
*
* @param string $user User name
*
* @return array<int,string>
*/
function get_login_credentials(string $user): array
{
/* Optionally we can use passed username */
if ($user !== '') {
return [$user, 'password'];
}
/* Here we would retrieve the credentials */
return ['root', ''];
}