Pamokysiu kaip padaryti, kad nerodytų setuser.php prisijungiant ir atsijungiant...
Taigi v6 versija.
Pirmiausia pasidarome maincore.php ir setuser.php failų kopijas.
Tada einame: maincore.php ir susirandame:
redirect(BASEDIR."setuser.php?user=".$data['user_name'], "script");
Jį keičiame į:
redirect(BASEDIR."index.php");
Toliau atsidarome setuser.php failą ir keičiame jį šituo:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
include THEME."theme.php";
echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
<head>
<title>".$settings['sitename']."</title>
<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."'>
<meta http-equiv='refresh' content='2; url=index.php'>
<link rel='stylesheet' href='".THEME."styles.css' type='text/css'>
</head>
<body class='tbl2'>
<table width='100%' height='100%'>
<tr>
<td>";
if (isset($_REQUEST['logout']) && $_REQUEST['logout'] == "yes") {
header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'");
setcookie("fusion_user", "", time() - 7200, "/", "", "0");
setcookie("fusion_lastvisit", "", time() - 7200, "/", "", "0");
redirect(BASEDIR."index.php");
} else {
if (!isset($error)) $error = "";
if ($error == 1) {
echo"<table align='center' cellpadding='0' cellspacing='1' width='80%' class='tbl-border'>
<tr>
<td class='tbl1'>
<center><br>
<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."'><br><br>\n";
echo "<b>".$locale['194']."</b><br><br>\n";
} elseif ($error == 2) {
echo"<table align='center' cellpadding='0' cellspacing='1' width='80%' class='tbl-border'>
<tr>
<td class='tbl1'>
<center><br>
<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."'><br><br>\n";
echo "<b>".$locale['195']."</b><br><br>\n";
} elseif ($error == 3) {
echo"<table align='center' cellpadding='0' cellspacing='1' width='80%' class='tbl-border'>
<tr>
<td class='tbl1'>
<center><br>
<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."'><br><br>\n";
echo "<b>".$locale['196']."</b><br><br>\n";
} else {
if (isset($_COOKIE['fusion_user'])) {
echo"<table align='center' cellpadding='0' cellspacing='1' width='80%' class='tbl-border'>
<tr>
<td class='tbl1'>
<center><br>
<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."'><br><br>\n";
$cookie_vars = explode(".", $_COOKIE['fusion_user']);
$user_pass = (preg_match("/^[0-9a-z]{32}$/", $cookie_vars['1']) ? $cookie_vars['1'] : "");
$user_name = preg_replace(array("/\=/","/\#/","/\sOR\s/"), "", stripinput($user));
if (!dbcount("(user_id)", "users", "user_name='".$user_name."' AND user_password='".md5($user_pass)."'")) {
echo "<b>".$locale['196']."</b><br><br>\n";
} else {
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'");
echo "<b>".$locale['193'].$user."</b><br><br>\n";
}
}
}
}
echo $locale['197']."<br><br>
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>\n";
ob_end_flush();
?>
v7 versija
Atsidarome maincore.php
ir susirandame:
redirect(BASEDIR."setuser.php?user=".$data['user_name'], true);
jį keičiame:
redirect(BASEDIR."index.php", true);
Toliau atsidarome setuser.php ir keičiame jį šiuo:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: setuser.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
include THEME."theme.php";
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
echo "<html>\n<head>\n";
echo "<title>".$settings['sitename']."</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />\n";
echo "<meta http-equiv='refresh' content='2; url=".$settings['opening_page']."' />\n";
echo "<meta name='description' content='".$settings['description']."' />\n";
echo "<meta name='keywords' content='".$settings['keywords']."' />\n";
echo "<style type='text/css'>html, body { height:100%; }</style>\n";
echo "<link rel='stylesheet' href='".THEME."styles.css' type='text/css' />\n";
if (function_exists("get_head_tags")) { echo get_head_tags(); }
echo "</head>\n<body class='tbl2'>\n";
echo "<table style='width:100%;height:100%'>\n<tr>\n<td>\n";
echo "<table cellpadding='0' cellspacing='1' width='80%' class='tbl-border center'>\n<tr>\n";
echo "<td class='tbl1'>\n<div style='text-align:center'><br />\n";
echo "<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."' /><br /><br />\n";
if (iMEMBER && (isset($_REQUEST['logout']) && $_REQUEST['logout'] == "yes")) {
header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'");
setcookie(COOKIE_PREFIX."user", "", time() - 7200, "/", "", "0");
setcookie(COOKIE_PREFIX."lastvisit", "", time() - 7200, "/", "", "0");
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_ip='".USER_IP."'");
redirect(BASEDIR."index.php");
} else {
if (isset($_GET['error']) && $_GET['error'] == 1) {
echo "<strong>".$locale['global_194']."</strong><br /><br />\n";
} elseif (isset($_GET['error']) && $_GET['error'] == 2) {
echo "<strong>".$locale['global_195']."</strong><br /><br />\n";
} elseif (isset($_GET['error']) && $_GET['error'] == 3) {
echo "<strong>".$locale['global_196']."</strong><br /><br />\n";
} else {
if (isset($_COOKIE[COOKIE_PREFIX.'user'])) {
$cookie_vars = explode(".", $_COOKIE[COOKIE_PREFIX.'user']);
$user_pass = preg_check("/^[0-9a-z]{32}$/", $cookie_vars['1']) ? $cookie_vars['1'] : "";
$user_name = preg_replace(array("/\=/","/\#/","/\sOR\s/"), "", stripinput($_GET['user']));
if (!dbcount("(user_id)", DB_USERS, "user_name='".$user_name."' AND user_password='".md5($user_pass)."'")) {
echo "<strong>".$locale['global_196']."</strong><br /><br />\n";
} else {
$result = dbquery("DELETE FROM ".DB_ONLINE." WHERE online_user='0' AND online_ip='".USER_IP."'");
echo "<strong>".$locale['global_193'].$_GET['user']."</strong><br /><br />\n";
}
}
}
}
echo $locale['global_197']."<br /><br />\n";
echo "</div>\n</td>\n</tr>\n</table>\n";
echo "</td>\n</tr>\n</table>\n";
echo "</body>\n</html>\n";
mysql_close();
ob_end_flush();
?>
~Enzo
| Straipsnio informacija
AutoriusEnzo
Parašymo data2008 birželio 25 17:06:11
Komentarų16
Skaityta3743 Spausdinti |