HEX
Server: Apache
System: Linux dev.epsylon.net 3.10.0-1160.144.1.el7.tuxcare.els2.x86_64 #1 SMP Sun Feb 15 11:22:42 UTC 2026 x86_64
User: nexper (1054)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/nexper/public_html/crm/custom/modules/Home/RemoveDashboardPages.php
<?php
/**
 * Created by PhpStorm.
 * User: lewis
 * Date: 17/02/14
 * Time: 13:49
 */


global $current_user;
$type = 'Home';
$pages = $current_user->getPreference('pages', $type);


if (count($pages) > 1) {

    if (!isset($_POST['status'])) {
        $html = "<form method='post' name='removepageform' action='index.php?module=Home&action=RemoveDashboardPages'/>";
        $html .= "<p>".$GLOBALS['app_strings']['LBL_DELETE_DASHBOARD1']." ".$pages[$_POST['page_id']]['pageTitle'] . " ".$GLOBALS['app_strings']['LBL_DELETE_DASHBOARD2']."</p>";
        $html .= "<input type='hidden' name='page_id' value='" . $_POST['page_id']. "' />";
        $html .= "<input type='hidden' name='status' value='yes' />";
        $html .= "</form>";

        echo $html;

    } else {

        unset($pages[$_POST['page_id']]);

        $pages = array_values($pages);

        $current_user->setPreference('pages', $pages, 0, $type);

        $queryParams = array(
            'module' => 'Home',
            'action' => 'index',
        );

        $sa = new SugarApplication();
        $sa->redirect('index.php?' . http_build_query($queryParams));

    }

}