<?php
$_SESSION["tenant_db_name"] = 'database_name';
require_once 'config.inc.php';
require_once 'include/utils/utils.php';
require_once 'includes/Loader.php';
require_once 'includes/runtime/Controller.php';
require_once 'includes/runtime/BaseModel.php';
require_once 'includes/runtime/Globals.php';
include_once 'data/CRMEntity.php';
require_once 'modules/Users/CreateUserPrivilegeFile.php';
global $adb,$current_user;
global $dbconfig;
$dbusername = $dbconfig['db_username'];
$dbpassword = $dbconfig['db_password'];
if($adb){
$adb->resetSettings('mysqli','localhost:3306','database_name',$dbusername,$dbpassword);
}
$sql="SELECT id FROM abmsco_users";
$rsGroup = $adb->pquery($sql);
if($adb->num_rows($rsGroup)) {
while ($rowGroup = $adb->fetch_array($rsGroup)) {
createUserPrivilegesfile($rowGroup['id']);
createUserSharingPrivilegesfile($rowGroup['id']);
}
}
echo "Done!";
?>