Hello, I have this problems:
- Users can login with or without password.
- In member area every user have a lot of private pages. When logged user try to open one of those pages the page is empty. The ID user is his but information is gone!
<?php
// proverka dali wp e ve4e zareden, zaradi embedded vyzmojnostta
if (defined('WPINC'))
return;
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once('/var/www/www/wp-blog-header.php');
if (!session_id())
session_start();
print_r($_SESSION);
define('PLUGINS_TEACHER_BASE_URL', get_bloginfo('template_directory').'/plugins/teachers/');
define('PLUGINS_TEACHER_CURRENT', basename($_SERVER['PHP_SELF']));
$_GET['group'] = isset($_GET['group']) && is_numeric($_GET['group']) ? $_GET['group'] : NULL;
require_once('class.Teachers.php');
$Teacher = new Teachers;
if(isset($_POST) && $_POST)
{
if (isset($_POST['#login']) && isset($_POST['Client_ID']) && isset($_POST['Password']))
{
$Teacher->login($_POST['Client_ID'], $_POST['Password']);
}
elseif (isset($_POST['#profile-save']))
{
$Teacher->profile_assign($_POST);
$Teacher->profile_save();
wp_redirect(PLUGINS_TEACHER_BASE_URL.'profile.php');
}
elseif (isset($_POST['#detail-save']) && is_numeric($_POST['#detail-save']) && isset($_POST['content']))
{
$d = $Teacher->detail($_POST['#detail-save'], $_POST['content']);
if ($d)
{
wp_redirect(PLUGINS_TEACHER_BASE_URL.'details.php?group='.$d->Group.'&undn_id='.$d->Client_ID);
}
unset($d);
}
elseif (isset($_POST['#avatar-save']) && isset($_FILES['avatar']))
{
$Teacher->set_avatar($_FILES['avatar']);
wp_redirect(PLUGINS_TEACHER_BASE_URL.'avatar.php');
}
}
if (isset($_GET) && $_GET)
{
if (isset($_GET['teachers-logout']))
{
$Teacher->logout();
}
if (isset($_GET['delete-avatar']))
{
$Teacher->set_avatar(-1, $_GET['delete-avatar']);
wp_redirect(PLUGINS_TEACHER_BASE_URL.'avatar.php');
}
}
?>
<!DOCTYPE html>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Shu Teachers System v1.98-beta</title>
<meta charset="UTF-8" />
<meta name="author" content="[email protected]" />
<meta name="description" content="" />
<link rel="stylesheet" href="<?php echo PLUGINS_TEACHER_BASE_URL?>assets/reset.css" type="text/css" media="all" />
<link rel="stylesheet" href="<?php echo PLUGINS_TEACHER_BASE_URL?>assets/style.css" type="text/css" media="all" />
</head>
<body>
<?php if(!$Teacher->is_logged()):?>
<?php require_once('login.php')?>
<?php require_once('footer.php');exit?>
<?php endif?>
<div id="wrapper">
<div id="the-menu">
<?php if(PLUGINS_TEACHER_CURRENT!='avatar.php'):?>
<div id="profile-avatar">
<a href="<?php echo PLUGINS_TEACHER_BASE_URL?>avatar.php">
<span>Смени Ñнимката</span>
<img src="<?php echo $Teacher->avatar(64)?>" />
</a>
</div>
<?php endif?>
<div class="clearfix"></div>
<ul>
<li class="<?php echo (PLUGINS_TEACHER_CURRENT=='profile.php'?'current-menu-item':'')?>">
<a href="<?php echo PLUGINS_TEACHER_BASE_URL?>profile.php">Profile</a>
</li>
<li class="<?php echo (PLUGINS_TEACHER_CURRENT=='details.php'&&$_GET['group']==0?'current-menu-item':'')?>">
<a href="<?php echo PLUGINS_TEACHER_BASE_URL?>details.php?group=0">Biography</a>
</li>
<li class="<?php echo (PLUGINS_TEACHER_CURRENT=='details.php'&&$_GET['group']==1?'current-menu-item':'')?>">
<a href="<?php echo PLUGINS_TEACHER_BASE_URL?>details.php?group=1">Posts</a>
</li>
<li class="<?php echo (PLUGINS_TEACHER_CURRENT=='files.php'?'current-menu-item':'')?>">
<a href="<?php echo PLUGINS_TEACHER_BASE_URL?>files.php">Files</a>
</li>
<li>
<a href="?teachers-logout=<?php echo time()?>">Exit</a>
</li>
</ul>
</div>
<div id="the-main">
Probably the problems are in this header.php file. I have class.Teacher.php file and login.php - with login form!
Please help me! It’s very importen!
Thanks in advance!