Beispiel #1
0
}
if ($jsn_layout != '' && $jsn_layout == 'manual') {
    $manual = true;
}
switch ($task) {
    case 'login':
        JRequest::checkToken() or jexit('Invalid Token');
        $username = JRequest::getVar('username', '', 'post', 'username');
        $password = JRequest::getString('password', '', 'post', JREQUEST_ALLOWRAW);
        $login = $obj_sampledata_helper->login($username, $password);
        $canDo = $obj_sampledata_helper->getUserActions();
        if ($login && $canDo->get('core.manage')) {
            if ($type == 'auto' && !$manual) {
                $session->set($login_identifier, true, 'jsntemplatesession');
            } else {
                $result_install = $obj_sampledata_helper->installSampleDataManually();
            }
        }
        break;
    case 'manual':
        JRequest::checkToken() or jexit('Invalid Token');
        if ($session->get($login_identifier, false, 'jsntemplatesession')) {
            $session->set($login_identifier, false, 'jsntemplatesession');
            $result_install = $obj_sampledata_helper->installSampleDataManually();
        }
        break;
    default:
        break;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">