Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
aebe25a
Rename MySQL schema from ku_admin to koot
henrystivens Oct 5, 2024
0fbe38e
Updates admin navigation links
henrystivens Feb 12, 2025
dee8d70
Adds accessibility labels to navigations
henrystivens Feb 12, 2025
6952b84
Removes unused create views
henrystivens Feb 12, 2025
b90b54c
Improves scaffold creation and editing
henrystivens Feb 12, 2025
0b42255
Merge pull request #3 from henrystivens/create-scaffold
henrystivens Feb 15, 2025
d641598
Removes role creation view
henrystivens Feb 15, 2025
9e3dd99
Fixes admin URL navigation issue
henrystivens Feb 15, 2025
62065e6
Validates user email uniqueness
henrystivens Feb 15, 2025
2072470
Enables session management
henrystivens Feb 15, 2025
50c7bc0
Configures SQLite as default database
henrystivens Feb 15, 2025
2ff8397
Renames default SQLite database file
henrystivens Feb 15, 2025
b08bc4c
Clean theme switcher js
joanhey Oct 3, 2024
d7fdd4e
Small change to maintain getter values
joanhey Oct 3, 2024
c0d43a9
Move theme switcher js to dir js
joanhey Oct 3, 2024
fb1262e
Better code in set scheme
joanhey Oct 3, 2024
ac08212
Fix logo in css till changed
joanhey Oct 5, 2024
99e688a
Fix logo with css till changed
joanhey Oct 6, 2024
1bafb43
Add _koot.css and min using rollup
joanhey Oct 6, 2024
b17400f
Fix type hint in controllers
joanhey Oct 6, 2024
132d82c
Admin template use js dir
joanhey Oct 6, 2024
2785b55
Change scaffold lite views
joanhey Oct 6, 2024
209342e
Add class logo to the svg
joanhey Oct 6, 2024
b02aa72
Fixes admin URL navigation issue
henrystivens Feb 15, 2025
52d30b3
Declares model property as a string
henrystivens Feb 15, 2025
11b9f22
Updates Koot CSS for 2025
henrystivens Feb 15, 2025
987a2a8
Refactors display of data in table format
henrystivens Feb 15, 2025
845ec8a
Fixes conditional rendering issue in show view
henrystivens Feb 15, 2025
989c262
Styles "Record not found" actions
henrystivens Feb 15, 2025
da720ab
Merge branch 'dev' into create-scaffold
henrystivens Feb 15, 2025
a34bc36
Fixes conditional check for empty data
henrystivens Feb 15, 2025
9d9413e
Updates record not found message
henrystivens Feb 15, 2025
b27fce1
Escapes HTML output for security
henrystivens Feb 19, 2025
40a6f15
Corrects model name casing in ResourcesController and RolesController
henrystivens Apr 14, 2025
c76505e
Adds error message for failed user creation in ControllerScaffoldLite
henrystivens Apr 14, 2025
f90a664
Refactors ModelLiteForm class for improved readability and structure
henrystivens Apr 14, 2025
cb227c2
Fixes output rendering for ModelLiteForm in create view
henrystivens Apr 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions koot/config/databases.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php
/**
* KumbiaPHP Web Framework
* Parámetros de conexión a la base de datos
* Database connection parameters
*/
/*return [
'default' => [
'dsn' => 'mysql:host=127.0.0.1;dbname=ku_admin;charset=utf8',
'username' => 'root',
'dsn' => 'mysql:host=127.0.0.1;dbname=koot;charset=utf8',
'username' => 'koot',
'password' => '',
'params' => [
//PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', //UTF8 en PHP < 5.3.6
'params' => [
\PDO::ATTR_PERSISTENT => \true, //conexión persistente
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION
]
]
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
],
],
];*/

