Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Add index.php to admin urls to avoid issues when directory index is set to index.html instead of index.php

givanz3b67e9d0dd45
diff --git a/admin/admin-bar.php b/admin/admin-bar.php
index 8b158bc..27bf215 100755
--- a/admin/admin-bar.php
+++ b/admin/admin-bar.php
@@ -33,7 +33,7 @@ list($top) = Vvveb\System\Event::trigger('admin-bar', 'top', []);
$template = Vvveb\getCurrentTemplate();
$url = Vvveb\getCurrentUrl();
-$admin_path = Vvveb\adminPath();
+$admin_path = Vvveb\adminPath() . 'index.php';
$design_url = $admin_path . Vvveb\url(['module' => 'editor/editor', 'template' => $template, 'url' => $url], false, false);
$urlData = Vvveb\System\Routes::getUrlData($url);
$edit_url = isset($urlData['edit']) ? $admin_path . $urlData['edit'] : '';
diff --git a/admin/controller/user/login.php b/admin/controller/user/login.php
index 97c41cf..dde4363 100755
--- a/admin/controller/user/login.php
+++ b/admin/controller/user/login.php
@@ -57,20 +57,28 @@ class Login {
return $this->redirect($admin_path);
}
- $this->view->action = "$admin_path/?module=user/login";
+ $this->view->action = $admin_path . 'index.php?module=user/login';
$this->view->modal = $this->request->get['modal'] ?? false;
//$this->session = Session::getInstance();
$language = $this->session->get('language') ?? 'en_US';
setLanguage($language);
+ if (isset($this->request->get['errors'])) {
+ $view->errors['get'] = htmlentities($this->request->get['errors']);
+ }
+
if ($errors = $this->session->get('errors')) {
- $view->errors[] = $errors;
+ $view->errors['session'] = $errors;
$this->session->delete('errors');
}
+ if (isset($this->request->get['success'])) {
+ $view->success['get'] = htmlentities($this->request->get['success']);
+ }
+
if ($success = $this->session->get('success')) {
- $view->success[] = $success;
+ $view->success['session'] = $success;
$this->session->delete('success');
}
diff --git a/config/admin-menu.php b/config/admin-menu.php
index 8e280c6..4c657a5 100755
--- a/config/admin-menu.php
+++ b/config/admin-menu.php
@@ -27,7 +27,8 @@ if (APP == 'admin') {
} else {
$admin_path = \Vvveb\adminPath();
}
-$homeUrl = Vvveb\Url('index/index');
+$admin_path .= strpos($admin_path, 'index.php') === false ? 'index.php' : '';
+$homeUrl = Vvveb\Url('index/index');
return
[
@@ -587,7 +588,7 @@ return
'name' => __('Add new'),
'url' => $admin_path . '?module=settings/site',
'module' => 'settings/site',
- 'action' => 'index',
+ 'action' => 'add',
'icon' => 'la la-plus-circle',
],
],
@@ -657,19 +658,20 @@ return
'icon' => 'la la-boxes',
],
'custom-posts' => [
- 'name' => __('Custom posts'),
- 'url' => $admin_path . '?module=settings/posts',
- 'module' => 'content/taxonomies',
+ 'name' => __('Post types'),
+ 'url' => $admin_path . '?module=settings/post-types',
+ 'module' => 'settings/post-types',
'action' => 'index',
'icon' => 'la la-file-alt',
],
'custom-products' => [
- 'name' => __('Custom products'),
- 'url' => $admin_path . '?module=settings/products',
- 'module' => 'content/taxonomies',
+ 'name' => __('Product types'),
+ 'url' => $admin_path . '?module=settings/product-types',
+ 'module' => 'settings/product-types',
'action' => 'index',
'icon' => 'la la-box',
],
+/*
'fields' => [
'name' => __('Fields'),
'url' => $admin_path . '?module=field/field-group',
@@ -677,6 +679,7 @@ return
'action' => 'index',
'icon' => 'la la-stream',
],
+*/
],
],
'ecommerce' => [
diff --git a/config/custom-post-menu.php b/config/custom-post-menu.php
index a9af20b..de256ba 100755
--- a/config/custom-post-menu.php
+++ b/config/custom-post-menu.php
@@ -29,6 +29,8 @@ if (APP == 'admin') {
$admin_path = \Vvveb\adminPath();
}
+$admin_path .= strpos($admin_path, 'index.php') === false ? 'index.php' : '';
+
return
[
'name' => __('Posts'),
diff --git a/config/custom-product-menu.php b/config/custom-product-menu.php
index d080066..a2a5bfa 100755
--- a/config/custom-product-menu.php
+++ b/config/custom-product-menu.php
@@ -29,6 +29,8 @@ if (APP == 'admin') {
$admin_path = \Vvveb\adminPath();
}
+$admin_path .= strpos($admin_path, 'index.php') === false ? 'index.php' : '';
+
return
[
'name' => __('Products'),
diff --git a/config/routes.php b/config/routes.php
index 405e996..529047d 100755
--- a/config/routes.php
+++ b/config/routes.php
@@ -75,7 +75,7 @@ return [
'/{language{2,5}}/shop/{slug}' => ['module' => 'product/index'],
'/{language{2,5}}/shop/{slug}/#page#' => ['module' => 'product/index'],
'/{language{2,5}}/manufacturer/{slug}' => ['module' => 'product/manufacturer'],
- '/{language{2,5}}/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&slug={slug}'],
+ '/{language{2,5}}/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'index.php?module=product/product&slug={slug}'],
//catalog
'/shop' => ['module' => 'product/index'],
@@ -86,7 +86,7 @@ return [
'/manufacturer/{slug}' => ['module' => 'product/manufacturer/index'],
'/vendor/{slug}' => ['module' => 'product/vendor/index'],
'/vendor/{slug}/#page#' => ['module' => 'product/vendor/index'],
- '/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&slug={slug}'],
+ '/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'index.php?module=product/product&slug={slug}'],
//compare
'/cart/compare' => ['module' => 'cart/compare/index'],
@@ -102,7 +102,7 @@ return [
'/{language{2,5}}/manufacturer/{slug}' => ['module' => 'product/manufacturer/index'],
'/{language{2,5}}/vendor/{slug}' => ['module' => 'product/vendor/index'],
'/{language{2,5}}/vendor/{slug}/#page#' => ['module' => 'product/vendor/index'],
- '/{language{2,5}}/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'?module=product/product&slug={slug}'],
+ '/{language{2,5}}/product/{slug}' => ['module' => 'product/product/index', 'edit'=>'index.php?module=product/product&slug={slug}'],
//checkout
'/cart' => ['module' => 'cart/cart/index'],
@@ -141,11 +141,11 @@ return [
//'/#year#/#month#/#day#'=> ['module' => 'content/archive/index'],
//post
- //'/#year{4,4}#-#month{1,2}#-#day#/{slug}' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&slug={slug}'],
- '/{slug}' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&slug={slug}&type=post'],
+ //'/#year{4,4}#-#month{1,2}#-#day#/{slug}' => ['module' => 'content/post/index', 'edit'=>'index.php?module=content/post&slug={slug}'],
+ '/{slug}' => ['module' => 'content/post/index', 'edit'=>'index.php?module=content/post&slug={slug}&type=post'],
//page
- //'/{slug}' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&slug={slug}'],
- '/page/{slug}' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&slug={slug}&type=page'],
+ //'/{slug}' => ['module' => 'content/page/index', 'edit'=>'index.php?module=content/post&slug={slug}'],
+ '/page/{slug}' => ['module' => 'content/page/index', 'edit'=>'index.php?module=content/post&slug={slug}&type=page'],
//multi language content - language code must be at least 2 characters
'/{language{2,5}}/' => ['module' => 'index/index'],
@@ -155,8 +155,8 @@ return [
'/{language{2,5}}/blog' => ['module' => 'content'],
'/{language{2,5}}/cat/{slug}' => ['module' => 'content/category/language'],
'/{language{2,5}}/tag/{slug}' => ['module' => 'content/tag/index'],
- '/{language{2,5}}/{slug}' => ['module' => 'content/post/index', 'edit'=>'?module=content/post&slug={slug}'],
- '/{language{2,5}}/page/{slug}' => ['module' => 'content/page/index', 'edit'=>'?module=content/post&slug={slug}'],
+ '/{language{2,5}}/{slug}' => ['module' => 'content/post/index', 'edit'=>'index.php?module=content/post&slug={slug}'],
+ '/{language{2,5}}/page/{slug}' => ['module' => 'content/page/index', 'edit'=>'index.php?module=content/post&slug={slug}'],
'/{language{2,5}}/tag/{slug}' => ['module' => 'content/tag/index'],
'/{language{2,5}}/tag/{slug}/#page#' => ['module' => 'content/tag/index'],