<?php require_once "includes/initialize.php"; // Include all Necissary Files if (!isset($session)) { $session = mySession::getInstance(); } if ($session->isLoggedIn()) { $user = User::current_user(); $user = recast("User", $user); if (!($user->rights == "admin" || $user->rights == "super")) { redirect_home(); exit; } } else { redirect_home(); exit; } if (isset($_REQUEST['action'])) { $action = $_REQUEST['action']; } if (isset($action)) { //when we send the action to individuals we want the form for editiing individuals if ($action == 'individuals') { $session->save("content", "people/form.php"); include_page('home.php'); exit; } //when we send the action to individuals we want the form for uploading files if ($action == 'upload') { $session->save("content", "upload/upload.php");
function validate($id = null, $value = null) { $session = mySession::getInstance(); if (isset($id) && $id !== null && (isset($value) && $value !== null)) { $user = User::getUserById($id); $user = recast('User', $user); if ($value === substr($user->password, -12)) { $user->rights = "medium"; $user->save(); $session->login($user); redirect_home(); exit; } else { return "The Validation Failed. Please try the link from your email one more time.\n If this issue persists, contact the site owner."; } } else { return "The Validation Failed. Please try the link from your email one more time.\n If this issue persists, contact the site owner."; } exit; }