From: Denis Chenu Date: Wed, 30 Mar 2016 16:28:12 +0000 (+0200) Subject: [fix] Plugin breaks internal authentication v2.5 170216 (https://git.framasoft.org... X-Git-Url: http://gitweb.wikimedia.es/?a=commitdiff_plain;h=715cdc696160872a80cb669413f4a9063d9892ef;p=limesurvey%2FAuthWMESbyDB [fix] Plugin breaks internal authentication v2.5 170216 (https://git.framasoft.org/SondagePro-LimeSurvey-plugin/AuthWPbyDB/issues/1) --- diff --git a/AuthWPbyDB.php b/AuthWPbyDB.php index b02841e..3be1d63 100644 --- a/AuthWPbyDB.php +++ b/AuthWPbyDB.php @@ -12,7 +12,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -22,7 +22,7 @@ class AuthWPbyDB extends AuthPluginBase { protected $storage = 'DbStorage'; - + static protected $description = 'A plugin to authenticate user via WordPress DB.'; static protected $name = 'WordPress DB Authentification'; @@ -104,10 +104,15 @@ class AuthWPbyDB extends AuthPluginBase public function newLoginForm() { + if(floatval(App()->getConfig("versionnumber")) >= 2.5){ + $tag="div"; + }else{ + $tag="li"; + } if($this->addWpDb()){ $this->getEvent()->getContent($this) - ->addContent(CHtml::tag('li', array(), "")) - ->addContent(CHtml::tag('li', array(), "")); + ->addContent(CHtml::tag($tag, array(), "")) + ->addContent(CHtml::tag($tag, array(), "")); }else{// No login form if unable to access to Wp DB } @@ -125,6 +130,11 @@ class AuthWPbyDB extends AuthPluginBase public function newUserSession() { + $identity = $this->getEvent()->get('identity'); + if ($identity->plugin != 'AuthWPbyDB') + { + return; + } $sUserName = $this->getUserName(); $sUserPass = $this->getPassword();