Example #1
0
<?php

if (!isset($_SESSION)) {
    session_start();
}
$_SERVER["DOCUMENT_ROOT"] = $_SERVER["DOCUMENT_ROOT"] . '/turnos';
include_once $_SERVER["DOCUMENT_ROOT"] . '/common/Includes.php';
use controllers\ActivacionController;
$dto = ActivacionController::process();
?>

<!DOCTYPE html>
<html lang="en-us">
<head>
    <meta charset="utf-8">
    <title>Diarco - Sistema de gestiĆ³n </title>
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <link rel="Stylesheet" type="text/css" href="../content/css/bootstrap.css" />
    <link rel="Stylesheet" type="text/css" href="../content/css/font-awesome.min.css" />
    <link rel="Stylesheet" type="text/css" href="../content/css/smartadmin-production.css" />
    <link rel="Stylesheet" type="text/css" href="../content/css/smartadmin-skins.css" />
    <link rel="Stylesheet" type="text/css" href="../content/css/demo.css" />
    <link rel="Stylesheet" type="text/css" href="../content/css/site.css" />

    <!-- <link rel="shortcut icon" href="@Url.Content("~/content/img/favicon/favicon.ico")" type="image/x-icon">
     <link rel="icon" href="@Url.Content("~/content/img/favicon/favicon.ico")" type="image/x-icon">-->
Example #2
-2
 static function process()
 {
     $dto = new \stdClass();
     $dto->user = ActivacionController::getUserByCodes();
     $dto->errors = ActivacionController::validate($dto->user);
     if (sizeof($dto->errors) > 0) {
         $dto->isValidUser = false;
         return $dto;
     } else {
         $dto->isValidUser = true;
     }
     try {
         $dto->errors = SecurityAdmin::activateUser($dto->user);
         return $dto;
     } catch (\Exception $ex) {
         return array("Se produjo un error: " . $ex);
     }
 }