buenas, estoy tratando de conseguir acer una ventana de logout y tal para poner opciones cuannndo estes logeado en la pagina y no se como acerlo, les voy a poner el modulo y el tema donde se ve en la pagina y tal aver si me pueden ayudar, seria, modulo = todo el codigo y en el otro php, vendria las tablas y mas codigos miren. aver si me pueden ayudar estoy como loco y no se como acerlo, gracias
esto seria en el modulo,
<?php
if (!defined('FLUX_ROOT')) exit;
if (Flux::config('UseLoginCaptcha') && Flux::config('EnableReCaptcha')) {
require_once 'recaptcha/recaptchalib.php';
$recaptcha = recaptcha_get_html(Flux::config('ReCaptchaPublicKey'));
}
$title = Flux::message('LoginTitle');
$loginLogTable = Flux::config('FluxTables.LoginLogTable');
if (count($_POST)) {
$server = $params->get('server');
$username = $params->get('username');
$password = $params->get('password');
$code = $params->get('security_code');
try {
$session->login($server, $username, $password, $code);
$returnURL = $params->get('return_url');
if ($session->loginAthenaGroup->loginServer->config->getUseMD5()) {
$password = Flux::hashPassword($password);
}
$sql = "INSERT INTO {$session->loginAthenaGroup->loginDatabase}.$loginLogTable ";
$sql .= "(account_id, username, password, ip, error_code, login_date) ";
$sql .= "VALUES (?, ?, ?, ?, ?, NOW())";
$sth = $session->loginAthenaGroup->connection->getStatement($sql);
$sth->execute(array($session->account->account_id, $username, $password, $_SERVER['REMOTE_ADDR'], null));
if ($returnURL) {
$this->redirect($returnURL);
}
else {
$this->redirect();
}
}
catch (Flux_LoginError $e) {
if ($username && $password && $e->getCode() != Flux_LoginError::INVALID_SERVER) {
$loginAthenaGroup = Flux::getServerGroupByName($server);
$sql = "SELECT account_id FROM {$loginAthenaGroup->loginDatabase}.login WHERE userid = ? LIMIT 1";
$sth = $loginAthenaGroup->connection->getStatement($sql);
$sth->execute(array($username));
$row = $sth->fetch();
if ($row) {
$accountID = $row->account_id;
if ($loginAthenaGroup->loginServer->config->getUseMD5()) {
$password = Flux::hashPassword($password);
}
$sql = "INSERT INTO {$loginAthenaGroup->loginDatabase}.$loginLogTable ";
$sql .= "(account_id, username, password, ip, error_code, login_date) ";
$sql .= "VALUES (?, ?, ?, ?, ?, NOW())";
$sth = $loginAthenaGroup->connection->getStatement($sql);
$sth->execute(array($accountID, $username, $password, $_SERVER['REMOTE_ADDR'], $e->getCode()));
}
}
switch ($e->getCode()) {
case Flux_LoginError::UNEXPECTED:
$errorMessage = Flux::message('UnexpectedLoginError');
break;
case Flux_LoginError::INVALID_SERVER:
$errorMessage = Flux::message('InvalidLoginServer');
break;
case Flux_LoginError::INVALID_LOGIN:
$errorMessage = Flux::message('InvalidLoginCredentials');
break;
case Flux_LoginError::BANNED:
$errorMessage = Flux::message('TemporarilyBanned');
break;
case Flux_LoginError::PERMABANNED:
$errorMessage = Flux::message('PermanentlyBanned');
break;
case Flux_LoginError::IPBANNED:
$errorMessage = Flux::message('IpBanned');
break;
case Flux_LoginError::INVALID_SECURITY_CODE:
$errorMessage = Flux::message('InvalidSecurityCode');
break;
case Flux_LoginError::PENDING_CONFIRMATION:
$errorMessage = Flux::message('PendingConfirmation');
break;
default:
$errorMessage = Flux::message('CriticalLoginError');
break;
}
}
}
$serverNames = $this->getServerNames();
?>
y acontinuacion vienen las tablas y tal
<?php if (!defined('FLUX_ROOT')) exit; ?>
<?php if (isset($errorMessage)): ?>
<?php else: ?>
<?php if ($auth->actionAllowed('account', 'create')): ?>
<?php endif ?>
<?php endif ?>
<form action="<?php echo $this->url('account', 'login') ?>" method="post" class="generic-form2">
<input type="hidden" name="server" value="<?php echo htmlspecialchars($session->loginAthenaGroup->serverName) ?>">
<table class="generic-form2-table">
<tr>
<th width="18" height="61" rowspan="2"></th>
<td height="38" colspan="2"> </td>
</tr>
<tr>
<td height="48" colspan="2"><input type="text" name="username" id="login_username" value="<?php echo htmlspecialchars($params->get('username')) ?>" /></td>
</tr>
<tr>
<th height="39"></th>
<td colspan="2"><input type="password" name="password" id="login_password" /></td>
</tr>
<tr>
<th></th>
<td colspan="2"> </td>
</tr>
<?php if (Flux::config('UseLoginCaptcha')): ?>
<tr>
<?php if (Flux::config('EnableReCaptcha')): ?>
<th><label for="register_security_code"><?php echo htmlspecialchars(Flux::message('AccountSecurityLabel')) ?></label></th>
<td colspan="2"><?php echo $recaptcha ?></td>
<?php else: ?>
<th width="18"><label for="register_security_code"><?php echo htmlspecialchars(Flux::message('AccountSecurityLabel')) ?></label></th>
<td width="155">
<div class="security-code">
<img src="<?php echo $this->url('captcha') ?>" /> </div>
<input type="text" name="security_code" id="register_security_code" />
<div style="font-size: smaller;" class="action">
<strong><a href="javascript:refreshSecurityCode('.security-code img')"><?php echo htmlspecialchars(Flux::message('RefreshSecurityCode')) ?></a></strong> </div> </td>
<?php endif ?>
</tr>
<?php endif ?>
<tr>
<td></td>
<td colspan="2">
<input type="submit" value="<?php echo htmlspecialchars(Flux::message('LoginButton')) ?>" /> </td>
</tr>
<tr>
<td></td>
<td width="13"></td>
<td width="360"><p><?php printf(Flux::message('LoginPageMakeAccount'), $this->url('account', 'create')); ?></p></td>
</tr>
</table>
</form>