0
function customers_management()
{
        $crud = new grocery_CRUD();

        $crud->set_table('customers');
        $crud->columns('customerName','contactLastName','phone','city','country','salesRepEmployeeNumber','postalCode');
        $crud->display_as('salesRepEmployeeNumber','from Employeer')
             ->display_as('customerName','Name')
             ->display_as('contactLastName','Last Name');
        $crud->set_subject('Customer');
        $crud->set_relation('salesRepEmployeeNumber','employees','lastName');

        $output = $crud->render();

        $this->_example_output($output);
}   

这是控制器的功能。我必须添加什么来检查登录?

4

1 回答 1

0

您应该查看其他负责身份验证的库(如DX_Auth等。)并在操作的第一行进行调用。

function customers_management() {
    <call the authentication library>
    if (success-login) {
        ... do authenticated operation
    } else {
        ... show him the login page
    }
}
于 2013-06-12T05:48:54.070 回答