Ejemplo n.º 1
0
function UnRegisterModule($id)
{
    global $DB;
    $DB->Query("DELETE FROM b_agent WHERE MODULE_ID='" . $DB->ForSQL($id) . "'");
    CMain::DelGroupRight($id);
    $m = new CModule();
    $m->MODULE_ID = $id;
    $m->Remove();
    $res = GetModuleEvents("main", "OnAfterUnRegisterModule");
    while ($arEvent = $res->Fetch()) {
        ExecuteModuleEventEx($arEvent, array($id));
    }
}
Ejemplo n.º 2
0
 function RestoreModules()
 {
     $arBackup = CControllerClient::GetBackup();
     if (isset($arBackup["modules"])) {
         $oModule = new CModule();
         $arWasInstalled = $arBackup["modules"];
         $arNowInstalled = array();
         $arm = CModule::_GetCache();
         foreach ($arm as $module_id => $tr) {
             $arNowInstalled[] = $module_id;
         }
         foreach ($arNowInstalled as $module_id) {
             if (!in_array($module_id, $arWasInstalled)) {
                 $oModule->MODULE_ID = $module_id;
                 $oModule->Remove();
             } else {
                 unset($arWasInstalled[array_search($module_id, $arWasInstalled)]);
             }
         }
         foreach ($arWasInstalled as $module_id) {
             $oModule->MODULE_ID = $module_id;
             $oModule->Add();
         }
         unset($arBackup["modules"]);
         CControllerClient::SetBackup($arBackup);
     }
 }
Ejemplo n.º 3
0
function UnRegisterModule($id)
{
	global $DB;
	$DB->Query("DELETE FROM b_agent WHERE MODULE_ID='".$DB->ForSQL($id)."'");
	CMain::DelGroupRight($id);
	$m = new CModule;
	$m->MODULE_ID = $id;
	$m->Remove();
}