info@ektanjali.com +91 99276-99286

CakePHP 3.x User Management Premium Plugin Version 3.3.x

Plugin Bug Fixes & Migration

Version 3.3.0 Release Date: 5-Jul-2018

Bug Fixes and Improvement Table

From Version To Version Changes Date Links
3.3.0 3.3.1 15-Nov-2018

 View

3.3.1 3.3.2 17-Dec-2018

View

3.3.2 3.3.3 29-Dec-2019

View

 

 Plugin Version- 3.3.0 to 3.3.1

Date: 15-Nov-2018

Please keep backup of your code before replacing the files. Either you can replace existing files or do changes in existing code as per new changes.

You can download the old version 3.3.0 and make a difference with your application code using Kdiff3 software http://kdiff3.sourceforge.net/ and record your changes done in plugin files.

we have done few changes in 3.3.1 version. You need to migrate user management plugin version from 3.3.0 to 3.3.1 in following steps...

1. Open plugins\Usermgmt\src\Controller\ScheduledEmailsController.php

Go to beforeFilter function

Delete this code

if(isset($this->Csrf) && $this->getRequest()->is('ajax') && $this->getRequest()->getParam('action') == 'deleteRecipient') {
    $this->getEventManager()->off($this->Csrf);
}

2. Open plugins\Usermgmt\src\Controller\UserEmailsController.php

Go to beforeFilter function

Delete this code

if(isset($this->Csrf) && $this->getRequest()->is('ajax') && $this->getRequest()->getParam('action') == 'searchEmails') {
    $this->getEventManager()->off($this->Csrf);
}

3. Open plugins\Usermgmt\src\Controller\UserGroupPermissionsController.php

Go to beforeFilter function

Delete this code

if(isset($this->Csrf)) {
    $this->getEventManager()->off($this->Csrf);
}

4. Open plugins\Usermgmt\src\Controller\UsermgmtAppController.php

Go to initialize function

Delete this code

$this->loadComponent('Csrf');

5. Open plugins\Usermgmt\src\Controller\Component\UserAuthComponent.php

Go to isAllowedLogin function

Replace this code

if(!empty($res)) {
    return false;
} else {
    $activityModel->updateAll(['logout'=>1], ['user_id'=>$userId, 'useragent !='=>$useragent]);
}

with this code

if(!empty($res)) {
    if($res['logout'] || $res['deleted']) {
        return true;
    }
    return false;
} else {
    $activityModel->updateAll(['logout'=>1], ['user_id'=>$userId, 'useragent !='=>$useragent]);
}

 

6. Open plugins\Usermgmt\src\Model\Behavior\SearchingBehavior.php

Go to setSearchValues function

Replace this code

$this->searchValues[$this->alias] = array_merge($this->searchValues[$this->alias], $values);

with this code

if(is_array($values)) {
    $this->searchValues[$this->alias] = array_merge($this->searchValues[$this->alias], $values);
}

7. Replace plugins\Usermgmt\src\View\Cell\PermissionCell.php from latest plugin

8. Go to plugins\Usermgmt\vendor

Replace Facebook, Google, recaptcha, vendor files with latest version files

 

 Plugin Version- 3.3.1 to 3.3.2

Date: 17-Dec-2018

Please keep backup of your code before replacing the files. Either you can replace existing files or do changes in existing code as per new changes.

You can download the old version 3.3.1 and make a difference with your application code using Kdiff3 software http://kdiff3.sourceforge.net/ and record your changes done in plugin files.

we have done only 1 change in 3.3.2 version. You need to migrate user management plugin version from 3.3.1 to 3.3.2 in following steps..

 

Open plugins\Usermgmt\src\Controller\Component\UserConnectComponent.php

Go to gmail_connect function

Replace this code

$client->setScopes(array('https://www.googleapis.com/auth/userinfo.email'));

with this code

$client->setScopes(array('email'));
$client->setPrompt('select_account');

 

 Plugin Version- 3.3.2 to 3.3.3

Date: 29-Dec-2019

Please keep backup of your code before replacing the files. Either you can replace existing files or do changes in existing code as per new changes.

You can download the old version 3.3.2 and make a difference with your application code using Kdiff3 software http://kdiff3.sourceforge.net/ and record your changes done in plugin files.

 

1. Open plugins\Usermgmt\src\Controller\ScheduledEmailsController.php

Go to edit function

Replace this code

$this->set(compact('templates', 'signatures', 'groups', 'scheduledEmailEntity'));

with this code

$this->set(compact('groups', 'scheduledEmailEntity'));

 

