diff options
Diffstat (limited to 'html')
| -rw-r--r-- | html/app/models/Validate_model.php | 27 | ||||
| -rw-r--r-- | html/app/models/cms/Media_model.php | 0 | ||||
| -rw-r--r-- | html/app/routes/frontend.php | 22 |
3 files changed, 39 insertions, 10 deletions
diff --git a/html/app/models/Validate_model.php b/html/app/models/Validate_model.php new file mode 100644 index 0000000..ec60d72 --- /dev/null +++ b/html/app/models/Validate_model.php @@ -0,0 +1,27 @@ +<?php + +namespace app\models; + +use \Registry; + + +class Validate +{ + /** ticket + * + * validate that the user owns the `ticket` + * + */ + public static function ticket($ticket) + { + } + + /** access + * + * validate that the `ticket` is compatible with access_level + */ + public static function access($ticket, $access_level) + { + } + +}
\ No newline at end of file diff --git a/html/app/models/cms/Media_model.php b/html/app/models/cms/Media_model.php new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/html/app/models/cms/Media_model.php diff --git a/html/app/routes/frontend.php b/html/app/routes/frontend.php index 1eea46c..8ba7b4f 100644 --- a/html/app/routes/frontend.php +++ b/html/app/routes/frontend.php @@ -19,23 +19,25 @@ Route::notFound( function() { }); // 404 -// Resolve friendly urls -// --- -Route::add('/([0-9a-zA-Z-_]*)', - function($a) { Resolve::url([$a]); } +// Resolve urls +// --- -- -- - - - +Route::add('/course/([0-9a-zA-Z-_]*)', + function($label) { Course::show([$label]); } ); -Route::add('/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)', - function($a, $b) { Resolve::url([$a, $b]); } + +Route::add('/lesson/([0-9a-f]*)/([0-9a-zA-Z-_]*)', + function($ticket, $lesson) { Lesson::show([$lesson, $ticket]); } ); -Route::add('/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)', - function($a, $b, $c) { Resolve::url([$a, $b, $c]); } + +Route::add('/media/([0-9a-f]*)/([0-9a-zA-Z-_]*)/([0-9]*)/', + function($ticket, $type, $id) { Media::serve([$type, $id, $ticket]); } ); // 4-th level paths belong to products // --- -Route::add('/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)', - function($a, $b, $c, $d) { Product::fromUrl($d, [$a, $b, $c]); } +Route::add('/about/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)/([0-9a-zA-Z-_]*)', + function($a, $b, $c) { Page::show([$a, $b, $c]); } ); |
