File rewrite_file_user.php cho bản cloud

<?php
session_start();
$_SESSION["tenant_db_name"] = 'database_name';
set_time_limit(0);
ini_set('memory_limit', '2048M');
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;
ini_set('display_errors','on');
$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!";
?>

Leave a Reply

You must be logged in to post a comment.