CakePHP 4.x User Management Premium Plugin Version 4.0.x
Version 4.0.0 Release Date: 18-Dec-2019
Bug Fixes and Improvement Table
From Version | To Version | Changes Date | Links |
4.0.0 | 4.0.1 | 30-Dec-2019 | |
4.0.1 | 4.0.2 | 08-Apr-2020 | |
4.0.2 | 4.0.3 | 21-Jun-2020 | View |
4.0.3 | 4.0.4 | 10-Oct-2020 | View |
Plugin Version- 4.0.0 to 4.0.1
Date: 30-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 4.0.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 4.0.1 version. You need to migrate user management plugin version from 4.0.0 to 4.0.1 in following steps...
1. Open plugins\Usermgmt\src\Controller\Component\UserAuthComponent.php
Go to updateActivity function
Add following code
unset($userActivityEntity['modified']);
before
$activityTable->save($userActivityEntity, ['validate'=>false]);
Go to getLastLoginTime function and this function code with following
public function getLastLoginTime() {
$last_login = $this->session->read('Auth.User.last_login');
if(!empty($last_login)) {
return $this->getFormatDatetime($last_login);
}
return '';
}
Go to getFormatDate function and replace 'UTC' with date_default_timezone_get()
Go to getFormatDatetime function and replace 'UTC' with date_default_timezone_get()
Add new function after getFormatDatetime function
/**
* Used to format time
*
* @access public
* @param mixed $dateObj string or date object
* @return string
*/
public function getFormatTime($dateObj) {
if(is_object($dateObj)) {
return $dateObj->i18nFormat('hh:mm a', date_default_timezone_get());
}
else if(!empty($dateObj)) {
return date('h:i A', strtotime($dateObj));
}
return null;
}
2. Open plugins\Usermgmt\src\Controller\Component\UserConnectComponent.php
Go to twitter_connect function
Replace this code
$user = $connection->get('account/verify_credentials');
with this code
$params = ['include_email'=>'true', 'include_entities'=>'false', 'skip_status'=>'true'];
$user = $connection->get('account/verify_credentials', $params);
3. Open plugins\Usermgmt\src\Controller\ScheduledEmailsController.php
Find public $searchFields ...
Replace this variable code with this one
public $searchFields = [
'index'=>[
'Usermgmt.ScheduledEmails'=>[
'ScheduledEmails'=>[
'type'=>'text',
'label'=>'Search',
'tagline'=>'Search by from name, email, subject, message',
'condition'=>'multiple',
'searchBreak'=>true,
'matchAllWords'=>true,
'searchFields'=>['ScheduledEmails.from_name', 'ScheduledEmails.from_email', 'ScheduledEmails.subject', 'ScheduledEmails.message'],
'inputOptions'=>['style'=>'width:300px;']
]
]
]
];
Go to edit function
Replace this code
$scheduledEmailEntity['schedule_date'] = $scheduledEmailEntity['schedule_date']->i18nFormat('dd-MMM-yyyy hh:mm a', 'UTC');
with this code
$scheduledEmailEntity['schedule_date'] = $this->UserAuth->getFormatDatetime($scheduledEmailEntity['schedule_date']);
4. Open plugins\Usermgmt\src\Controller\UserContactsController.php
Go to sendReply function
Replace this code
$userEmailEntity['message'] = '<br/><p>-------------------------------------------<br/>On '.$userContact['created']->i18nFormat('dd-MMM-yyyy', 'UTC').' at '.$userContact['created']->i18nFormat('hh:mm a').'<br/>'.$userContact['name'].' wrote:</p>'.$userContact['requirement'];
with this code
$userEmailEntity['message'] = '<br/><p>-------------------------------------------<br/>On '.$this->UserAuth->getFormatDate($userContact['created']).' at '.$this->UserAuth->getFormatTime($userContact['created']).'<br/>'.$userContact['name'].' wrote:</p>'.$userContact['requirement'];
5. Open plugins\Usermgmt\src\Controller\UserEmailsController.php
Find public $searchFields ...
Replace this variable code with this one
public $searchFields = [
'index'=>[
'Usermgmt.UserEmails'=>[
'UserEmails'=>[
'type'=>'text',
'label'=>'Search',
'tagline'=>'Search by from name, email, subject, message',
'condition'=>'multiple',
'searchBreak'=>true,
'matchAllWords'=>true,
'searchFields'=>['UserEmails.from_name', 'UserEmails.from_email', 'UserEmails.subject', 'UserEmails.message'],
'inputOptions'=>['style'=>'width:300px;']
]
]
]
];
6. Open plugins\Usermgmt\src\Controller\UsersController.php
Go to editUser function
Replace this code
$userEntity['bday'] = $userEntity['bday']->i18nFormat('dd-MMM-yyyy', 'UTC');
with this code
$userEntity['bday'] = $this->UserAuth->getFormatDate($userEntity['bday']);
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 and replace code from plugin 4.0.1 version users controller
Go to editProfile function and replace code from plugin 4.0.1 version users controller
7. Open plugins\Usermgmt\src\View\Helper\UserAuthHelper.php
Go to getLastLoginTime function and this function code with following
public function getLastLoginTime() {
$last_login = $this->session->read('Auth.User.last_login');
if(!empty($last_login)) {
return $this->getFormatDatetime($last_login);
}
return '';
}
Go to getFormatDate function and replace 'UTC' with date_default_timezone_get()
Go to getFormatDatetime function and replace 'UTC' with date_default_timezone_get()
Add new function after getFormatDatetime function
/**
* Used to format time
*
* @access public
* @param mixed $dateObj string or date object
* @return string
*/
public function getFormatTime($dateObj) {
if(is_object($dateObj)) {
return $dateObj->i18nFormat('hh:mm a', date_default_timezone_get());
}
else if(!empty($dateObj)) {
return date('h:i A', strtotime($dateObj));
}
return null;
}
8. Replace plugins\Usermgmt\templates\element\paginator.php from version 4.0.1
9. Replace plugins\Usermgmt\templates\Users\add_multiple_users.php from version 4.0.1
10. Replace plugins\Usermgmt\templates\Users\myprofile.php from version 4.0.1
Plugin Version- 4.0.1 to 4.0.2
Date: 08-Apr-2020
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 4.0.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 few changes in 4.0.2 version. You need to migrate user management plugin version from 4.0.1 to 4.0.2 in following steps...
1. Replace plugins\Usermgmt\src\Controller\Component\ControllerListComponent.php from version 4.0.2
2. Replace plugins\Usermgmt\src\Controller\UserGroupPermissionsController.php from version 4.0.2
3. Replace plugins\Usermgmt\templates\UserGroupPermissions\groups.php from version 4.0.2
4. Replace plugins\Usermgmt\templates\UserGroupPermissions\subgroups.php from version 4.0.2
5. Replace plugins\Usermgmt\templates\UserGroupPermissions\print_permission_changes.php from version 4.0.2
Plugin Version- 4.0.2 to 4.0.3
Date: 21-Jun-2020
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 4.0.2 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 4.0.3 version. You need to migrate user management plugin version from 4.0.2 to 4.0.3 in following steps...
1. Open plugins\Usermgmt\src\Controller\Component\SearchComponent.php
Go to beforeRender function
Replace this code
if(!strlen($options['value']) && strlen($options['default'])) {
with this code
if(!strlen((string)$options['value']) && strlen((string)$options['default'])) {
Replace this code
if(!empty($options['selectorArguments'])) {
$options['options'] = $workingModel->$selectorName($options['selectorArguments']);
}
else {
$options['options'] = $workingModel->$selectorName();
}
with this code
if(is_array($options['selectorArguments']) && count($options['selectorArguments'])) {
$options['options'] = $workingModel->$selectorName($options['selectorArguments']);
}
else if(!is_array($options['selectorArguments']) && isset($options['selectorArguments'])) {
$options['options'] = $workingModel->$selectorName($options['selectorArguments']);
}
else {
$options['options'] = $workingModel->$selectorName();
}
Go to getDefaultSearchOptions function, find "-- 'condition' =" under possible values
Replace 'comma', 'semicolon', 'null' with 'multiple', 'comma', 'semicolon', 'null'
added new condition for select inputs, which work for multi select input
2. Open plugins\Usermgmt\src\Controller\Component\SslComponent.php
Go to __construct function
Replace this function code with
public function __construct(ComponentRegistry $registry, array $config = []) {
$this->registry = $registry;
$this->controller = $registry->getController();
$this->request = $registry->getController()->getRequest();
parent::__construct($registry, $config);
}
3. Replace plugins\Usermgmt\src\Model\Behavior\SearchingBehavior.php from version 4.0.3
4. Open plugins\Usermgmt\templates\element\search_form.php
find echo $jq; around line number 300 and after add following code
echo '<style type="text/css">
.typeahead .dropdown-item {
white-space: normal;
font-size: 80%;
}
</style>';
5. Open plugins\Usermgmt\templates\ScheduledEmails\all_scheduled_emails.php
Replace
echo "<td>".$row['user']['first_name'].' '.$row['user']['last_name']."</td>";
with
echo "<td>";
if(!empty($row['user']['id'])) {
echo $row['user']['first_name'].' '.$row['user']['last_name'];
}
echo "</td>";
6. Open plugins\Usermgmt\templates\ScheduledEmails\view.php
Replace
<td><?php echo $scheduledEmail['user']['first_name'].' '.$scheduledEmail['user']['last_name'];?></td>
with
<td>
<?php
if(!empty($scheduledEmail['user']['id'])) {
echo $scheduledEmail['user']['first_name'].' '.$scheduledEmail['user']['last_name'];
}?>
</td>
Replace
echo "<td>".$row['user']['first_name'].' '.$row['user']['last_name']."</td>";
with
echo "<td>";
if(!empty($row['user']['id'])) {
echo $row['user']['first_name'].' '.$row['user']['last_name'];
}
echo "</td>";
Find $.ajax({ at bottom where we are deleting recipients
add new parament after url : url
headers: {"X-CSRF-Token": "<?php echo $this->request->getCookie('csrfToken');?>"},
7. Open plugins\Usermgmt\templates\UserEmails\all_user_emails.php
Replace
echo "<td>".$row['user']['first_name'].' '.$row['user']['last_name']."</td>";
with
echo "<td>";
if(!empty($row['user']['id'])) {
echo $row['user']['first_name'].' '.$row['user']['last_name'];
}
echo "</td>";
8. Open plugins\Usermgmt\templates\ScheduledEmails\view.php
Find $(".user_id_input").select2({
add new parament after delay: 1000,
headers: {"X-CSRF-Token": "<?php echo $this->request->getCookie('csrfToken');?>"}
9. Open plugins\Usermgmt\templates\UserEmails\view.php
Replace
<td><?php echo $userEmail['user']['first_name'].' '.$userEmail['user']['last_name'];?></td>
with
<td>
<?php
if(!empty($userEmail['user']['id'])) {
echo $userEmail['user']['first_name'].' '.$userEmail['user']['last_name'];
}?>
</td>
Replace
echo "<td>".$row['user']['first_name'].' '.$row['user']['last_name']."</td>";
with
echo "<td>";
if(!empty($row['user']['id'])) {
echo $row['user']['first_name'].' '.$row['user']['last_name'];
}
echo "</td>";
10. Open plugins\Usermgmt\templates\UserGroupPermissions\groups.php
Find $.ajax({ at bottom where we send change permission ajax request
add new parament after url : url,
headers: {"X-CSRF-Token": "<?php echo $this->request->getCookie('csrfToken');?>"}
11. Open plugins\Usermgmt\templates\UserGroupPermissions\subgroups.php
Find $.ajax({ at bottom where we send change permission ajax request
add new parament after url : url,
headers: {"X-CSRF-Token": "<?php echo $this->request->getCookie('csrfToken');?>"}
Plugin Version- 4.0.3 to 4.0.4
Date: 10-Oct-2020
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 4.0.3 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 4.0.4 version. You need to migrate user management plugin version from 4.0.3 to 4.0.4 in following steps...
1. Replace plugins\Usermgmt\src\Auth\PermissionAuthenticate.php from version 4.0.4
2. Replace plugins\Usermgmt\src\Auth\PermissionAuthorize.php from version 4.0.4
3. Open plugins\Usermgmt\src\Controller\Component\EmailHandlerComponent.php
Replace
use Cake\ORM\TableRegistry;
with
use Cake\Datasource\FactoryLocator;
Replace everywhere in this file
TableRegistry::getTableLocator()
with
FactoryLocator::get('Table')
4. Open plugins\Usermgmt\src\Controller\Component\SearchComponent.php
Replace
use Cake\ORM\TableRegistry;
with
use Cake\Datasource\FactoryLocator;
Replace everywhere in this file
TableRegistry::getTableLocator()
with
FactoryLocator::get('Table')
5. Open plugins\Usermgmt\src\Controller\Component\UserAuthComponent.php
Replace
use Cake\ORM\TableRegistry;
with
use Cake\Datasource\FactoryLocator;
Replace everywhere in this file
TableRegistry::getTableLocator()
with
FactoryLocator::get('Table')
6. Open plugins\Usermgmt\src\Model\Table\UsersTable.php
Replace
use Cake\ORM\TableRegistry;
with
use Cake\Datasource\FactoryLocator;
Replace everywhere in this file
TableRegistry::getTableLocator()
with
FactoryLocator::get('Table')
7. Replace plugins\Usermgmt\webroot\js\ajax.validation.js from version 4.0.4
8. Open plugins\Usermgmt\src\Controller\UsersController.php
Go to deleteUser & deleteAccount Function
Replace
$this->loadModel('UserDetails');
$this->loadModel('LoginTokens');
$this->loadModel('UserActivities');
$this->loadModel('UserSocials');
with
$this->loadModel('Usermgmt.UserDetails');
$this->loadModel('Usermgmt.LoginTokens');
$this->loadModel('Usermgmt.UserActivities');
$this->loadModel('Usermgmt.UserSocials');