"Add/Edit my posts" link if isAdmin at home
parent
4b0fc4bf0d
commit
a46159f7e6
|
|
@ -65,7 +65,8 @@ if ($user->isAdmin()) {
|
|||
<li id="subactive"><a href="#" id="subcurrent">Manage</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="admin.php">Manage users</a></li>
|
||||
<li><a href="<?=$conf->urlGelato;?>/admin/admin.php">Manage users</a></li>
|
||||
<li><a href="<?=$conf->urlGelato;?>/">Take me to the tumblelog</a></li>
|
||||
<li><a href="close.php" onclick="return exit('div-process','<?=$conf->urlGelato;?>/admin/ajax.php?action=close');">Logoff</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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"]="";
|
||||
|
|
|
|||
10
index.php
10
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;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<div style="padding:4px; border:solid 2px #bbb; display:inline; background-color:#ddd; position:absolute; top:3px; right:3px;">
|
||||
<b>Hi, {User}.</b>
|
||||
<a target="_top" href="{URL_Tumble}/admin/index.php">Add/Edit my posts</a>
|
||||
<a target="_top" href="{URL_Tumble}/admin/close.php">Sign out</a>
|
||||
</div>
|
||||
Loading…
Reference in New Issue