当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_removeCookie函数代码示例

本文整理汇总了PHP中PMA_removeCookie函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_removeCookie函数的具体用法?PHP PMA_removeCookie怎么用?PHP PMA_removeCookie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_removeCookie函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 * @uses    version_compare()
 * @uses    PHP_VERSION
 */
// verify if PHP supports session, die if it does not
if (!@function_exists('session_name')) {
    $cfg = array('DefaultLang' => 'en-iso-8859-1', 'AllowAnywhereRecoding' => false);
    // Loads the language file
    require_once './libraries/select_lang.lib.php';
    // Displays the error message
    // (do not use & for parameters sent by header)
    header('Location: ' . (defined('PMA_SETUP') ? '../' : '') . 'error.php' . '?lang=' . urlencode($available_languages[$lang][2]) . '&dir=' . urlencode($text_dir) . '&type=' . urlencode($strError) . '&error=' . urlencode(sprintf($strCantLoad, 'session')));
    exit;
} elseif (ini_get('session.auto_start') == true && session_name() != 'phpMyAdmin') {
    $_SESSION = array();
    if (isset($_COOKIE[session_name()])) {
        PMA_removeCookie(session_name());
    }
    session_unset();
    @session_destroy();
}
// disable starting of sessions before all settings are done
// does not work, besides how it is written in php manual
//ini_set('session.auto_start', 0);
// session cookie settings
session_set_cookie_params(0, PMA_Config::getCookiePath() . '; HttpOnly', '', PMA_Config::isHttps());
// cookies are safer
ini_set('session.use_cookies', true);
// but not all user allow cookies
ini_set('session.use_only_cookies', false);
ini_set('session.use_trans_sid', true);
ini_set('url_rewriter.tags', 'a=href,frame=src,input=src,form=fakeentry,fieldset=');
开发者ID:rforillo,项目名称:wordpress-heroku2,代码行数:31,代码来源:session.inc.php

示例2: isset

        $message = isset($submit_move) ? $strMoveTableSameNames : $strCopyTableSameNames;
    } else {
        PMA_Table::moveCopy($db, $table, $target_db, $new_name, $what, isset($submit_move), 'one_table');
        $js_to_run = 'functions.js';
        $message = isset($submit_move) ? $strMoveTableOK : $strCopyTableOK;
        $message = sprintf($message, htmlspecialchars($table), htmlspecialchars($new_name));
        $reload = 1;
        /* Check: Work on new table or on old table? */
        if (isset($submit_move)) {
            $db = $target_db;
            $table = $new_name;
        } else {
            $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
            if (isset($switch_to_new) && $switch_to_new == 'true') {
                PMA_setCookie('pma_switch_to_new', 'true');
                $db = $target_db;
                $table = $new_name;
            } else {
                PMA_removeCookie('pma_switch_to_new');
            }
        }
    }
    require_once './libs/header.inc.php';
} else {
    require_once './libs/header.inc.php';
    PMA_mysqlDie($strTableEmpty, '', '', $err_url);
}
/**
 * Back to the calling script
 */
require './tbl_sql.php';
开发者ID:BGCX261,项目名称:zhe-project-agri-hg-to-git,代码行数:31,代码来源:tbl_move_copy.php

示例3: PMA_setCookie

/**
 * sets cookie if value is different from current cokkie value,
 * or removes if value is equal to default
 *
 * @uses    PMA_Config::isHttps()
 * @uses    PMA_Config::getCookiePath()
 * @uses    $_COOKIE
 * @uses    PMA_removeCookie()
 * @uses    setcookie()
 * @uses    time()
 * @param   string  $cookie     name of cookie to remove
 * @param   mixed   $value      new cookie value
 * @param   string  $default    default value
 * @param   int     $validity   validity of cookie in seconds (default is one month)
 * @param   bool    $httponlt   whether cookie is only for HTTP (and not for scripts)
 * @return  boolean result of setcookie()
 */
function PMA_setCookie($cookie, $value, $default = null, $validity = null, $httponly = true)
{
    if ($validity == null) {
        $validity = 2592000;
    }
    if (strlen($value) && null !== $default && $value === $default && isset($_COOKIE[$cookie])) {
        // remove cookie, default value is used
        return PMA_removeCookie($cookie);
    }
    if (!strlen($value) && isset($_COOKIE[$cookie])) {
        // remove cookie, value is empty
        return PMA_removeCookie($cookie);
    }
    if (!isset($_COOKIE[$cookie]) || $_COOKIE[$cookie] !== $value) {
        // set cookie with new value
        /* Calculate cookie validity */
        if ($validity == 0) {
            $v = 0;
        } else {
            $v = time() + $validity;
        }
        return setcookie($cookie, $value, $v, PMA_Config::getCookiePath(), '', PMA_Config::isHttps(), $httponly);
    }
    // cookie has already $value as value
    return true;
}
开发者ID:alexhava,项目名称:elixirjuice,代码行数:43,代码来源:core.lib.php

