Translated using Weblate (Portuguese)
[phpmyadmin.git] / examples / signon-script.php
blobe0d214e786080f569e56eafa2c86582bdba4f069
1 <?php
2 /**
3 * Single signon for phpMyAdmin
5 * This is just example how to use script based single signon with
6 * phpMyAdmin, it is not intended to be perfect code and look, only
7 * shows how you can integrate this functionality in your application.
8 */
10 declare(strict_types=1);
12 // phpcs:disable Squiz.Functions.GlobalFunction
14 /**
15 * This function returns username and password.
17 * It can optionally use configured username as parameter.
19 * @param string $user User name
21 * @return array<int,string>
23 function get_login_credentials(string $user): array
25 /* Optionally we can use passed username */
26 if ($user !== '') {
27 return [$user, 'password'];
30 /* Here we would retrieve the credentials */
31 return ['root', ''];