diff --git a/admin/index.php b/admin/index.php index 060afda..6d5d552 100644 --- a/admin/index.php +++ b/admin/index.php @@ -65,7 +65,8 @@ if ($user->isAdmin()) {
  • Manage
  • -
  • Manage users
  • +
  • Manage users
  • +
  • Take me to the tumblelog
  • Logoff
  • diff --git a/classes/user.class.php b/classes/user.class.php index 52e5100..79b8a23 100644 --- a/classes/user.class.php +++ b/classes/user.class.php @@ -22,9 +22,9 @@ class user extends Conexion_Mysql { function isAdmin() { if(isset($_COOKIE["gelato_cookie"]) && $_COOKIE["gelato_cookie"] && $_COOKIE["gelato_cookie"]!="") { $galleta = explode(",",$_COOKIE["gelato_cookie"]); - if ($this->validaUsuario($galleta[1],$galleta[2])) { + if ($this->validateUser($galleta[1],$galleta[2])) { $_SESSION["user_id"]=$galleta[0]; - $_SESSION["usuario_login"]=$galleta[1]; + $_SESSION["user_login"]=$galleta[1]; } else { $_SESSION["user_id"]=""; $_SESSION["user_login"]=""; diff --git a/index.php b/index.php index 0d15f8e..6b52ab5 100644 --- a/index.php +++ b/index.php @@ -15,7 +15,9 @@ include("classes/gelato.class.php"); include("classes/templates.class.php"); include("classes/pagination.php"); + include("classes/user.class.php"); + $user = new user(); $conf = new configuration(); $tumble = new gelato(); $template = new plantillas($conf->template); @@ -48,6 +50,14 @@ $template->cargarPlantilla($input, $output, "template_header"); $template->mostrarPlantilla(); + if ($user->isAdmin()) { + $input = array("{User}", "{URL_Tumble}"); + $output = array($_SESSION["user_login"], $conf->urlGelato); + + $template->cargarPlantilla($input, $output, "template_isadmin"); + $template->mostrarPlantilla(); + } + if (!$id_post) { $limit=$conf->postLimit; diff --git a/themes/tumblr/template_isadmin.htm b/themes/tumblr/template_isadmin.htm new file mode 100644 index 0000000..1497af4 --- /dev/null +++ b/themes/tumblr/template_isadmin.htm @@ -0,0 +1,5 @@ +
    + Hi, {User}.   + Add/Edit my posts   + Sign out +
    \ No newline at end of file