示例4: PMA_arrayWalkRecursive

// to be able to test with 5.3.0-dev)
if (function_exists('get_magic_quotes_gpc') && -1 == version_compare(PHP_VERSION, '5.2.99') && get_magic_quotes_gpc()) {
    PMA_arrayWalkRecursive($_GET, 'stripslashes', true);
    PMA_arrayWalkRecursive($_POST, 'stripslashes', true);
    PMA_arrayWalkRecursive($_COOKIE, 'stripslashes', true);
    PMA_arrayWalkRecursive($_REQUEST, 'stripslashes', true);
}
/**
 * clean cookies on new install or upgrade
 * when changing something with increment the cookie version
 */
$pma_cookie_version = 4;
if (isset($_COOKIE) && (!isset($_COOKIE['pmaCookieVer']) || $_COOKIE['pmaCookieVer'] < $pma_cookie_version)) {
    // delete all cookies
    foreach ($_COOKIE as $cookie_name => $tmp) {
        PMA_removeCookie($cookie_name);
    }
    $_COOKIE = array();
    PMA_setCookie('pmaCookieVer', $pma_cookie_version);
}
/**
 * include deprecated grab_globals only if required
 */
if (empty($__redirect) && !defined('PMA_NO_VARIABLES_IMPORT')) {
    require './libraries/grab_globals.lib.php';
}
/**
 * include session handling after the globals, to prevent overwriting
 */
require_once './libraries/session.inc.php';
/**
开发者ID:nexusvista,项目名称:phpmyadmin,代码行数:31,代码来源:common.inc.php

示例5: PMA_setCookie

 /**
  * sets cookie if value is different from current cokkie value,
  * or removes if value is equal to default
  *
  * @uses    PMA_Config::isHttps()
  * @uses    PMA_Config::getCookiePath()
  * @uses    $_COOKIE
  * @uses    PMA_removeCookie()
  * @uses    setcookie()
  * @uses    time()
  * @param   string  $cookie     name of cookie to remove
  * @param   mixed   $value      new cookie value
  * @param   string  $default    default value
  * @return  boolean result of setcookie()
  */
 function PMA_setCookie($cookie, $value, $default = null)
 {
     if (strlen($value) && null !== $default && $value === $default && isset($_COOKIE[$cookie])) {
         // remove cookie, default value is used
         return PMA_removeCookie($cookie);
     }
     if (!strlen($value) && isset($_COOKIE[$cookie])) {
         // remove cookie, value is empty
         return PMA_removeCookie($cookie);
     }
     if (!isset($_COOKIE[$cookie]) || $_COOKIE[$cookie] !== $value) {
         // set cookie with new value
         return setcookie($cookie, $value, time() + 60 * 60 * 24 * 30, PMA_Config::getCookiePath(), '', PMA_Config::isHttps());
     }
     // cookie has already $value as value
     return true;
 }
开发者ID:a195474368,项目名称:ejiawang,代码行数:32,代码来源:common.lib.php

示例6: PMA_Config

$_SESSION['PMA_Config'] = new PMA_Config('./config.inc.php');
if (!defined('PMA_MINIMUM_COMMON')) {
    $_SESSION['PMA_Config']->checkPmaAbsoluteUri();
}
/**
 * BC - enable backward compatibility
 * exports all configuration settings into $GLOBALS ($GLOBALS['cfg'])
 */
$_SESSION['PMA_Config']->enableBc();
/**
 * check HTTPS connection
 */
if ($_SESSION['PMA_Config']->get('ForceSSL') && !$_SESSION['PMA_Config']->get('is_https')) {
    PMA_sendHeaderLocation(preg_replace('/^http/', 'https', $_SESSION['PMA_Config']->get('PmaAbsoluteUri')) . PMA_generate_common_url($_GET, 'text'));
    // delete the current session, otherwise we get problems (see bug #2397877)
    PMA_removeCookie($GLOBALS['session_name']);
    exit;
}
/******************************************************************************/
/* loading language file                       LABEL_loading_language_file    */
/**
 * Added messages while developing:
 */
if (file_exists('./lang/added_messages.php')) {
    include './lang/added_messages.php';
}
/**
 * lang detection is done here
 */
require_once './libraries/select_lang.lib.php';
/**
开发者ID:kolbermoorer,项目名称:edugame,代码行数:31,代码来源:common.inc.php

示例7: PMA_setCookie

/**
 * sets cookie if value is different from current cokkie value,
 * or removes if value is equal to default
 *
 * @uses    PMA_Config::isHttps()
 * @uses    PMA_Config::getCookiePath()
 * @uses    $_COOKIE
 * @uses    PMA_removeCookie()
 * @uses    setcookie()
 * @uses    time()
 * @param   string  $cookie     name of cookie to remove
 * @param   mixed   $value      new cookie value
 * @param   string  $default    default value
 * @param   int     $validity   validity of cookie in seconds (default is one month)
 * @param   bool    $httponlt   whether cookie is only for HTTP (and not for scripts)
 * @return  boolean result of setcookie()
 */