2. Open plugins\Usermgmt\src\Controller\UserContactsController.php

Go to sendReply function

Replace this code

$this->set(compact('userEmailEntity', 'name', 'templates', 'signatures', 'userContactId'));

with this code

$this->set(compact('userEmailEntity', 'name', 'userContactId'));

and add following code

$this->set(compact('templates', 'signatures'));after
$signatures = $this->UserEmailSignatures->getEmailSignatures();

 

3. Open plugins\Usermgmt\src\Controller\UserEmailsController.php

Go to send function

Replace this code

$this->set(compact('groups', 'sel_users', 'templates', 'signatures', 'userEmailEntity'));

with this code

$this->set(compact('groups', 'userEmailEntity'));

and add following code

$this->set(compact('sel_users', 'templates', 'signatures'));after
$signatures = $this->UserEmailSignatures->getEmailSignatures();

Go to sendToUser function 

move below lines
$templates = $this->UserEmailTemplates->getEmailTemplates();
$signatures = $this->UserEmailSignatures->getEmailSignatures();
$this->set(compact('userId', 'name', 'email', 'templates', 'signatures', 'userEmailEntity'));

in

if(!empty($user)) {
    //rest code
    // move lines here at last of this if block
}

4. Open plugins\Usermgmt\src\Controller\UserGroupPermissionsController.php

Go to permissionGroupMatrix function

Replace this code

$this->set(compact('userGroupPermissionEntity', 'allControllerClasses', 'userGroups', 'selectedControllers', 'selectedUserGroupIds', 'selectedUserGroups', 'funcDesc', 'dbPermissions', 'plugins'));

with this code

$this->set(compact('userGroupPermissionEntity', 'allControllerClasses', 'userGroups', 'selectedControllers', 'selectedUserGroupIds', 'selectedUserGroups', 'funcDesc', 'dbPermissions'));

5. Open plugins\Usermgmt\src\Controller\UsersController.php

Go to login function

Replace this code

$userEntity = $this->Users->newEntity($this->getRequest()->getData(), ['validate'=>'forLogin']);

with this code

$userEntity = $this->Users->newEntity($formdata, ['validate'=>'forLogin']);

Go to add_social_user function

Replace this code

if(!empty($socialData['id'])) {

with this code

if(!empty($socialData['id']) && !empty($socialData['type'])) {

 

Go to login_twitter function

Replace this function code from 3.3.3 version users controller login_twitter function

 

6. Open plugins\Usermgmt\src\Controller\Component\SearchComponent.php

Go to initialize function

Replace this code

if(!is_object($this->controller->{$model})) {

with this code

if(!isset($this->controller->{$model}) || !is_object($this->controller->{$model})) {

 

Go to beforeRender function

Replace this code

default:
    continue;

with this code

default:
    break;

 

7. Open plugins\Usermgmt\src\Controller\Component\UserConnectComponent.php

Replace twitter_connect and linkedin_connect function from 3.3.3 version UserConnect component file

 

8. Open plugins\Usermgmt\src\Model\Behavior\SearchingBehavior.php

Go to applySearchFilters function

Find case 'text': Replace 'continue' to 'break'

Find case 'select': Replace 'continue' to 'break'

 

9. Open plugins\Usermgmt\src\Template\Element\dashboard.ctp

Go to applySearchFilters function

Find 'Delete Account' link add class 'class'=>'dropdown-item'

 

10. Replace plugins\Usermgmt\src\Template\Element\provider.ctp from 3.3.3 version of plugin

 

11. Open plugins\Usermgmt\src\View\Helper\UserAuthHelper.php

Replace class variable public $view; with public $viewobj;

Add new class variable public $request;

Go to __construct function

Replace this code

$this->view = $View;

with this code

$this->viewobj = $View;
$this->request = $View->getRequest();

Go to getLastLoginTime function

Replace this code

return $last_login->format($format);

with this code

if(is_object($last_login)) {
    return $last_login->format($format);
} else {
    return date($format, strtotime($last_login));
}

Go to HP function

Replace this code

$permissionCell = $this->view->cell('Usermgmt.Permission');

with this code

$permissionCell = $this->viewobj->cell('Usermgmt.Permission');

 

12. Add this new file plugins\Usermgmt\src\Plugin.php from 3.3.0 plugin version

13. Add facebook-logo.png, foursquare-logo.png, google-logo.svg, linkedin-logo.png, twitter-logo.png, yahoo-logo.png images from plugins\Usermgmt\webroot\img

14. Go to plugins\Usermgmt\vendor

Replace Twitter, Linkedin vendor files with latest version files