Пример #1
0
function Fath_login()
{
    try {
        if (true === Fath_chkLogin($_POST["userid"], $_POST["passwd"])) {
            Frot_resetSession();
            Frot_setSession(DROT_SESROT_STT, DROT_STT_APP);
            //Frot_setSession( DROT_SESROT_SUBSTT ,  );
            Frot_setSession(DROT_LGDIN_USER, $_POST["userid"]);
            //echo json_encode( array( 'ret' => true ) );
            return true;
        } else {
            // echo json_encode( array( 'ret' => false ) );
            return false;
        }
    } catch (Exception $e) {
    }
}
Пример #2
0
function Frlg_ready($mapper, $path)
{
    try {
        if (true === isset($_POST["userid"]) && true === isset($_POST["passwd"])) {
            # Fcom_setLogInfo( DCOM_LOGLV_DBG ,
            #                  'post param:'.$_POST["userid"].'_'.$_POST["passwd"] );
            $mapper->connect('/:app/:func');
            $url_param = $mapper->match($path);
            if (!$url_param) {
                Fcom_setLogInfo(DCOM_LOGLV_DBG, 'invalid url at ready func');
                Frlg_jumpFirst();
            } else {
                if (0 === strcmp($url_param["app"], DROT_APP_NAME) && 0 === strcmp($url_param["func"], DROT_FUNC_ATH)) {
                    header("Content-Type: application/json; charset=utf-8");
                    /* 認証 */
                    if (true === Fath_chkLogin($_POST["userid"], $_POST["passwd"])) {
                        $idx = array(DROT_SESIDX_STT => DROT_STT_APP, DROT_SESIDX_SUBSTT => "");
                        Frot_resetSession($idx);
                        Frot_addSesIdx(DRLG_LGDIN_USER, $_POST["userid"]);
                        Fcom_setLogInfo(DCOM_LOGLV_DBG, 'login success:' . $_POST["userid"]);
                        echo json_encode(array('ret' => true));
                        return;
                    } else {
                        echo json_encode(array('ret' => false));
                        return;
                    }
                } else {
                    Fcom_setLogInfo(DCOM_LOGLV_DBG, 'invalid url at ready func');
                    Frlg_jumpFirst();
                }
            }
        } else {
            Fcom_setLogInfo(DCOM_LOGLV_DBG, 'invalid url at ready func');
            Frlg_jumpFirst();
        }
    } catch (Exception $e) {
        throw new Exception('ERR(File:' . basename(__FILE__) . ',Line:' . __LINE__ . '):' . __FUNCTION__ . '()' . PHP_EOL . $e->getMessage());
    }
}