function Edit() { if ($this->usr_type == 3) { EsMessage(_('Acesso negato')); EsRedir('main'); } if ($_SERVER['REQUEST_METHOD'] == 'POST' && SesVarCheck('usredit')) { $id = SesVarGet('usredit'); if (isset($_POST['email'])) { if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { $new = array('email' => $_POST['email']); $this->users->Save($id, $new); EsMessage(_('Dati utente salvati')); EsRedir('user'); } else { EsMessage(_('Indirizzo email non valido')); } } } else { if (!isset($_GET['id']) || !is_numeric($_GET['id'])) { EsRedir('user'); } else { $id = $_GET['id']; } } TemplVar('title', _('Modifica Utente')); $udata = $this->users->SearchByID($id); $usr_id = SesVarGet('user_id'); if ($udata !== FALSE && ($udata['type'] > $this->usr_type || $udata['id'] == $usr_id || $this->users->FullAccess($usr_id))) { ViewVar('user', $udata); SesVarSet('usredit', $udata['id']); } else { EsMessage(_('Operazione non consentita')); EsRedir('user'); } }
$contr->EsBefore(); $contr->{$page_function}(); if (!isset($title_page)) { if ($controller != $page) { $title_page = '..:: ' . ucfirst($cntr_class) . '->' . ucfirst($page_function) . ' ::..'; } else { $title_page = '..:: ' . ucfirst($cntr_class) . ' ::..'; } } // template variables defined by the controller foreach ($_templ_vars as $key => $val) { ${$key} = $val; } // page loading and elaboration if (file_exists('../pages/' . $controller . '/' . $page . '.php')) { $page_content = LoadPageContent('../pages/' . $controller . '/' . $page . '.php'); } else { $page_content = ''; } unset($contr); // setup alert message if (SesVarCheck('esalert')) { $esalert = SesVarGet('esalert'); } SesVarUnset('esalert'); // template loading and visualization if ($template == null) { include '../template/default.php'; } else { include '../template/' . $template . '.php'; }
function UserDelNode() { if (!isset($_GET['id']) || $this->utype == 3 || !SesVarCheck('user_id')) { EsMessage(_("Operazione non consentita")); EsRedir('main', 'nodes_list'); } $user_id = SesVarGet('user_id'); $this->nodes->UserDelNode($user_id, $_GET['id']); EsMessage(_("Nodo Disabilitato")); EsRedir('main', 'user_nodes', 'id=' . $user_id); }