/**
* Ejemplo de SQLite
* SQLite connection
*/
return ['default' => [
'dsn' => 'sqlite:'.APP_PATH.'temp/sqlite/ku_admin.db',
return [
'default' => [
'dsn' => 'sqlite:'.APP_PATH.'temp/sqlite/koot.db',
'pdo' => 'On',
]
]
];
Binary file added koot/config/mysql/koot.mwb
Binary file not shown.
131 changes: 131 additions & 0 deletions koot/config/mysql/koot.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
-- MySQL Script generated by MySQL Workbench
-- Sun May 10 19:28:53 2020
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering

SET @OLD_UNIQUE_CHECKS = @@UNIQUE_CHECKS, UNIQUE_CHECKS = 0;
SET @OLD_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS = 0;
SET @OLD_SQL_MODE = @@SQL_MODE, SQL_MODE =
'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

-- -----------------------------------------------------
-- Schema koot
-- -----------------------------------------------------
DROP SCHEMA IF EXISTS `koot`;

-- -----------------------------------------------------
-- Schema koot
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `koot` DEFAULT CHARACTER SET utf8;
USE `koot`;

-- -----------------------------------------------------
-- Table `koot`.`permissions`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `koot`.`permissions`
(
`id` INT NOT NULL AUTO_INCREMENT,
`roles_id` INT NOT NULL,
`resources_id` INT NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_permissions__roles`
FOREIGN KEY (`roles_id`)
REFERENCES `koot`.`roles` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_permissions__resources`
FOREIGN KEY (`resources_id`)
REFERENCES `koot`.`resources` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
)
ENGINE = InnoDB;

CREATE INDEX `fk_permissions_roles_idx` ON `koot`.`permissions` (`roles_id` ASC);

CREATE INDEX `fk_permissions_resources_idx` ON `koot`.`permissions` (`resources_id` ASC);


-- -----------------------------------------------------
-- Table `koot`.`resources`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `koot`.`resources`
(
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(127) NOT NULL,
`description` VARCHAR(255) NULL,
`url` VARCHAR(255) NOT NULL,
`module` VARCHAR(45) NULL,
`controller` VARCHAR(45) NOT NULL,
`action` VARCHAR(45) NOT NULL,
`status` ENUM ('0', '1') NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB;

CREATE UNIQUE INDEX `resources_name_UNIQUE` ON `koot`.`resources` (`name` ASC);

CREATE UNIQUE INDEX `resources_url_UNIQUE` ON `koot`.`resources` (`url` ASC);


-- -----------------------------------------------------
-- Table `koot`.`roles`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `koot`.`roles`
(
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NULL,
`status` ENUM ('0', '1') NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `koot`.`users`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `koot`.`users`
(
`id` INT NOT NULL AUTO_INCREMENT,
`email` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL,
`first_name` VARCHAR(255) NULL,
`last_name` VARCHAR(255) NULL,
`status` ENUM ('0', '1') NOT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB;

CREATE UNIQUE INDEX `users_email_UNIQUE` ON `koot`.`users` (`email` ASC);


-- -----------------------------------------------------
-- Table `koot`.`users_roles`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `koot`.`users_roles`
(
`id` INT NOT NULL AUTO_INCREMENT,
`users_id` INT NOT NULL,
`roles_id` INT NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_users_roles__users`
FOREIGN KEY (`users_id`)
REFERENCES `koot`.`users` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_users_roles__roles`
FOREIGN KEY (`roles_id`)
REFERENCES `koot`.`roles` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
)
ENGINE = InnoDB;

CREATE INDEX `fk_users_roles_users_idx` ON `koot`.`users_roles` (`users_id` ASC);

CREATE INDEX `fk_users_roles_roles_idx` ON `koot`.`users_roles` (`roles_id` ASC);


SET SQL_MODE = @OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS = @OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS = @OLD_UNIQUE_CHECKS;
Binary file removed koot/config/mysql/ku_admin.mwb
Binary file not shown.
122 changes: 0 additions & 122 deletions koot/config/mysql/ku_admin.sql

This file was deleted.

2 changes: 1 addition & 1 deletion koot/controllers/admin/resources_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

class ResourcesController extends ControllerScaffoldLite
{
public string $model = 'resources';
public string $model = 'Resources';
}
2 changes: 1 addition & 1 deletion koot/controllers/admin/roles_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

class RolesController extends ControllerScaffoldLite
{
public string $model = 'roles';
public string $model = 'Roles';
}
9 changes: 2 additions & 7 deletions koot/libs/controller_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,12 @@ abstract class ControllerAdmin extends Controller

final protected function initialize()
{
//Código de auth y permisos
//Será libre, pero añadiremos uno por defecto en breve
//Posiblemente se cree una clase abstracta con lo que debe tener por defecto
session_start();
View::template('admin');
/* View::select(null,'login/login');
return false; */
}

final protected function finalize()
{

}

}
}
Loading