当前位置: 首页>>代码示例>>PHP>>正文


PHP SessionManager::setCoNm方法代码示例

本文整理汇总了PHP中SessionManager::setCoNm方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionManager::setCoNm方法的具体用法?PHP SessionManager::setCoNm怎么用?PHP SessionManager::setCoNm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SessionManager的用法示例。


在下文中一共展示了SessionManager::setCoNm方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DBMemberWork

<?php

require_once "../../class/Utils.php";
require_once "../../class/DBWork.php";
require_once "../../class/DBMemberWork.php";
require_once "../../class/SessionManager.php";
$memWork = new DBMemberWork(true);
try {
    //$_POST : [login_id], [login_pw]
    //$memWork->createWork($_GET, false);
    $memWork->createWork($_POST, false);
    $res = $memWork->requestLogin();
    //세션 정보 저장
    $manager = new SessionManager();
    $manager->setUserNm($res['user_name']);
    $manager->setCoNm($res['co_nm']);
    $manager->setUserType($res['auth_id']);
    $headContent = "Location:../../route.php";
    $manager->destory();
    $memWork->destoryWork();
    if ($res) {
        if (isset($_POST["contents"])) {
            $headContent = $headContent . '?contents=' . $_POST["contents"];
            header($headContent);
        } else {
            header($headContent);
        }
    } else {
        $_SESSION['isLoginFail'] = 'y';
        header($headContent);
    }
开发者ID:akswosn,项目名称:Smartax,代码行数:31,代码来源:login_proc.php

示例2: json_encode

<?php

require_once "../../class/Utils.php";
require_once "../../class/DBWork.php";
require_once "../../class/SessionManager.php";
require_once "../../class/DBMemberWork.php";
$memWork = new DBMemberWork(true);
$index = (int) $_POST["index"];
$ret = array();
if ($index > -1) {
    $ret["CODE"] = '00';
    $companyArray = $_SESSION[DBWork::companyArray];
    $comp = $companyArray[$index];
    if (!empty($comp)) {
        //세션 설정
        $_SESSION[DBWork::companyKey] = $comp["co_id"];
        $manager = new SessionManager();
        $manager->setCoNm($comp["co_nm"]);
    } else {
        $ret["CODE"] = '99';
        $ret['MSG'] = "회사정보를 불러오는데 문제가 발생하였습니다.";
    }
    $ret['DATA'] = $comp;
} else {
    $ret["CODE"] = '99';
    $ret['DATA'] = $index;
    $ret['MSG'] = "회사정보를 불러오는데 문제가 발생하였습니다.";
}
echo json_encode($ret);
$memWork->destoryWork();
exit;
开发者ID:akswosn,项目名称:Smartax,代码行数:31,代码来源:change_company_proc.php

示例3: DBMemberWork

require_once "../../class/Utils.php";
require_once "../../class/DBWork.php";
require_once "../../class/DBMemberWork.php";
require_once "../../class/SessionManager.php";
$memWork = new DBMemberWork(true);
try {
    //$_POST : [login_id], [login_pw]
    //$memWork->createWork($_GET, false);
    $_POST['login_id'] = 'sample';
    $_POST['login_pw'] = 'sample';
    $memWork->createWork($_POST, false);
    $res = $memWork->requestLogin();
    //세션 정보 저장
    $manager = new SessionManager();
    $manager->setUserNm($res[3]);
    $manager->setCoNm($res[4]);
    $manager->setUserType($res[1]);
    $headContent = "Location:../../route.php";
    $manager->destory();
    $memWork->destoryWork();
    if ($res) {
        if (isset($_POST["contents"])) {
            $headContent = $headContent . '?contents=' . $_POST["contents"];
            header($headContent);
        } else {
            header($headContent);
        }
    } else {
        header($headContent);
    }
} catch (Exception $e) {
开发者ID:akswosn,项目名称:Smartax,代码行数:31,代码来源:login_proc_test.php


注:本文中的SessionManager::setCoNm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。