function PMA_setCookie($cookie, $value, $default = null, $validity = null, $httponly = true)
{
    if ($validity == null) {
        $validity = 2592000;
    }
    if (strlen($value) && null !== $default && $value === $default && isset($_COOKIE[$cookie])) {
        // remove cookie, default value is used
        return PMA_removeCookie($cookie);
    }
    if (!strlen($value) && isset($_COOKIE[$cookie])) {
        // remove cookie, value is empty
        return PMA_removeCookie($cookie);
    }
    if (!isset($_COOKIE[$cookie]) || $_COOKIE[$cookie] !== $value) {
        // set cookie with new value
        /* Calculate cookie validity */
        if ($validity == 0) {
            $v = 0;
        } else {
            $v = time() + $validity;
        }
        /* Use native support for httponly cookies if available */
        if (version_compare(PHP_VERSION, '5.2.0', 'ge')) {
            return setcookie($cookie, $value, $v, PMA_Config::getCookiePath(), '', PMA_Config::isHttps(), $httponly);
        } else {
            return setcookie($cookie, $value, $v, PMA_Config::getCookiePath() . ($httponly ? '; HttpOnly' : ''), '', PMA_Config::isHttps());
        }
    }
    // cookie has already $value as value
    return true;
}
开发者ID:rforillo,项目名称:wordpress-heroku2,代码行数:48,代码来源:common.lib.php

示例8: PMA_auth_fails

/**
 * User is not allowed to login to MySQL -> authentication failed
 *
 * @return  boolean   always true (no return indeed)
 *
 * @access  public
 */
function PMA_auth_fails()
{
    global $conn_error, $server;
    // Deletes password cookie and displays the login form
    PMA_removeCookie('pma_cookie_password-' . $server);
    if (isset($GLOBALS['allowDeny_forbidden']) && $GLOBALS['allowDeny_forbidden']) {
        $conn_error = $GLOBALS['strAccessDenied'];
    } elseif (isset($GLOBALS['no_activity']) && $GLOBALS['no_activity']) {
        $conn_error = sprintf($GLOBALS['strNoActivity'], $GLOBALS['cfg']['LoginCookieValidity']);
        // Remember where we got timeout to return on same place
        if (PMA_getenv('SCRIPT_NAME')) {
            $GLOBALS['target'] = basename(PMA_getenv('SCRIPT_NAME'));
        }
    } elseif (PMA_DBI_getError()) {
        $conn_error = PMA_sanitize(PMA_DBI_getError());
    } elseif (isset($php_errormsg)) {
        $conn_error = $php_errormsg;
    } else {
        $conn_error = $GLOBALS['strCannotLogin'];
    }
    PMA_auth();
    return true;
}
开发者ID:BGCX261,项目名称:zhe-project-agri-hg-to-git,代码行数:30,代码来源:cookie.auth.lib.php

示例9: PMA_auth_fails

/**
 * User is not allowed to login to MySQL -> authentication failed
 *
 * prepares error message and switches to PMA_auth() which display the error
 * and the login form
 *
 * this function MUST exit/quit the application,
 * currently doen by call to PMA_auth()
 *
 * @uses    $GLOBALS['server']
 * @uses    $GLOBALS['allowDeny_forbidden']
 * @uses    $GLOBALS['strAccessDenied']
 * @uses    $GLOBALS['strNoActivity']
 * @uses    $GLOBALS['strCannotLogin']
 * @uses    $GLOBALS['no_activity']
 * @uses    $cfg['LoginCookieValidity']
 * @uses    PMA_removeCookie()
 * @uses    PMA_getenv()
 * @uses    PMA_DBI_getError()
 * @uses    PMA_sanitize()
 * @uses    PMA_auth()
 * @uses    sprintf()
 * @uses    basename()
 * @access  public
 */
