Permalink
Browse files

Adding fix for #192.

removing use of old sryle php tags.
  • Loading branch information...
Peter Adams
Peter Adams committed Dec 18, 2016
1 parent 3ab5b7c commit 2cfa988a0c14992a1b921bb97f503b0b51ae0bfc
Showing with 36 additions and 47 deletions.
  1. +17 −11 modules/base/classes/error.php
  2. +2 −2 modules/base/login.php
  3. +1 −18 modules/base/processRequest.php
  4. +1 −0 owa_caller.php
  5. +1 −1 owa_lib.php
  6. +14 −15 owa_module.php
@@ -87,29 +87,35 @@ function setErrorLevel() {
return;
}
function addLogger($type, $mask = null, $config = array()) {
function addLogger($type, $mask = null, $config = array() ) {
// make child logger
$child = $this->loggerFactory($type, $config);
if (!empty($child)):
if ( ! empty( $child ) ) {
//set error level mask
if (!empty($mask)):
$child->setMask($mask);
endif;
if ( ! empty( $mask ) ) {
$child->setMask( $mask );
}
// add child to main composite logger
$ret = $this->logger->addChild($child);
else:
$ret = $this->logger->addChild( $child );
} else {
$ret = false;
endif;
}
//set hasChildren flag
if ($ret == true):
if ( $ret == true ) {
$this->hasChildren = true;
else:
} else {
return false;
endif;
}
}
function removeLogger($type) {
View
@@ -41,9 +41,9 @@ function action() {
// if authentication is successfull
if ($status['auth_status'] == true) {
if (!empty($go)) {
if (!empty($go)) {
// redirect to url if present
$url = urldecode($go);
$url = urldecode(htmlspecialchars_decode( $go ) );
$this->e->debug("redirecting browser to...:". $url);
owa_lib::redirectBrowser($url);
@@ -42,24 +42,7 @@ function __construct($params) {
function action() {
// Control logic
// Do not log if the first_hit cookie is still present.
$fh_state_name = owa_coreAPI::getSetting('base', 'first_hit_param');
$fh = owa_coreAPI::getStateParam($fh_state_name);
if (!empty($fh)) {
$this->e->debug('Clearing left over first first hit cookie.');
owa_coreAPI::clearState($fh_state_name);
$this->e->debug('Left over first first hit cookie found...aborting request as likely a robot.');
$this->event->set('do_not_log', true);
return;
}
// set variety of new session properties.
if ($this->event->get('is_new_session')) {
}
// Control logic
}
function post() {
View
@@ -302,6 +302,7 @@ function setErrorHandler($mode) {
function isOwaInstalled() {
$version = owa_coreAPI::getSetting('base', 'schema_version');
if ($version > 0) {
return true;
} else {
View
@@ -562,7 +562,7 @@ public static function singleton($class_dir, $class_prefix, $class_name, $conf =
* @param string $url
*/
public static function redirectBrowser($url) {
//print ($url); exit;
// 302 redirect to URL
header ('Location: '.$url);
header ('HTTP/1.0 302 Found');
View
@@ -532,26 +532,25 @@ function install() {
$errors = '';
// Install schema
if (!empty($this->entities)):
if (!empty($this->entities)) {
foreach ($this->entities as $k => $v) {
$entity = owa_coreAPI::entityFactory($this->name.'.'.$v);
//$this->e->debug("about to execute createtable");
$status = $entity->createTable();
if ($status != true):
if ($status != true) {
$this->e->notice("Entity Installation Failed.");
$errors = true;
//return false;
endif;
}
}
endif;
}
// activate module and persist configuration changes
if ($errors != true):
if ($errors != true) {
// run post install hook
$ret = $this->postInstall();
@@ -569,10 +568,10 @@ function install() {
$this->e->notice("Installation complete.");
return true;
else:
} else {
$this->e->notice("Installation failed.");
return false;
endif;
}
}
@@ -611,9 +610,9 @@ function update() {
settype($seq, "integer");
if ($seq > $current_schema_version):
if ($seq > $current_schema_version) {
if ($seq <= $this->required_schema_version):
if ($seq <= $this->required_schema_version) {
$this->updates[$seq] = owa_coreAPI::updateFactory($this->name, substr($v['name'], 0, -4));
// if the cli update mode is required and we are not running via cli then return an error.
owa_coreAPI::debug('cli update mode required: '.$this->updates[$seq]->isCliModeRequired());
@@ -626,8 +625,8 @@ function update() {
// set schema version from sequence number in file name. This ensures that only one update
// class can ever be in use for a particular schema version
$this->updates[$seq]->schema_version = $seq;
endif;
endif;
}
}
}
@@ -708,11 +707,11 @@ function isSchemaCurrent() {
owa_coreAPI::debug("$this->name Schema version is $current_schema");
owa_coreAPI::debug("$this->name Required Schema version is $required_schema");
if ($current_schema >= $required_schema):
if ($current_schema >= $required_schema) {
return true;
else:
} else {
return false;
endif;
}
}
function getSchemaVersion() {

0 comments on commit 2cfa988

Please sign in to comment.