Created
June 19, 2017 21:01
-
-
Save icetee/06ae42d0943ee8d6d8190c36f264630d to your computer and use it in GitHub Desktop.
CakePHP reorder acl tree
This file contains 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
/** | |
* This is a maint function to recover/reorder the | |
* lft/rght columns of the aco and aro models. | |
* | |
*/ | |
public function recover_acl_tree( ) { | |
App::Import('Model', 'Aco' ); | |
App::Import('Model', 'Aro' ); | |
$Aco = new Aco; | |
$Aro = new Aro; | |
if ( !$Aco->recover() || !$Aro->recover() ) { | |
echo 'Error recovering acl tree'; | |
} else { | |
echo 'Aros and Acos reordered.'; | |
} | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment