【发布时间】:2011-09-21 08:00:42
【问题描述】:
我阅读了该主题,但不知道从哪里开始 第一步是什么?我有这个首先被调用的代码:rclayout.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<?php include_http_metas() ?>
<?php include_metas() ?>
<?php include_title() ?>
<link rel="shortcut icon" href="/favicon.ico" />
<?php use_stylesheet('rainbow.css'); ?>
<?php use_javascript('rainbow.js'); ?>
<?php include_stylesheets(); ?>
<?php include_javascripts(); ?>
</head>
<body onload='ax_startup();'>
<center>
<?php
echo "<div id='div_main_container_rc'>";
?>
<div id='div_header_container_rc'>
<?php include_component('profile','header'); ?>
</div>
<?php
echo "<div id='div_content_container_rc'>";
echo $sf_content;
echo "</div>";
echo "<div id='div_footer'>";
?>
//show a footer menu here
</div>
</div>
</center>
</body>
</html>
然后 _header.php 是它检查用户是否登录的地方:
<?php
$USR_IS_ADMIN = false;
$USR_AUTH = false;
if($sf_user->hasAttribute('ADMIN'))
{
$USR_IS_ADMIN = true;
}
$id = $sf_user->getAttribute('profile_id');
if($sf_user->hasAttribute('profile_id') > 0)
{
$profile = RcProfileTablePeer::getById($id);
$activated = $profile->getActivated();
if($activated == 1)
{
//echo "activated".$activated;
$USR_AUTH = true;
}
else
{
//echo "NOT activated".$activated;
$USR_AUTH = false;
}
}
?>
<?php if(!$USR_AUTH) : ?>
//show a specific menu here
<?php endif;?>
<?php if($USR_AUTH):?>
//show a different menu here pertaining to logged in user
<?php endif;?>
我更新的 factory.yml 文件:
prod:
logger:
class: sfNoLogger
param:
level: err
loggers: ~
test:
storage:
class: sfSessionTestStorage
param:
session_path: %SF_TEST_CACHE_DIR%/sessions
response:
class: sfWebResponse
param:
send_http_headers: false
mailer:
param:
delivery_strategy: none
dev:
mailer:
param:
delivery_strategy: none
all:
routing:
class: sfPatternRouting
param:
generate_shortest_url: true
extra_parameters_as_query_string: true
view_cache_manager:
class: sfViewCacheManager
param:
cache_key_use_vary_headers: true
cache_key_use_host_name: true
user:
param:
timeout: 300
我必须从哪里开始我将如何做到这一点?我在任何地方都没有看到会话集 我要配置 php.ini 文件吗?如果是,如何配置?还是我在会话中这样做?
请帮忙? 谢谢
【问题讨论】:
标签: php javascript symfony1