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


PHP Application::getUserSession方法代码示例

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


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

示例1: taskList

 protected function taskList()
 {
     $smarty = Application::getSmarty();
     $user_session = Application::getUserSession();
     $smarty->assign('logged_user_id', $user_session->getUserID());
     return parent::taskList();
 }
开发者ID:alex-ch,项目名称:test,代码行数:7,代码来源:user.php

示例2: render

    public function render()
    {
        error_reporting(E_ALL);
        ini_set('display_errors', 1);
        Application::loadLibrary('olmi/request');
        Application::loadLibrary('core/router');
        $url = ltrim($_SERVER['REQUEST_URI'], '/');
        $user_session = Application::getUserSession();
        $user_logged = $user_session->getUserAccount();
        Router::setDefaultModuleName($user_logged ? 'profile' : 'login');
        Router::route($url);
        $page = Application::getPage();
        $page = Application::getPage();
        $page->setTitle('OCS');
        $page->addMeta(array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1'));
        $page->addMeta(array('charset' => 'utf-8'));
        $page->addStylesheet(coreResourceLibrary::getStaticPath('/bootstrap/css/bootstrap.min.css'));
        $page->addStylesheet(coreResourceLibrary::getStaticPath('/bootstrap/css/bootstrap-theme.min.css'));
        $page->addStylesheet(coreResourceLibrary::getStaticPath('jquery-ui/jquery-ui-bootstrap.css'));
        $page->addStylesheet(coreResourceLibrary::getStaticPath('/css/admin.css'));
        $page->addScript(coreResourceLibrary::getStaticPath('/js/jquery-1.11.3.min.js'));
        $page->addScript(coreResourceLibrary::getStaticPath('/jquery-ui/jquery-ui.min.js'));
        $page->addScript(coreResourceLibrary::getStaticPath('/bootstrap/js/bootstrap.min.js'));
        $page->addScript(coreResourceLibrary::getStaticPath('/js/application.js'));
        $page->addLiteral('
				<script type="text/javascript">
					jQuery(document).ready(function(){
						App.init();
					});
				</script>
			
			');
        $smarty = Application::getSmarty();
        $module_name = Router::getModuleName();
        $module_params = Router::getModuleParams();
        if ($module_name) {
            $module = Application::getResourceInstance('module', $module_name);
            if (coreAccessControlLibrary::accessAllowed($user_logged, $module)) {
                $content = call_user_func(array($module, 'run'), $module_params);
            } else {
                Application::stackError(Application::gettext('You have no permission to login'));
                $user_session->logout();
                Redirector::redirect(Application::getSeoUrl('/login?back=' . Router::getSourceUrl()));
            }
        } else {
            $content = Application::runModule('page404');
        }
        $smarty->assign('content', $content);
        $html_head = $page->getHtmlHead();
        $smarty->assign('html_head', $html_head);
        /*$smarty->assign('header', Application::getBlock('header'));
        		$smarty->assign('footer', Application::getBlock('footer'));*/
        $template_path = coreResourceLibrary::getTemplatePath('index');
        $smarty->display($template_path);
    }
开发者ID:alex-ch,项目名称:test,代码行数:55,代码来源:application.php

示例3: render

 public function render()
 {
     $user_session = Application::getUserSession();
     if (!$user_session->userLogged()) {
         return $this->terminate();
     }
     $smarty = Application::getSmarty();
     $smarty->assign('user_logged', $user_session->getUserAccount());
     $smarty->assign('logout_link', Application::getSeoUrl('/login/logout'));
     $smarty->assign('block', $this);
     $template_path = $this->getTemplatePath();
     return $smarty->fetch($template_path);
 }
开发者ID:alex-ch,项目名称:test,代码行数:13,代码来源:footer.php

示例4: save

 public function save()
 {
     $is_new = !$this->id;
     if ($is_new) {
         $user_session = Application::getUserSession();
         $this->user_id = $user_session->getUserId();
     }
     $id = parent::save();
     if ($id) {
         imagePkgHelperLibrary::commitUploadedFiles(Request::get('image'), $id);
     }
     return $id;
 }
开发者ID:alex-ch,项目名称:test,代码行数:13,代码来源:news.php

示例5: render

 public function render()
 {
     $user_session = Application::getUserSession();
     if (!$user_session->userLogged()) {
         return $this->terminate();
     }
     $smarty = Application::getSmarty();
     $smarty->assign('top_menu', Application::getBlock('menu'));
     $smarty->assign('user_logged', $user_session->getUserAccount());
     $smarty->assign('logout_link', Application::getSeoUrl('/login/logout'));
     $smarty->assign('site_logo', coreResourceLibrary::getStaticPath('/img/site_logo.jpg'));
     $template_path = $this->getTemplatePath();
     return $smarty->fetch($template_path);
 }
开发者ID:alex-ch,项目名称:test,代码行数:14,代码来源:header.php

示例6: createFlowItem

 protected function createFlowItem($new_status, $comment = '')
 {
     $flow_item = Application::getEntityInstance('ocs_order_flow');
     $user_session = Application::getUserSession();
     $flow_item->user_id = $user_session->getUserId();
     $flow_item->status = $new_status;
     $flow_item->comment = $comment;
     $this->addFlowItem($flow_item);
 }
开发者ID:alex-ch,项目名称:test,代码行数:9,代码来源:ocs_order.php


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