Esempio n. 1
0
// used for direct access protection
define('KIRBY', true);
// check for a proper phpversion
if (floatval(phpversion()) < 5.2) {
    die('Please upgrade to PHP 5.2 or higher');
}
// include kirby
require_once $rootKirby . '/lib/kirby.php';
// set the root
c::set('root', $root);
c::set('root.kirby', $rootKirby);
c::set('root.site', $rootSite);
c::set('root.content', $rootContent);
require_once $rootKirby . '/lib/load.php';
// load the rest of the system
load::lib();
load::config();
load::parsers();
load::plugins();
// check for an exisiting content dir
if (!is_dir(c::get('root.content'))) {
    die('The Kirby content directory could not be found');
}
// check for an exisiting site dir
if (!is_dir(c::get('root.site'))) {
    die('The Kirby site directory could not be found');
}
// set the timezone to make sure we
// avoid errors in php 5.3
@date_default_timezone_set(c::get('timezone'));
// switch on errors
<?php

Load::model('usuario');
load::lib('PHPMailer/PHPMailerAutoload');
Config::set('config.application.breadcrumb', true);
class RegistroController extends AppController
{
    public function index()
    {
        $usuario = new Usuario();
    }
    /* protected function before_filter() {
          // Verificando si el rol del usuario actual tiene permisos para la acción a ejecutar
          if (!$this->acl->is_allowed($this->userRol, $this->controller_name, $this->action_name)) {
              Flash::error("Acceso negado");
              return false;
          }
       }*/
    public function crear()
    {
        View::template('formularioregistro');
        $this->titulo = "Crear Usuario";
        // titulo a mostrar
        /**
         * Se verifica si el usuario envio el form (submit) y si ademas
         * dentro del array POST existe uno llamado "menus"
         * el cual aplica la autocarga de objeto para guardar los
         * datos enviado por POST utilizando autocarga de objeto
         */
        if (Input::hasPost('Usuario')) {
            /**