function PMA_auth_fails()
{
    global $conn_error;
    // Deletes password cookie and displays the login form
    PMA_removeCookie('pmaPass-' . $GLOBALS['server']);
    if (!empty($GLOBALS['login_without_password_is_forbidden'])) {
        $conn_error = $GLOBALS['strLoginWithoutPassword'];
    } elseif (!empty($GLOBALS['allowDeny_forbidden'])) {
        $conn_error = $GLOBALS['strAccessDenied'];
    } elseif (!empty($GLOBALS['no_activity'])) {
        $conn_error = sprintf($GLOBALS['strNoActivity'], $GLOBALS['cfg']['LoginCookieValidity']);
        // Remember where we got timeout to return on same place
        if (PMA_getenv('SCRIPT_NAME')) {
            $GLOBALS['target'] = basename(PMA_getenv('SCRIPT_NAME'));
            // avoid "missing parameter: field" on re-entry
            if ('tbl_alter.php' == $GLOBALS['target']) {
                $GLOBALS['target'] = 'tbl_structure.php';
            }
        }
    } elseif (PMA_DBI_getError()) {
        $conn_error = '#' . $GLOBALS['errno'] . ' ' . $GLOBALS['strCannotLogin'];
    } else {
        $conn_error = $GLOBALS['strCannotLogin'];
    }
    // needed for PHP-CGI (not need for FastCGI or mod-php)
    header('Cache-Control: no-store, no-cache, must-revalidate');
    header('Pragma: no-cache');
    PMA_auth();
}
开发者ID:s-kalaus,项目名称:zkernel,代码行数:54,代码来源:cookie.auth.lib.php

示例10: PMA_auth_fails

/**
 * User is not allowed to login to MySQL -> authentication failed
 *
 * prepares error message and switches to PMA_auth() which display the error
 * and the login form
 *
 * this function MUST exit/quit the application,
 * currently doen by call to PMA_auth()
 *
 * @todo    $php_errormsg is invalid here!? it will never be set in this scope
 * @uses    $GLOBALS['server']
 * @uses    $GLOBALS['allowDeny_forbidden']
 * @uses    $GLOBALS['strAccessDenied']
 * @uses    $GLOBALS['strNoActivity']
 * @uses    $GLOBALS['strCannotLogin']
 * @uses    $GLOBALS['no_activity']
 * @uses    $cfg['LoginCookieValidity']
 * @uses    PMA_removeCookie()
 * @uses    PMA_getenv()
 * @uses    PMA_DBI_getError()
 * @uses    PMA_sanitize()
 * @uses    PMA_auth()
 * @uses    sprintf()
 * @uses    basename()
 * @access  public
 */
function PMA_auth_fails()
{
    global $conn_error;
    // Deletes password cookie and displays the login form
    PMA_removeCookie('pmaPass-' . $GLOBALS['server']);
    if (!empty($GLOBALS['allowDeny_forbidden'])) {
        $conn_error = $GLOBALS['strAccessDenied'];
    } elseif (!empty($GLOBALS['no_activity'])) {
        $conn_error = sprintf($GLOBALS['strNoActivity'], $GLOBALS['cfg']['LoginCookieValidity']);
        // Remember where we got timeout to return on same place
        if (PMA_getenv('SCRIPT_NAME')) {
            $GLOBALS['target'] = basename(PMA_getenv('SCRIPT_NAME'));
            // avoid "missing parameter: field" on re-entry
            if ('tbl_alter.php' == $GLOBALS['target']) {
                $GLOBALS['target'] = 'tbl_structure.php';
            }
        }
    } elseif (PMA_DBI_getError()) {
        $conn_error = PMA_sanitize(PMA_DBI_getError());
    } elseif (isset($php_errormsg)) {
        $conn_error = $php_errormsg;
    } else {
        $conn_error = $GLOBALS['strCannotLogin'];
    }
    PMA_auth();
}
开发者ID:alecbenson,项目名称:TurnoutWeb-Patches,代码行数:52,代码来源:cookie.auth.lib.php

示例11: PMA_setCookie

 /**
  * sets cookie if value is different from current cokkie value,
  * or removes if value is equal to default
  *
  * @uses    $GLOBALS['cookie_path']
  * @uses    $GLOBALS['is_https']
  * @uses    $_COOKIE
  * @uses    PMA_removeCookie()
  * @uses    setcookie()
  * @uses    time()
  * @param   string  $cookie     name of cookie to remove
  * @param   mixed   $value      new cookie value
  * @param   string  $default    default value
  * @return  boolean result of setcookie()
  */
 function PMA_setCookie($cookie, $value, $default = null)
 {
     if (strlen($value) && null !== $default && $value === $default) {
         // remove cookie, default value is used
         return PMA_removeCookie($cookie);
     }
     if (!strlen($value) && isset($_COOKIE[$cookie])) {
         // remove cookie, value is empty
         return PMA_removeCookie($cookie);
     }
     if (!isset($_COOKIE[$cookie]) || $_COOKIE[$cookie] !== $value) {
         // set cookie with new value
         return setcookie($cookie, $value, time() + 60 * 60 * 24 * 30, $GLOBALS['cookie_path'], '', $GLOBALS['is_https']);
     }
     // cookie has already $value as value
     return true;
 }
开发者ID:hoogle,项目名称:ttt,代码行数:32,代码来源:common.lib.php


注:本文中的PMA_removeCookie函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。