Beispiel #1
0
function handle_delete($id)
{
    global $path_to_root;
    $extensions = get_company_extensions();
    $ext = $extensions[$id];
    if ($ext['version'] != '-') {
        if (!uninstall_package($ext['package'])) {
            return false;
        }
    } else {
        @(include_once $path_to_root . '/' . $ext['path'] . '/hooks.php');
        $hooks_class = 'hooks_' . $ext['package'];
        if (class_exists($hooks_class)) {
            $hooks = new $hooks_class();
            $hooks->uninstall_extension(false);
        }
    }
    unset($extensions[$id]);
    if (update_extensions($extensions)) {
        display_notification(_("Selected extension has been successfully deleted"));
    }
    return true;
}
Beispiel #2
0
$page_security = 'SA_CREATEMODULES';
$path_to_root = "..";
include_once $path_to_root . "/includes/session.inc";
include_once $path_to_root . "/includes/packages.inc";
if ($use_popup_windows) {
    $js = get_js_open_window(900, 500);
}
page(_($help_context = "Install Charts of Accounts"), false, false, '', $js);
include_once $path_to_root . "/includes/date_functions.inc";
include_once $path_to_root . "/admin/db/company_db.inc";
include_once $path_to_root . "/admin/db/maintenance_db.inc";
include_once $path_to_root . "/includes/ui.inc";
//---------------------------------------------------------------------------------------------
if ($id = find_submit('Delete', false)) {
    $extensions = get_company_extensions();
    if ($extensions[$id]['type'] == 'chart' && uninstall_package($extensions[$id]['package'])) {
        unset($extensions[$id]);
        if (update_extensions($extensions)) {
            display_notification(_("Selected chart has been successfully deleted"));
            meta_forward($_SERVER['PHP_SELF']);
        }
    }
}
if ($id = find_submit('Update', false)) {
    install_extension($id);
}
//---------------------------------------------------------------------------------------------
start_form(true);
div_start('ext_tbl');
start_table(TABLESTYLE);
$th = array(_("Chart"), _("Installed"), _("Available"), _("Encoding"), "", "");
Beispiel #3
0
	header("Expires: 0");
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: no-cache, must-revalidate");
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.ldap.inc');
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.artica.inc');
	include_once('ressources/class.mysql.inc');
	$usersmenus=new usersMenus();
	if($usersmenus->AsArticaAdministrator==false){header('location:users.index.php');exit;}	
	if(isset($_GET["main"])){main_switch();exit;}
	if(isset($_GET["status"])){main_status();exit;}
	if(isset($_GET["CheckEveryMinutes"])){SaveConf();exit;}
	if(isset($_GET["ArticaUpdateInstallPackage"])){ArticaUpdateInstallPackage();exit;}
	if(isset($_GET["auto_update_perform"])){auto_update_perform();exit;}
	if(isset($_GET["PackageUninstall"])){uninstall_package();exit;}
	if(isset($_GET["PackageUninstallRoolback"])){uninstall_rollback_package();exit;}
	if(isset($_GET["apply_uninstall"])){uninstall_to_system();exit;}
	if(isset($_GET["PackageInstall"])){install_package();exit;}
	if(isset($_GET["PackageInstallRoolback"])){install_rollback_package();exit;}
	if(isset($_GET["DeleteEvent"])){main_event_delete();exit;}
	if(isset($_GET["apply_upgrade"])){upgrade_to_system();exit;}
	if(isset($_GET["popup"])){popup();exit;}
	//main_page();
	
	main_js();
	
	
function main_js(){
	$page=CurrentPageName();
	$prefix=str_replace('.',"_",$page);
Beispiel #4
0
    $comp = user_company();
    foreach ($db_connections as $n => $conn) {
        $db = $_SESSION["wa_current_user"]->set_db_connection($n);
        $sql = "UPDATE {$conn['tbpref']}users SET theme='default' WHERE theme='{$theme}'";
        if (!db_query($sql, 'Cannot update user theme settings')) {
            return false;
        }
    }
    $db = $_SESSION["wa_current_user"]->set_db_connection($comp);
    $_SESSION['wa_current_user']->prefs->theme = 'default';
    return true;
}
if (($id = find_submit('Delete', false)) && clean_user_themes($id)) {
    $extensions = get_company_extensions();
    $theme = $extensions[$id]['package'];
    if (uninstall_package($theme)) {
        $dirname = $path_to_root . '/themes/' . $theme;
        flush_dir($dirname, true);
        rmdir($dirname);
        unset($extensions[$id]);
        if (update_extensions($extensions)) {
            display_notification(_("Selected theme has been successfully deleted"));
            meta_forward($_SERVER['PHP_SELF']);
        }
    }
}
if ($id = find_submit('Update', false)) {
    install_extension($id);
}
//---------------------------------------------------------------------------------------------
start_form(true);
Beispiel #5
0
     @file_put_contents("/tmp/{$pkgid}.info", $static_output);
     $pkgid = htmlspecialchars($pkgid);
     echo "<script type='text/javascript'>document.location=\"pkg_mgr_install.php?mode=installedinfo&pkg={$pkgid}\";</script>";
     send_event("service restart packages");
     break;
 case 'reinstallall':
     if (is_array($config['installedpackages']) && is_array($config['installedpackages']['package'])) {
         $todo = array();
         foreach ($config['installedpackages']['package'] as $package) {
             $todo[] = array('name' => $package['name'], 'version' => $package['version']);
         }
         foreach ($todo as $pkgtodo) {
             $static_output = "";
             if ($pkgtodo['name']) {
                 update_output_window($static_output);
                 uninstall_package($pkgtodo['name']);
                 install_package($pkgtodo['name']);
             }
         }
         update_status(gettext("All packages reinstalled."));
         $static_output .= "\n" . gettext("All packages reinstalled.");
         update_output_window($static_output);
         filter_configure();
         send_event("service restart packages");
     } else {
         update_output_window(gettext("No packages are installed."));
     }
     break;
 case 'installed':
 default:
     $status = install_package($pkgid);
Beispiel #6
0
    exit;
}
if (isset($_GET["CheckEveryMinutes"])) {
    SaveConf();
    exit;
}
if (isset($_GET["ArticaUpdateInstallPackage"])) {
    ArticaUpdateInstallPackage();
    exit;
}
if (isset($_GET["auto_update_perform"])) {
    auto_update_perform();
    exit;
}
if (isset($_GET["PackageUninstall"])) {
    uninstall_package();
    exit;
}
if (isset($_GET["PackageUninstallRoolback"])) {
    uninstall_rollback_package();
    exit;
}
if (isset($_GET["apply_uninstall"])) {
    uninstall_to_system();
    exit;
}
if (isset($_GET["PackageInstall"])) {
    install_package();
    exit;
}
if (isset($_GET["PackageInstallRoolback"])) {
Beispiel #7
0
function handle_delete($id)
{
    global $path_to_root, $installed_languages, $dflt_lang;
    $lang = $installed_languages[$id]['code'];
    if ($installed_languages[$id]['package']) {
        if (!uninstall_package($installed_languages[$id]['package'])) {
            return;
        }
    }
    if ($lang == $dflt_lang) {
        // on delete set default to current.
        $dflt_lang = $_SESSION['language']->code;
    }
    unset($installed_languages[$id]);
    $installed_languages = array_values($installed_languages);
    if (!write_lang()) {
        return;
    }
    $dirname = "{$path_to_root}/lang/{$lang}";
    if ($lang && is_dir($dirname)) {
        // remove nonstadard language dir
        flush_dir($dirname, true);
        rmdir($dirname);
    }
}