static function process()
 {
     $dto = new \stdClass();
     $dto->user = GenerarContraseniaController::getUserByCodes();
     $dto->errors = array();
     if (!isset($_POST["submit"]) || !$dto->user) {
         return $dto;
     }
     $dto->errors = GenerarContraseniaController::validate();
     if (sizeof($dto->errors) > 0) {
         return $dto;
     }
     try {
         $dto->user->password = $_POST["password"];
         $dto->errors = SecurityAdmin::changePasswordUser($dto->user);
         $dto->user = json_decode(json_encode($dto->user));
         return $dto;
     } catch (\Exception $ex) {
         return array("Se produjo un error: " . $ex);
     }
 }
Exemple #2
0
<?php

session_start();
$_SERVER["DOCUMENT_ROOT"] = $_SERVER["DOCUMENT_ROOT"] . '/turnos';
include_once $_SERVER["DOCUMENT_ROOT"] . '/common/Includes.php';
use controllers\LoginController;
use controllers\GenerarContraseniaController;
use security\SecurityManager;
$dto = GenerarContraseniaController::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="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,300,400,700">