CODE STYLE class.sessions.php

This commit is contained in:
Fernando Ontiveros
2012-10-09 13:22:53 -04:00
parent b5a9522b6c
commit f11a2fdd93

View File

@@ -1,6 +1,7 @@
<?php <?php
/** /**
* class.Sessions.php * class.Sessions.php
*
* @package workflow.engine.ProcessMaker * @package workflow.engine.ProcessMaker
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
@@ -24,14 +25,17 @@
* *
*/ */
require_once 'classes/model/Session.php'; require_once 'classes/model/Session.php';
/** /**
* Sessions - Sessions class * Sessions - Sessions class
*
* @package workflow.engine.ProcessMaker * @package workflow.engine.ProcessMaker
* @author Everth S. Berrios Morales * @author Everth S. Berrios Morales
* @copyright 2008 COLOSA * @copyright 2008 COLOSA
*/ */
class Sessions { class Sessions
{
protected $tmpfile; protected $tmpfile;
private $sessionId; private $sessionId;
@@ -39,10 +43,12 @@ class Sessions {
/** /**
* This function is the constructor of the Sessions class * This function is the constructor of the Sessions class
*
* @param string $sSessionId * @param string $sSessionId
* @return void * @return void
*/ */
public function __construct($sSessionId=NULL){ public function __construct ($sSessionId = NULL)
{
$this->sessionId = $sSessionId; $this->sessionId = $sSessionId;
} }
@@ -57,8 +63,7 @@ class Sessions {
*/ */
public function getSessionUser ($sSessionId = NULL) public function getSessionUser ($sSessionId = NULL)
{ {
try try {
{
if ($sSessionId != NULL) { if ($sSessionId != NULL) {
$this->sessionId = $sSessionId; $this->sessionId = $sSessionId;
} else if ($this->sessionId == NULL) { } else if ($this->sessionId == NULL) {
@@ -80,8 +85,7 @@ class Sessions {
$this->deleteTmpfile(); $this->deleteTmpfile();
} }
return $aRow; return $aRow;
} } catch (Exception $oError) {
catch (Exception $oError) {
throw ($oError); throw ($oError);
} }
} }
@@ -97,8 +101,7 @@ class Sessions {
*/ */
public function verifySession ($sSessionId = NULL) public function verifySession ($sSessionId = NULL)
{ {
try try {
{
if ($sSessionId != NULL) { if ($sSessionId != NULL) {
$this->sessionId = $sSessionId; $this->sessionId = $sSessionId;
} else if ($this->sessionId == NULL) { } else if ($this->sessionId == NULL) {
@@ -124,8 +127,7 @@ class Sessions {
} }
return $aRow; return $aRow;
} } catch (Exception $oError) {
catch (Exception $oError) {
throw ($oError); throw ($oError);
} }
} }
@@ -246,7 +248,8 @@ class Sessions {
* param * param
* @return void * @return void
*/ */
private function deleteTmpfile(){ private function deleteTmpfile ()
{
if ($this->sessionId == NULL) { if ($this->sessionId == NULL) {
throw new Exception( 'session id was not set.' ); throw new Exception( 'session id was not set.' );
} }