ich hab's!
hier mal zum testen:
http://www.victoria.at/test/pluginstart.php
bin wie folgt vorgegangen:
--------------------------------------------------------------------------------
pluginstart.php (großteil kann dann included werden)
<?php
global $valid;
$valid = time()+3600*24*30; // gültigkeit: 1 monat
$plugin = $_GET['plugin'];
$flashplugin = $HTTP_COOKIE_VARS["flashplugin"];
if (!empty($flashplugin)) {
// verhindert eventuell zulangen cookie-wert
$flashplugin = substr($flashplugin,0,1);
// wert aus cookie übernehmen, cookie verlängern
setcookie ("flashplugin","$flashplugin","$valid");
$plugin = $flashplugin;
$message = "cookie wurde gefunden und verlängert, wert: $plugin";
}
elseif (!empty($plugin)) {
// cookie neu setzen
setcookie ("flashplugin","$plugin","$valid");
$plugin = substr($plugin,0,1);
$message = "cookie wurde neu gesetzt, wert: $plugin";
}
else {
// weiter zum plugincheck
header("location
http://www.victoria.at/test/plugin1.php"

;
exit();
}
// klartext für testzwecke zuweisen
switch ($plugin) {
case 0:
$pluginmessage= "Nein";
break;
case 1:
$pluginmessage = "Ja";
break;
default:
$pluginmessage = "Nicht feststellbar";
break;
}
?>
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>plugin vorhanden: <?php echo $pluginmessage ?>
</p>
<p>durchgeführte aktion: <?php echo $message ?></p>
<p><a href="cookiedelete.php">cookie testweise löschen</a></p>
</body>
</html>
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
plugin1.php (später dann plugincheck.php)
<?php
global $ursprung;
$ursprung = $HTTP_REFERER;
if (empty($ursprung)) {
//firewall blockt
$ursprung = "pluginstart.php";
}
?>
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
var ok=false; document.MM_returnValue = false;
with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
ok=(plugins && plugins[plgIn]);
} else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
else ok=autoGo; }
if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}
//-->
</script>
</head>
<body onLoad="MM_checkPlugin('Shockwave Flash','<?php echo $ursprung ?>?plugin=1','<?php echo $ursprung ?>?plugin=0',false);return document.MM_returnValue">
<script name="Used by MM_checkPlugin" language="javascript">
<!--
with (navigator) if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1) document.write(''+
'<scr'+'ipt language="VBScript">\nOn error resume next\n'+
'MM_dir = IsObject(CreateObject("SWCtl.SWCtl.1"))\n'+
'MM_flash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n</scr'+'ipt>');
//-->
</script>
</body>
</html>
--------------------------------------------------------------------------------
und so funktioniert die sache :-)
folgende schwachstellen:
- wenn cookies nicht angenommen werden, wird jedesmal der check durchgeführt! abhilfe: sessions
- wenn die firewall des users (wie bei mir hier in der firma) den REFERER blockt, wird man nicht zur ursprungsdatei, sondern auf eine definierte seite zurückgeleitet
abhilfe: fällt mir keine ein, aber halb so wild
- wenn der user javascript deaktiviert hat, passiert nix
abhilfe: noscript-link bei plugin1.php