File rewrite_file_user.php cho bản cloud

  1. <?php
  2. $_SESSION["tenant_db_name"] = 'database_name';
  3. ini_set('memory_limit', '2048M');
  4. require_once 'config.inc.php';
  5. require_once 'include/utils/utils.php';
  6. require_once 'includes/Loader.php';
  7. require_once 'includes/runtime/Controller.php';
  8. require_once 'includes/runtime/BaseModel.php';
  9. require_once 'includes/runtime/Globals.php';
  10. include_once 'data/CRMEntity.php';
  11. require_once 'modules/Users/CreateUserPrivilegeFile.php';
  12. global $adb,$current_user;
  13. global $dbconfig;
  14. ini_set('display_errors','on');
  15. $dbusername = $dbconfig['db_username'];
  16. $dbpassword = $dbconfig['db_password'];
  17. if($adb){
  18. $adb->resetSettings('mysqli','localhost:3306','database_name',$dbusername,$dbpassword);
  19. }
  20. $sql="SELECT id FROM abmsco_users";
  21. $rsGroup = $adb->pquery($sql);
  22. if($adb->num_rows($rsGroup)) {
  23. while ($rowGroup = $adb->fetch_array($rsGroup)) {
  24. createUserPrivilegesfile($rowGroup['id']);
  25. createUserSharingPrivilegesfile($rowGroup['id']);
  26. }
  27. }
  28. echo "Done!";
  29. ?>

Leave a Reply

You must be logged in to post a comment.