本文整理汇总了PHP中Manager::getSession方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::getSession方法的具体用法?PHP Manager::getSession怎么用?PHP Manager::getSession使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager::getSession方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authenticate
public function authenticate()
{
if ($this->data->datasource == '') {
$this->data->datasource = 'fnapolo';
//$this->renderPrompt('error', 'Inform database name.');
}
Manager::setConf('fnbr20.db', $this->data->datasource);
Manager::getSession()->fnbr20db = $this->data->datasource;
$auth = Manager::getAuth();
$this->data->result = $auth->authenticate($this->data->user, $this->data->challenge, $this->data->response);
if ($this->data->result) {
$user = Manager::getLogin()->getUser();
$this->data->idLanguage = $user->getConfigData('fnbr20IdLanguage');
if ($this->data->idLanguage == '') {
$this->data->idLanguage = 1;
$user->setConfigData('fnbr20IdLanguage', $this->data->idLanguage);
}
if ($this->data->ifLanguage == '') {
$this->data->ifLanguage = 'en';
//$this->renderPrompt('error', 'Inform language.');
}
Manager::getSession()->idLanguage = $this->data->idLanguage;
Manager::getSession()->lang = $this->data->ifLanguage;
Manager::getSession()->fnbr20Level = $user->getUserLevel();
$this->redirect(Manager::getURL('fnbr20/main'));
} else {
$this->renderPrompt('error', 'Login or password not valid.');
}
}
示例2: save
public function save()
{
$layers = $this->data->gridManager->data->checked;
Manager::getSession()->fnbr20Layers = $layers;
$user = Manager::getLogin()->getUser();
$user->setConfigData('fnbr20Layers', $layers);
$this->renderPrompt('information', 'OK');
}
示例3: listForConstraint
public function listForConstraint($array)
{
$idLanguage = \Manager::getSession()->idLanguage;
$criteria = $this->getCriteria()->select("idLU as del, idLU, concat(frame.entries.name,'.',name) as fullname")->orderBy('frame.entries.name,name');
$criteria->where("idLU", "IN", $array);
Base::relation($criteria, 'lu', 'frame', 'rel_evokes');
Base::entryLanguage($criteria, 'frame');
$criteria->where("lemma.idLanguage = {$idLanguage}");
return $criteria;
}
示例4: listLabelType
public function listLabelType($filter)
{
$idLanguage = \Manager::getSession()->idLanguage;
$criteria = $this->getCriteria()->select('idLayerType, entry, genericlabel.name as labelType, genericlabel.idEntity as idLabelType')->orderBy('entry, genericlabel.name');
Base::relation($criteria, 'layertype', 'genericlabel', 'rel_haslabeltype');
$criteria->where("genericlabel.idLanguage = {$idLanguage}");
if ($filter->entry) {
$criteria->where("entry = '{$filter->entry}'");
}
return $criteria;
}
示例5: preProcess
public function preProcess()
{
$frontController = $this->frontController;
// exemplo de alteração da configuração dependendo do controller sendo executado
$context = $frontController->getContext();
$controller = $context->getController();
if ($controller == 'controls') {
Manager::setConf('session.check', false);
}
// é necessário validar a sessão?
if (Manager::getConf('login.check') || Manager::getConf('session.check')) {
$timeout = Manager::getSession()->checkTimeout(Manager::getConf('session.exception'));
}
if ($timeout) {
$frontController->canCallHandler(false);
$url = Manager::getURL(Manager::getApp() . '/main');
$frontController->setResult(new MRedirect(NULL, $url));
}
}
示例6: formSession
public function formSession()
{
// O gerenciamento de sessão do Maestro utiliza o Zend
// Usando o container global do Maestro
$teste = Manager::getSession()->teste + 1;
Manager::getSession()->teste = $teste;
$this->data->teste = "Contador (refresh na página para incrementar): " . $teste;
// Usando containers
$container = Manager::getSession()->container('exemplo');
$container->integer = $container->integer + 1;
$container->string = "String";
$object = new StdClass();
$object->name = 'name';
$object->value = 10;
$container->object = $object;
$this->data->integer = "Contador em container (refresh na página para incrementar): " . $container->integer;
// Usando containers expiration
$limited = Manager::getSession()->container('limited');
$limited->setExpirationSeconds(15);
$limited->contador = $limited->contador + 1;
$this->data->limited = "Contador com prazo de expiração (15 seg): " . $limited->contador;
$this->render();
}
示例7: logout
public function logout($forced = '')
{
if (Manager::getOptions('dbsession')) {
//$session = $this->manager->getBusinessMAD('session');
//$session->registerOut($this->getLogin());
}
$this->setLogin(NULL);
Manager::getSession()->destroy();
}
示例8: getTokenId
public function getTokenId()
{
Manager::getSession()->set('__MAESTROTOKENID', md5(uniqid()));
$tokenId = Manager::useToken ? Manager::getSession()->get('__MAESTROTOKENID') : '';
//mdump('getting token id = ' . $tokenId);
return "manager.page.tokenId = '{$tokenId}';";
}
示例9: getLayersData
public function getLayersData($idSentence)
{
if (!\Manager::checkAccess('MASTER', A_EXECUTE)) {
$condition = "AND (AnnotationSet.idAnnotationSet = {$this->getId()})";
}
$idLanguage = \Manager::getSession()->idLanguage;
$cmd = <<<HERE
SELECT AnnotationSet.idAnnotationSet,
l.idLayerType,
l.idLayer,
entry_lt.name AS layer,
ifnull(lb.startChar,-1) AS startChar,
ifnull(lb.endChar,-1) AS endChar,
ifnull(gl.idEntity, ifnull(fe.idEntity, ce.idEntity)) AS idLabelType,
lb.idLabel,
lt.entry as layerTypeEntry
FROM AnnotationSet
INNER JOIN Layer l
ON (AnnotationSet.idAnnotationSet = l.idAnnotationSet)
LEFT JOIN Label lb
ON (l.idLayer=lb.idLayer)
LEFT JOIN GenericLabel gl
ON (lb.idLabelType=gl.idEntity)
LEFT JOIN FrameElement fe
ON (lb.idLabelType=fe.idEntity)
LEFT JOIN Entry entry_fe
ON (fe.entry = entry_fe.entry)
LEFT JOIN ConstructionElement ce
ON (lb.idLabelType=ce.idEntity)
LEFT JOIN Entry entry_ce
ON (ce.entry = entry_ce.entry)
INNER JOIN LayerType lt
ON (l.idLayerType=lt.idLayerType)
INNER JOIN Entry entry_lt
ON (lt.entry = entry_lt.entry)
WHERE ((entry_lt.idLanguage = {$idLanguage} )
AND ((gl.idLanguage = {$idLanguage}) or (gl.idLanguage is null))
AND ((entry_fe.idLanguage = {$idLanguage}) or (entry_fe.idLanguage is null))
{$condition} AND (AnnotationSet.idSentence = {$idSentence} ))
ORDER BY AnnotationSet.idAnnotationSet, lt.order, entry_lt.name, l.idLayer, ifnull(lb.startChar,-1)
HERE;
$query = $this->getDb()->getQueryCommand($cmd);
return $query;
}
示例10: generate
public function generate()
{
$this->errors = array();
$this->ini = parse_ini_file($this->fileScript, true);
$tab = ' ';
$dbName = $this->ini['globals']['database'];
$appName = $this->ini['globals']['app'];
$moduleName = $this->ini['globals']['module'] ?: $appName;
$actions[] = $tab . "'{$moduleName}' => array('{$moduleName}', '{$moduleName}/main/main', '{$moduleName}IconForm', '', A_ACCESS, array(";
foreach ($this->ini as $className => $node) {
$originalClassName = $className;
$className = strtolower($className);
if ($className == 'globals') {
continue;
}
$properties = $methods = $validators = '';
mdump('handleClass = ' . $className);
$extends = $node['extends'];
$log = $node['log'];
if ($node['type'] == 'enumeration') {
$consts = $modelName = $tableName = $properties = '';
$attributes = $node['attributes'];
foreach ($attributes as $attributeName => $attributeData) {
if ($attributeName == 'model') {
$modelName = $attributeData;
}
if ($attributeName == 'table') {
$tableName = $attributeData;
}
if ($attributeName == 'model' || $attributeName == 'table') {
$attributeData = "\"{$attributeData}\"";
}
$properties .= "\n protected static \$" . $attributeName . " = " . $attributeData . ";";
}
if ($tableName) {
$sessionId = Manager::getSession()->getId();
$url = Manager::getAppURL($appName, $moduleName . '/tabelageral/getenumeration/' . $tableName . "?ajaxResponseType=JSON", true);
//mdump($url);
if ($stream = fopen($url, 'r')) {
$result = MJSON::decode(stream_get_contents($stream));
$constants = $result['data']['result']['items'];
//mdump($constants);
foreach ($constants as $value) {
$consts .= "\n const " . str_replace(' ', '_', $value['name']) . " = " . $value['idTable'] . ";";
}
fclose($stream);
}
} else {
$constants = $node['constants'];
foreach ($constants as $constantName => $constantData) {
$consts .= "\n const " . $constantName . " = " . $constantData . ";";
}
}
$var = array();
$var['class'] = $originalClassName;
$var['model'] = $originalClassName;
$var['module'] = $moduleName ?: $appName;
$var['moduleName'] = $moduleName;
$var['default'] = $node['default'] ?: 'DEFAULT';
$var['constants'] = $consts;
$var['properties'] = $properties;
$var['comment'] = $comment;
$var['package'] = $appName;
$var['extends'] = $extends ?: '\\MEnumBase';
$var['description'] = $description;
$this->generateEnumeration($className, $var);
continue;
}
$document = $ormmap = $docassoc = $docattr = $attributes = array();
$document[] = '';
$document[] = $tab . 'public static function ORMMap() {';
$document[] = '';
$ormmap[] = $tab . $tab . 'return array(';
$ormmap[] = $tab . $tab . $tab . "'class' => \\get_called_class(),";
$ormmap[] = $tab . $tab . $tab . "'database' => " . (substr($dbName, 0, 1) == "\\" ? $dbName . ',' : "'{$dbName}',");
$tableName = $node['table'];
$ormmap[] = $tab . $tab . $tab . "'table' => '{$tableName}',";
if ($extends) {
$ormmap[] = $tab . $tab . $tab . "'extends' => '{$extends}',";
}
$pk = '';
$getterSetter = "\n\n /**\n * Getters/Setters\n */";
$attributes = $node['attributes'];
foreach ($attributes as $attributeName => $attributeData) {
$isPK = false;
$at = explode(',', $attributeData);
// atData:
// 0 - column
// 1 - type
// 2 - null or not null
// 3 - key type
// 4 - generator
$attribute = $tab . $tab . $tab . "'{$attributeName}' => array(";
$attribute .= "'column' => '{$at[0]}'";
if ($at[3]) {
$attribute .= ",'key' => '{$at[3]}'";
$isPK = $at[3] == 'primary';
if ($isPK) {
$pk = $attributeName;
if ($at[4]) {
//.........这里部分代码省略.........
示例11: init
public function init()
{
parent::init();
$this->idLanguage = Manager::getSession()->idLanguage;
}
示例12: listCEFERelations
public function listCEFERelations($idEntityCxn, $idEntityFrame, $relationEntry)
{
$idLanguage = \Manager::getSession()->idLanguage;
$cxnElement = new ConstructionElement();
$criteria1 = $cxnElement->getCriteria()->select('idEntity');
Base::relation($criteria1, 'constructionelement', 'construction', 'rel_elementof');
$criteria1->where("construction.idEntity = {$idEntityCxn}");
$ce = $criteria1->asQuery()->chunkResult('idEntity', 'idEntity');
$frameElement = new FrameElement();
$criteria2 = $frameElement->getCriteria()->select('idEntity');
Base::relation($criteria2, 'frameelement', 'frame', 'rel_elementof');
$criteria2->where("frame.idEntity = {$idEntityFrame}");
$fe = $criteria2->asQuery()->chunkResult('idEntity', 'idEntity');
$criteria = $this->getCriteria()->select('idEntity1, relationtype.entry as idType, idEntity2');
$criteria->where("relationtype.entry = '{$relationEntry}'");
$criteria->where("idEntity1", "in", $ce);
$criteria->where("idEntity2", "in", $fe);
return $criteria;
}
示例13: invokeHandler
public function invokeHandler($m, $handler)
{
global $context, $module, $action, $item, $session, $page, $auth, $perms, $navbar, $theme, $history, $self, $url;
if ($handler == '') {
return false;
}
//$this->data = $data;
$this->action = $handler;
$app = Manager::getApp();
if ($m == '' || $m == $app) {
$module = $app;
$path = Manager::getAppPath() . '/controllers/';
} else {
$module = $m;
$path = Manager::getModulePath($module, 'controllers/');
}
//mdump("Handler:invokeHandler: [$module][$handler]");
$context = Manager::getContext();
$action = $context->getAction();
$self = $context->getAction();
$item = mrequest('item');
$session = Manager::getSession();
$navbar = new MNavigationBar();
//$view = Manager::getView($module, 'handler', $action);
$page = $this->theme;
$url = Manager::getCurrentURL();
$auth = Manager::getAuth();
$perms = Manager::getPerms();
$theme = $this->theme;
$file = $path . $handler . '.inc.php';
//mdump('Handler:invokeHandler: file : ' . $file);
if ($return = file_exists($file)) {
include $file;
}
return $return;
}
示例14: listEvokesRelations
public function listEvokesRelations()
{
$idLanguage = \Manager::getSession()->idLanguage;
$cmd = <<<HERE
SELECT RelationType.entry, entry_relatedFrame.name, relatedFrame.idEntity, relatedFrame.idFrame
FROM Construction
INNER JOIN Entity entity1
ON (Construction.idEntity = entity1.idEntity)
INNER JOIN EntityRelation
ON (entity1.idEntity = EntityRelation.idEntity1)
INNER JOIN RelationType
ON (EntityRelation.idRelationType = RelationType.idRelationType)
INNER JOIN Entity entity2
ON (EntityRelation.idEntity2 = entity2.idEntity)
INNER JOIN Frame relatedFrame
ON (entity2.idEntity = relatedFrame.idEntity)
INNER JOIN Entry entry_relatedFrame
ON (relatedFrame.entry = entry_relatedFrame.entry)
WHERE (Construction.idConstruction = {$this->getId()})
AND (RelationType.entry in (
'rel_evokes'))
AND (entry_relatedFrame.idLanguage = {$idLanguage} )
ORDER BY RelationType.entry, entry_relatedFrame.name
HERE;
$result = $this->getDb()->getQueryCommand($cmd)->treeResult('entry', 'name,idEntity,idFrame');
return $result;
}
示例15: handlerResponse
public function handlerResponse($return = false)
{
Manager::getSession()->freeze();
return $this->response->sendResponse($this->result, $return);
}