Ciao Ragazzi,
Finalmente sono riuscito a richiamare le passwords dei miei utenti dal database e sono riuscito a farli autenticare direttamente dalla home page anzichè dal forum (PHPbb)
Adesso come posso rendere private alcune sezioni del sito. Cioè come posso renderle accessibili solo dagli utenti autenticati?
Questo è il code che autentica i miei utenti:
codice:
<?php
$phpbb_root_path = './phpbb2/';
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
?>
<?php
if ($userdata['session_logged_in'])
{
?>
Benvenuto <?php echo $userdata['username']; ?></p>
logout
<?php
}
else
{
?>
<form action="<?php echo $phpbb_root_path; ?>login.php" method="post" target="_top">
<?php echo $lang['Username']; ?>:
<input type="text" name="username" size="20" maxlength="40" value="" />
<?php echo $lang['Password']; ?>:
<input type="password" name="password" size="20" maxlength="25" />
<input type="checkbox" name="autologin" /> <?php echo $lang['Log_me_in']; ?>
<input type="hidden" name="redirect" value="loginhome1.php" />
<input type="hidden" name="sid" value="<?php echo $userdata['session_id']; ?>" />
<input type="hidden" name="outside" value="1" />
<div align="center"><input type="submit" class="mainoption" name="login" value="<?php echo $lang['Login']; ?>" />
<?php echo $lang['Forgotten_password']; ?></div>
</form>
<?php
}
?>
Funziona ma appunto come posso rendere alcune cartelle segrete?
Cioè solo per utenti iscritti? Loggati?
Grazie