/** * connects to the database server * * @param string $user user name * @param string $password user password * @param bool $is_controluser whether this is a control user connection * @param array $server host/port/socket/persistent * @param bool $auxiliary_connection (when true, don't go back to login if * connection fails) * * @return mixed false on error or a connection object on success */ public function connect($user, $password, $is_controluser = false, $server = null, $auxiliary_connection = false) { $result = $this->_extension->connect($user, $password, $is_controluser, $server, $auxiliary_connection); if ($result) { if (!$auxiliary_connection && !$is_controluser) { $GLOBALS['dbi']->postConnect($result); } return $result; } if ($is_controluser) { trigger_error(__('Connection for controluser as defined in your ' . 'configuration failed.'), E_USER_WARNING); return false; } // we could be calling $GLOBALS['dbi']->connect() to connect to another // server, for example in the Synchronize feature, so do not // go back to main login if it fails if ($auxiliary_connection) { return false; } PMA_logUser($user, 'mysql-denied'); $GLOBALS['auth_plugin']->authFails(); return $result; }
/** * connects to the database server * * @param string $user user name * @param string $password user password * @param bool $is_controluser whether this is a control user connection * @param array $server host/port/socket/persistent * @param bool $auxiliary_connection (when true, don't go back to login if * connection fails) * * @return mixed false on error or a connection object on success */ public function connect($user, $password, $is_controluser = false, $server = null, $auxiliary_connection = false) { return $this->_extension->connect($user, $password, $is_controluser, $server, $auxiliary_connection); }