Rev 4 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4 | Rev 8 | ||
---|---|---|---|
1 | <?php |
1 | <?php |
2 | 2 | ||
3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
4 | 4 | ||
5 | if ($ib_user_type == 0) |
5 | if ($ib_user_type == 0) |
6 | { |
6 | { |
7 | die($header.'Keine Zugriffsberechtigung'.$footer); |
7 | die($header.'Keine Zugriffsberechtigung'.$footer); |
8 | } |
8 | } |
9 | 9 | ||
10 | if ($aktion == 'activate') |
10 | if ($aktion == 'activate') |
11 | { |
11 | { |
12 | $hex = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); |
12 | $hex = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); |
13 | 13 | ||
14 | $new_secret_key = ''; |
14 | $new_secret_key = ''; |
15 | for ($i=0; $i<255; $i++) |
15 | for ($i=0; $i<255; $i++) |
16 | { |
16 | { |
17 | $new_secret_key .= $hex[mt_rand(0, 15)]; |
17 | $new_secret_key .= $hex[mt_rand(0, 15)]; |
18 | } |
18 | } |
19 | 19 | ||
20 | db_query("UPDATE `".$mysql_zugangsdaten['praefix']."users` SET `fastlogin_secret` = '".$new_secret_key."' WHERE `id` = '".$benutzer['id']."'"); |
20 | db_query("UPDATE `".$mysql_zugangsdaten['praefix']."users` SET `fastlogin_secret` = '".$new_secret_key."' WHERE `id` = '".$benutzer['id']."'"); |
21 | if (!headers_sent()) header('location: '.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.$modul); |
21 | if (!headers_sent()) header('location: '.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.urlencode($modul)); |
22 | } |
22 | } |
23 | 23 | ||
24 | if ($aktion == 'deactivate') |
24 | if ($aktion == 'deactivate') |
25 | { |
25 | { |
26 | db_query("UPDATE `".$mysql_zugangsdaten['praefix']."users` SET `fastlogin_secret` = '' WHERE `id` = '".$benutzer['id']."'"); |
26 | db_query("UPDATE `".$mysql_zugangsdaten['praefix']."users` SET `fastlogin_secret` = '' WHERE `id` = '".$benutzer['id']."'"); |
27 | if (!headers_sent()) header('location: '.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.$modul); |
27 | if (!headers_sent()) header('location: '.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.urlencode($modul)); |
28 | } |
28 | } |
29 | 29 | ||
30 | ?> |
30 | ?> |
31 | 31 |