本文整理匯總了PHP中MCAPI::closeOneOhSecurityHole方法的典型用法代碼示例。如果您正苦於以下問題:PHP MCAPI::closeOneOhSecurityHole方法的具體用法?PHP MCAPI::closeOneOhSecurityHole怎麽用?PHP MCAPI::closeOneOhSecurityHole使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MCAPI
的用法示例。
在下文中一共展示了MCAPI::closeOneOhSecurityHole方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: list
isset($_COOKIE['chimpunlock']) and list($username, $password) = explode('|', $_COOKIE['chimpunlock']) or isset($_POST['username']) and $username = $_POST['username'] and isset($_POST['pass']) and $password = $_POST['pass'] or list($username, $password) = array(null, null);
#die(serialize(array($username, $password)));
$mc = new MCAPI($username, $password);
if (!$mc->api_key) {
setcookie('chimpunlock', null);
die((isset($_POST['username']) ? 'Couldn\'t log in: ' . $mc->errorMessage : '') . '
<form action="#" method="POST">
<input type="text" name="username"/>
<input type="password" name="pass"/>
<input type="submit" value="Login"/>
</form>');
} else {
setcookie('chimpunlock', "{$username}|{$password}");
#header('Location: '.$_SERVER['PHP_SELF']) and die();
}
$mc->closeOneOhSecurityHole($username, $password) or $mc->errorCode == 101 or die('Security hole still open.' . $mc->errorCode . ': ' . $mc->errorMessage);
if (isset($_REQUEST['action'])) {
switch ($_REQUEST['action']) {
case 'expire':
$mc->apikeyExpire($username, $password);
break;
case 'add':
$mc->apikeyAdd($username, $password, $_REQUEST['key']);
break;
}
header('Location: ' . $_SERVER['PHP_SELF']) and die;
}
echo '
<table>
<thead>
<tr>