Skip to content

Commit

Permalink
Dev Fixed issue #9480
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed Jan 29, 2015
1 parent 760493c commit d0f3968
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 29 deletions.
7 changes: 0 additions & 7 deletions application/core/LSYii_Application.php
Expand Up @@ -39,13 +39,6 @@ class LSYii_Application extends CWebApplication
*/
public function __construct($config = null)
{
/**
* Load Psr4 autoloader, should be replaced by composer autoloader at some point.
*/
require __DIR__ . '/../Psr4AutoloaderClass.php';
$this->loader = new Psr4AutoloaderClass();
$this->loader->register();
$this->loader->addNamespace('ls\\pluginmanager', __DIR__ . '/../libraries/PluginManager');
parent::__construct($config);
Yii::setPathOfAlias('bootstrap' , Yii::getPathOfAlias('ext.bootstrap'));
// Load the default and environmental settings from different files into self.
Expand Down
7 changes: 3 additions & 4 deletions application/core/plugins/AuthLDAP/AuthLDAP.php
@@ -1,5 +1,5 @@
<?php
class AuthLDAP extends AuthPluginBase
class AuthLDAP extends ls\pluginmanager\AuthPluginBase
{
protected $storage = 'DbStorage';

Expand Down Expand Up @@ -86,8 +86,7 @@ class AuthLDAP extends AuthPluginBase
)
);

public function __construct(PluginManager $manager, $id) {
parent::__construct($manager, $id);
public function init() {

/**
* Here you should handle subscribing to the events your plugin will handle
Expand Down Expand Up @@ -176,7 +175,7 @@ public function newUserSession()

if ($user === null && $this->autoCreate === false)
{
// If the user doesnt exist ín the LS database, he can not login
// If the user doesnt exist �n the LS database, he can not login
$this->setAuthFailure(self::ERROR_USERNAME_INVALID);
return;
}
Expand Down
5 changes: 2 additions & 3 deletions application/core/plugins/Authwebserver/Authwebserver.php
@@ -1,5 +1,5 @@
<?php
class Authwebserver extends AuthPluginBase
class Authwebserver extends ls\pluginmanager\AuthPluginBase
{
protected $storage = 'DbStorage';

Expand All @@ -23,8 +23,7 @@ class Authwebserver extends AuthPluginBase
)
);

public function __construct(PluginManager $manager, $id) {
parent::__construct($manager, $id);
public function init() {

/**
* Here you should handle subscribing to the events your plugin will handle
Expand Down
5 changes: 2 additions & 3 deletions application/core/plugins/ExportR/ExportR.php
@@ -1,13 +1,12 @@
<?php
class ExportR extends PluginBase {
class ExportR extends \ls\pluginmanager\PluginBase {

protected $storage = 'DbStorage';

static protected $description = 'Core: R-export';
static protected $name = 'Export results to R';

public function __construct(PluginManager $manager, $id) {
parent::__construct($manager, $id);
public function init() {

/**
* Here you should handle subscribing to the events your plugin will handle
Expand Down
5 changes: 2 additions & 3 deletions application/core/plugins/ExportSTATAxml/ExportSTATAxml.php
@@ -1,13 +1,12 @@
<?php
class ExportSTATAxml extends PluginBase {
class ExportSTATAxml extends \ls\pluginmanager\PluginBase {

protected $storage = 'DbStorage';

static protected $description = 'Core: Export survey results to a STATA xml file';
static protected $name = 'STATA Export';

public function __construct(PluginManager $manager, $id) {
parent::__construct($manager, $id);
public function init() {

/**
* Here you should handle subscribing to the events your plugin will handle
Expand Down
2 changes: 2 additions & 0 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -1964,6 +1964,7 @@ function upgradeTokens128()
function fixMySQLCollations()
{
global $modifyoutput;
$oDB = Yii::app()->db;
$sql = 'SHOW TABLE STATUS';
$dbprefix = $oDB->tablePrefix;
$result = $oDB->createCommand($sql)->queryAll();
Expand Down Expand Up @@ -2035,6 +2036,7 @@ function upgradeTokenTables126()

function alterLanguageCode($sOldLanguageCode,$sNewLanguageCode)
{
$oDB = Yii::app()->db;
$oDB->createCommand()->update('{{answers}}',array('language'=>$sNewLanguageCode),'language=:lang',array(':lang'=>$sOldLanguageCode));
$oDB->createCommand()->update('{{questions}}',array('language'=>$sNewLanguageCode),'language=:lang',array(':lang'=>$sOldLanguageCode));
$oDB->createCommand()->update('{{groups}}',array('language'=>$sNewLanguageCode),'language=:lang',array(':lang'=>$sOldLanguageCode));
Expand Down
2 changes: 1 addition & 1 deletion application/libraries/PluginManager/PluginManager.php
Expand Up @@ -185,7 +185,7 @@ public function scanPlugins($forceReload = false)
foreach ($this->pluginDirs as $pluginDir) {
$currentDir = Yii::getPathOfAlias($pluginDir);
if (is_dir($currentDir)) {
foreach (new DirectoryIterator($currentDir) as $fileInfo)
foreach (new \DirectoryIterator($currentDir) as $fileInfo)
{
if (!$fileInfo->isDot() && $fileInfo->isDir())
{
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -177,7 +177,7 @@
/**
* Load Psr4 autoloader, should be replaced by composer autoloader at some point.
*/
require 'application/Psr4AutoloaderClass.php';
require_once 'application/Psr4AutoloaderClass.php';
$loader = new Psr4AutoloaderClass();
$loader->register();
$loader->addNamespace('ls\\pluginmanager', __DIR__ . '/application/libraries/PluginManager');
Expand Down
6 changes: 2 additions & 4 deletions plugins/AuditLog/AuditLog.php
@@ -1,14 +1,12 @@
<?php
class AuditLog extends PluginBase {
class AuditLog extends \ls\pluginmanager\PluginBase {

protected $storage = 'DbStorage';
static protected $description = 'Core: Create an audit log of changes';
static protected $name = 'auditlog';


public function __construct(PluginManager $manager, $id) {
parent::__construct($manager, $id);

public function init() {
$this->subscribe('beforeSurveySettings');
$this->subscribe('newSurveySettings');
$this->subscribe('beforeActivate');
Expand Down
6 changes: 3 additions & 3 deletions plugins/ModulePlugin/ModulePlugin.php
Expand Up @@ -2,13 +2,13 @@
/**
* Example plugin that can not be activated.
*/
class ModulePlugin extends PluginBase
class ModulePlugin extends \ls\pluginmanager\PluginBase
{
static protected $description = 'Demo: This plugins registers a module.';
static protected $name = 'ModulePlugin';

public function __construct(PluginManager $manager, $id) {
parent::__construct($manager, $id);
public function init()
{
$this->subscribe('beforeActivate');
}

Expand Down

0 comments on commit d0f3968

Please sign in to comment.