Z
Z
zkweb2016-10-17 10:28:00
InstantCMS
zkweb, 2016-10-17 10:28:00

How to remove the 404 error when users add a post?

There is a site: kazansp.ru/company
if the user wants to add his company, then he gets a 404 error. How to make it at least redirect to registration

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fuze, 2017-02-16
@InstantMedia

For InstantCMS 2.7.0 and above
Open file /system/controllers/content/actions/item_add.php
Find strings

// проверяем наличие доступа
if (!cmsUser::isAllowed($ctype_name, 'add')) {
    if (!cmsUser::isAllowed($ctype_name, 'add_to_parent')) {
        cmsCore::error404();
    }
    $is_check_parent_perm = true;
}

And replace with
// проверяем наличие доступа
if (!cmsUser::isAllowed($ctype_name, 'add')) {
    if (!cmsUser::isAllowed($ctype_name, 'add_to_parent')) {
        if(!$this->cms_user->is_logged){
            cmsUser::goLogin();
        }
        cmsCore::error404();
    }
    $is_check_parent_perm = true;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question