Beispiel #1
0
define('TECHNICAL_NAME', 'Rodrigo S. Machuca Andrade');
define('TECHNICAL_EMAIL', '*****@*****.**');
define('ADMIN_TITLE', 'SGC - Sistema de Gestion de la Constructora');
//Variable para la paginacion, num de elementos por pagina:
define('PER_PAGE_SMALL', 10);
define('PER_PAGE_MEDIUM', 25);
define('PER_PAGE_LARGE', 50);
Route::get('admin/setup', function () {
    if (Setup::setup_complete()) {
        return Redirect::to('/admin');
    } else {
        return View::make('admin.setup.db');
    }
});
Route::post('admin/setup', function () {
    if (Setup::setup_complete()) {
        return Redirect::to('/admin');
    } else {
        $rules = array('username' => 'required|max:255', 'first_name' => 'required|max:255', 'last_name' => 'required|max:255', 'email' => 'required|email', 'password' => 'required|confirmed');
        $validation = Validator::make(Input::all(), $rules);
        if ($validation->fails()) {
            Messages::add('error', $validation->errors->all());
            return Redirect::to('/admin/setup/')->with_input();
        } else {
            Setup::setup_database();
            $usr = new User();
            $usr->username = Input::get('username');
            $usr->email = Input::get('email');
            $usr->first_name = Input::get('first_name');
            $usr->last_name = Input::get('last_name');
            $usr->active = 1;