Пример #1
0
 * License for all code of this FreePBX module can be found in the license file inside the module directory
 * Copyright 2006-2014 Schmooze Com Inc.
 */
ob_start();
$bootstrap_settings = array();
$bootstrap_settings['freepbx_auth'] = false;
//TODO: We need to make sure security is 100%!
$restrict_mods = true;
//Set to true so that we just load framework and the page wont bomb out because we have no session
if (!@(include_once getenv('FREEPBX_CONF') ? getenv('FREEPBX_CONF') : '/etc/freepbx.conf')) {
    include_once '/etc/asterisk/freepbx.conf';
}
$lang = function_exists('set_language') ? set_language() : 'en_US';
include dirname(__FILE__) . '/includes/bootstrap.php';
try {
    $ucp = \UCP\UCP::create();
    $ucp->Modgettext->textdomain("ucp");
} catch (\Exception $e) {
    if (isset($_REQUEST['quietmode'])) {
        echo json_encode(array("status" => false, "message" => "UCP is disabled"));
    } else {
        echo "<html><head><title>UCP</title></head><body style='background-color: rgb(211, 234, 255);'><div style='border-radius: 5px;border: 1px solid black;text-align: center;padding: 5px;width: 90%;margin: auto;left: 0px;right: 0px;background-color: rgba(53, 77, 255, 0.18);'>" . _('UCP is currently disabled. Please talk to your system Administrator') . "</div></body></html>";
    }
    die;
}
ob_end_clean();
$user = $ucp->User->getUser();
if (isset($_REQUEST['logout']) && $user) {
    $ucp->User->logout();
    $user = $ucp->User->getUser();
}
Пример #2
0
 public function refreshAssets()
 {
     include dirname(__FILE__) . '/htdocs/includes/bootstrap.php';
     $ucp = \UCP\UCP::create();
     outn(_("Generating Module Scripts..."));
     $ucp->Modules->getGlobalScripts(true);
     out(_("Done"));
     outn(_("Generating Module CSS..."));
     $ucp->Modules->getGlobalLess(true);
     out(_("Done"));
     outn(_("Generating Main Scripts..."));
     $ucp->getLess(true);
     out(_("Done"));
     outn(_("Generating Main CSS..."));
     $ucp->getScripts(true);
     out(_("Done"));
     exec("amportal chown");
 }
Пример #3
0
 public function refreshAssets()
 {
     if (!class_exists('UCP\\UCP', false)) {
         include dirname(__FILE__) . '/htdocs/includes/bootstrap.php';
     }
     $ucp = \UCP\UCP::create();
     outn(_("Generating Module Scripts..."));
     $ucp->Modules->getGlobalScripts(true);
     out(_("Done"));
     outn(_("Generating Module CSS..."));
     $ucp->Modules->getGlobalLess(true);
     out(_("Done"));
     outn(_("Generating Main Scripts..."));
     $ucp->getLess(true);
     out(_("Done"));
     outn(_("Generating Main CSS..."));
     $ucp->getScripts(true);
     out(_("Done"));
 }