CodeIgniter 404 페이지를 다른 컨트롤러에서 찾을 수 없음

Erqox

먼저 영어에 대해 사과하고 싶습니다. =). 웹 응용 프로그램을 만들고 있지만 프로그램 흐름을 다른 제어 장치로 리디렉션 할 때 "404 페이지를 찾을 수 없음"오류가 발생합니다. 클래스와 파일은 내가 다른 게시물에서 읽은 것처럼 대문자로 표시되며 그렇지 않을 수도 있습니다. 미리 감사드립니다.

다음은 "리디렉션"을 사용하여 "활동"을 호출하는 기본 컨트롤러 (인증 컨트롤러)입니다.

class Auth extends CI_Controller {
public function __construct() {
    parent::__construct();
}

public function index() {
    redirect('auth/login');
}

public function login() {

    if (!$this->input->post())
    {
        $this->load->view('templates/main_template', array(
            'title' => 'Login',
            'header' => $this->load->view('templates/header', null, TRUE),
            'content' => $this->load->view('pages/login', null, TRUE),
            'footer' => $this->load->view('templates/footer', null, TRUE)
        ));
        return;
    }

    $this->form_validation->set_rules('useremail', 'Useremail', 'trim|required|xss_clean'); // trim: quita espacios; required: campo requerido; xss_clean: elimina posibles inyecciones sql; callback_user_auth: otras funciones y llamadas, en este caso llamada a funciónq que autentifica al usuario
    $this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean|callback_user_auth'); // |callback_user_auth
    if ($this->form_validation->run() == FALSE)
    {
        // LOGIN VIEW (home)
        $this->load->view('templates/main_template', array(
            'title' => 'Login',
            'header' => $this->load->view('templates/header', null, TRUE),
            'content' => $this->load->view('pages/login', null, TRUE),
            'footer' => $this->load->view('templates/footer', null, TRUE)
        ));;

    } else {

        redirect('activity/list_actividades');
    }
} 

public function user_auth($password) { 
    $useremail = $this->input->post('useremail');
    $user = $this->User_model->authenticate($useremail, $password);

    if ($user)
    {
        // valid user, set session data
        $this->session->logged_in = array(
            'useremail' => $user->email,
            'username' => $user->name,
            'group' => $user->group // CAMBIO EN LA BASE DE DATOS 
        ); // GROUP POR ADMIN. DEPENDIENDO DEL GRUPO SE TIENEN UNOS PERMISOS U OTROS


        return TRUE;
    }
    $this->form_validation->set_message('user_auth', 'Invalid username or password');

    return FALSE;
}

public function logout() {
    unset($_SESSION['logged_in']);
    redirect('auth/login');
}

활동 컨트롤러 :

class Activity extends CI_Controller {
public function __construct() {
    parent::__construct();
    // check for the session here... in theory
}

public function index() {
    redirect('auth/login');
}

public function list_actividades () {

    $this->load->model('Activity_model');
    $data['actividades'] = $this->Activity_model->getAll();
    $data['grupo_usuario'] = $this->session->logged_in['group'];

    $this->load->view('templates/main_template', array(
        'title' => 'Lista de Actividades',
        'header' => $this->load->view('templates/header', null, TRUE),
        'content' => $this->load->view('templates/lista_actividades', $data, TRUE),
        'footer' => $this->load->view('templates/footer', null, TRUE)
    ));
}
Erqox

마지막으로 인증 후크를 사용할 때 acl.php 파일에 인증 된 주소를 등록해야합니다.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

Codeigniter 컨트롤러 / 메소드 404 페이지에 $ .post를 찾을 수 없음

404 페이지를 찾을 수 없음 요청한 페이지를 codeigniter에서 찾을 수 없습니다.

CodeIgniter 404 컨트롤러를 찾을 수 없음

404 페이지를 찾을 수 없음 codeigniter 컨트롤러 이름 변경 후 작동하지 않음

codeigniter에서 "404 페이지를 찾을 수 없음"오류

CodeIgniter : 라이브 서버에서 404 페이지를 찾을 수 없음

Codeigniter 404 페이지를 찾을 수 없습니다.

Magento를 사용하여 컨트롤러 404 페이지를 찾을 수 없음

Codeigniter에서 페이지 매김이 작동하지 않고 404 페이지를 찾을 수 없음

404 페이지를 찾을 수 없음 codeigniter url-PHP

Codeigniter의 경로-404 페이지를 찾을 수 없음

404 페이지를 찾을 수 없음 codeigniter URL

Codeigniter 3.0.0-오류 404 페이지를 찾을 수 없음

Codeigniter 페이지 매김 링크는 404 페이지를 찾을 수 없음으로 이동합니다.

404 페이지를 찾을 수 없음 새 페이지를 작성하는 동안 요청한 페이지를 찾을 수 없습니다. codeigniter

Codeigniter 하위 폴더 컨트롤러가 localhost에서 작동하지만 서버에서 작동하지 않고 404 찾을 수 없음 오류 발생

codeigniter가있는 모든 페이지 '404 페이지를 찾을 수 없음'

http.FileServer에서 "404 페이지를 찾을 수 없음"을 보냅니다.

Django 사이트에서 페이지를 찾을 수 없음 404

기본 컨트롤러를 변경하면 404 페이지를 찾을 수 없습니다.

스프링 부트: 컨트롤러 - 404를 찾을 수 없음

codeigniter에서 404 찾을 수 없음 오류가 발생하는 온라인의 다른 페이지로 리디렉션

CodeIgniter 기본 컨트롤러를 찾을 수 없습니다.

Codeigniter 컨트롤러를 찾을 수 없습니다.

CodeIgniter 개체 컨트롤러를 찾을 수 없습니다.

Prestashop 모듈 컨트롤러에서 "페이지를 찾을 수 없음"

Codeigniter 확장 컨트롤러, 컨트롤러를 찾을 수 없음

스캐 폴드 편집 컨트롤러가있는 새 ASP.net 핵심 프로젝트가 404 페이지를 찾을 수 없음을 반환합니다.

페이지를 찾을 수 없음 (404)