This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Mahesh EU <mahesh@nintriva.com> | |
* @copyright 2017 Nintriva Technology solutions | |
* PHP version < 7.1 | |
*/ | |
include('SecurityAES.php'); | |
$value = "<service_id>#" . strtotime('NOW') * 1000; | |
$key = "<preshared>"; //16 Character Key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Mahesh EU <mahesh@nintriva.com> | |
* @copyright 2017 Nintriva Technology solutions | |
* PHP version < 7.1 | |
*/ | |
class SecurityAES { | |
public static function encrypt($input, $key) { | |
$size = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~# uname -a | |
~# lsb_release -a | |
~# locale-gen en_US | |
~# locale-gen en_US.UTF-8 | |
~# apt-get -y --force-yes remove ntpdate | |
~# apt-get -y --force-yes install ntp | |
~# /etc/init.d/ntp restart | |
~# dpkg-reconfigure tzdata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#base lcoation | |
RewriteBase /webroot/ | |
#RewriteCond $1 ^(admin/.*) this will check whether location(url) start with admin/ | |
RewriteCond $1 ^(admin/.*) | |
#RewriteRule ^regular expression$ newlcoation/$1 ($1 string matched in condition) | |
RewriteRule ^(webroot/www/admin/.*)$ webroot/www/index-test.php/$1 | |
#RewriteRule Flags | |
RewriteRule ^(.*)$ webroot/www/index-test.php [L] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function accessRules() { | |
return array( | |
/* rest of permission */ | |
array('allow', | |
'actions'=>array('details','update'), | |
'roles'=>array('updateOwnBiz','editor'), | |
), | |
array('allow', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$auth=Yii::app()->authManager | |
$auth->assign('admin',Yii::app()->user->id); | |
//here admin is privilege or role not user | |
// instead of Yii::app()->user->id you can give the id of user to whom role is need to be assign | |
//so we can assign permission to each user. | |
//We can check permission or role of user by | |
if(Yii::app()->user->checkAccess('deleteBiz'),Yii::app()->user->id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
'components'=>array( | |
/*. | |
restof body | |
.*/ | |
'authManager'=>array( | |
'class'=>'CDbAuthManager', | |
'connectionID'=>'db', | |
// 'assignmentTable’=>'tbl_authassignment', | |
// 'itemTable’=>'tbl_authitem', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Yii::app()->clientScript->registerScript('likefun', | |
"jQuery('body').undelegate('#like1','click').delegate( | |
'#like1','click',jQuery.ajax({'success':function(data){ | |
$('#like1').html(data); | |
}, | |
'url':'".$url."', | |
'cache':false | |
});return false;});", | |
CClientScript::POS_LOAD); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
CHtml::ajaxLink('label',array('url'), | |
array( | |
// 'dataType'=>'json', | |
'success'=>'js:function(data){ | |
$("#divId").html(data); | |
}', | |
), | |
array('class'=>'like','id'=>'like1') | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
CHtml::ajaxLink('label',array('url'), | |
array( | |
'update'=>'#divId' | |
), | |
array('class'=>'like','id'=>'like1') | |
); | |
?> |
NewerOlder