Alternc  latest
Alternc logiel libre pour l'hébergement
sql_pma_sso.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Launch a PhpMyAdmin session using PMA's SSO system
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 
28 $fields = array (
29  "id" => array ("request", "string", ""),
30 );
32 
33 
34 if ($r=$mysql->php_myadmin_connect()) {
35  // SSO of PhpMyAdmin
36  $_SESSION['PMA_single_signon_user'] = $r["login"];
37  $_SESSION['PMA_single_signon_password'] = $r["pass"];
38  $_SESSION['PMA_single_signon_host'] = $r["host"]; // pma >= 2.11
39  session_write_close();
40 
41  // Destroy any existing phpmyadmin session
42  setcookie("phpMyAdmin", "", time() - 3600);
43 
44  if ($id!="") {
45  $r=$mysql->get_mysql_details($id);
46  if ($r) {
47  $db="?db=".$id;
48  }
49  } else {
50  $db="";
51  }
52  // finally redirect to phpMyAdmin :
53  header("Location: /alternc-sql/index.php".$db);
54  exit();
55 }
56 
57 include_once("head.php");
58 echo '<h3>'._("SQL Admin").'</h3>';
59 
60 echo $msg->msg_html_all();
61 
62 include_once("foot.php");
63 
64 ?>
exit
Definition: adm_doadd.php:70
global $db
Definition: bootstrap.php:26
$msg
Definition: bootstrap.php:75
$r
Definition: aws_add.php:75
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
$fields
Launch a PhpMyAdmin session using PMA's SSO system.
Definition: sql_pma_sso.php:28
if(!isset($is_include)) if(! $key &&! $crt) $id