
10.06.2008, 02:33
|
|
Участник форума
Регистрация: 11.05.2008
Сообщений: 202
Провел на форуме: 420713
Репутация:
104
|
|
Почему не выведет методы в классах модер администратор?
PHP код:
<?php
class User
{
private $log;
private $pas;
function __construct($log,$pas)
{
$this->log = $log;
$this->pas = $pas;
}
function LevelAcess($log,$pas)
{
if($log == $this->log && $pas == $this->pas ){
return true;
}
else
{
return false;
}
}
public function getLogin()
{
return $this->log;
}
}
class Normal extends User
{
// future send news
}
class Moderation extends User
{
public function moderator($m)
{
echo("Here you can post and edit news<br>");
}
function future()
{
// under contruction
}
}
class Admin extends User
{
public function adminit($b)
{
echo("Here you can ban bad user<br>");
}
function future()
{
// under contruction
}
}
$nooby = new User("moder","1238");
echo "User:".$nooby->getLogin();
$moder = new Moderation("mod","1238");
//$moder->moderator($m);
$adm = new Admin("admin","1234");
if($moder->LevelAcess($log,$pas))
{
$moder->moderator($m);
}
if($adm->LevelAcess($log,$pas))
{
$adm->adminit($b);
}
?>
|
|
|