In login.php suchst du nach
<tr>
<td colspan="2" align="center" class="tableb"><label for="remember_me">{$lang_login_php['remember_me']} </label><input name="remember_me" id="remember_me" type="checkbox" class="checkbox" value="1" tabindex="3" /></td>
</tr>
und fügst darüber
<tr>
<td colspan="2" align="center" class="tableb"><label for="agb">Hiermit akzeptiere ich die <a href="agb.php" target="agb">AGB</a></label><input name="agb" id="agb" type="checkbox" class="checkbox" value="1" tabindex="3" /></td>
</tr>
ein.
In bridge/coppermine.inc.php suchst du nach
// If this is a 'remember me' login set the remember field to true
if ($remember) {
$remember_sql = ",remember = '1' ";
// Change cookie life time to 2 weeks
if (CPG_COOKIES_ALLOWED) {
setcookie( $this->client_id, $this->session_id, time() + (CPG_WEEK*2), $CONFIG['cookie_path'] );
}
} else {
$remember_sql = '';
// Kill the cookie when closing the browser
if (CPG_COOKIES_ALLOWED) {
setcookie( $this->client_id, $this->session_id, 0, $CONFIG['cookie_path'] );
}
}
und ersetzt es durch
// If this is a 'remember me' login set the remember field to true
$superCage = Inspekt::makeSuperCage();
if ($remember) {
$remember_sql = ",remember = '1' ";
// Change cookie life time to 2 weeks
if (CPG_COOKIES_ALLOWED) {
setcookie( $this->client_id, $this->session_id, time() + (CPG_WEEK*2), $CONFIG['cookie_path'] );
if ($superCage->post->keyExists('agb')) {
setcookie( $CONFIG['cookie_name'].'_agb', 1, time() + (CPG_WEEK*CPG_WEEK), $CONFIG['cookie_path'] );
}
}
} else {
$remember_sql = '';
// Kill the cookie when closing the browser
if (CPG_COOKIES_ALLOWED) {
setcookie( $this->client_id, $this->session_id, 0, $CONFIG['cookie_path'] );
if ($superCage->post->keyExists('agb')) {
setcookie( $CONFIG['cookie_name'].'_agb', 1, 0, $CONFIG['cookie_path'] );
}
}
}
if (!$superCage->post->keyExists('agb')) {
setcookie( $CONFIG['cookie_name'].'_agb', 0, time() - CPG_WEEK, $CONFIG['cookie_path'] );
}
Damit hätten wir schon mal den Cookie. Nun müssen wir den Cookie an geeigneter Stelle auswerten. Dafür kopieren wir die Funktion theme_html_picture aus themes/sample/theme.php in die theme.php-Datei deines Themes, falls sie dort noch nicht existiert.
Dann suchst nach
if (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {
und ersetzt es an beiden Stellen durch
if (USER_ID && USER_ACCESS_LEVEL == 3 && $superCage->cookie->getInt($CONFIG['cookie_name'].'_agb') !== 1) {
$pic_html = '<a href="javascript:;" onclick="alert(\'Du musst den AGB zustimmen\');">';
} elseif (!USER_ID && $CONFIG['allow_unlogged_access'] <= 2) {