Ejemplo n.º 1
0
function _moduleContent(&$smarty, $module_name)
{
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    $pNet = new paloNetwork();
    $arrEths = $pNet->obtener_interfases_red_fisicas();
    //actions
    $accion = getAction();
    switch ($accion) {
        case "edit_network":
            $content = editNetwork($smarty, $module_name, $local_templates_dir, $pNet);
            break;
        case "edit_interface":
            $content = editInterface($smarty, $module_name, $local_templates_dir, $pNet, $arrEths);
            break;
        case "save_network":
            $content = saveNetwork($smarty, $module_name, $local_templates_dir, $pNet);
            break;
        case "save_interface":
            $content = saveInterface($smarty, $module_name, $local_templates_dir, $pNet);
            break;
        default:
            $content = formNetwork($smarty, $module_name, $local_templates_dir, $pNet, $arrEths);
            break;
    }
    return $content;
}
Ejemplo n.º 2
0
function _moduleContent(&$smarty, $module_name)
{
    //global variables
    global $arrConf;
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //actions
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case 'save':
            $content = savePuerto($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case 'new':
        case 'view':
        case 'edit':
            $content = NewViewPuerto($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $accion);
            break;
        case 'delete':
            $content = deletePuertos($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case 'cancel':
            $content = reportPuertos($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        default:
            $content = reportPuertos($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}
Ejemplo n.º 3
0
function _moduleContent(&$smarty, $module_name)
{
    //global variables
    global $arrConf;
    //conexion resource
    $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*");
    $arrConfig = $pConfig->leer_configuracion(false);
    $dsnAsteriskCdr = $arrConfig['AMPDBENGINE']['valor'] . "://" . $arrConfig['AMPDBUSER']['valor'] . ":" . $arrConfig['AMPDBPASS']['valor'] . "@" . $arrConfig['AMPDBHOST']['valor'] . "/asteriskcdrdb";
    $pDB_cdr = new paloDB($dsnAsteriskCdr);
    //asteriskcdrdb -> CDR
    $pDB_billing = new paloDB("sqlite3:///{$arrConf['elastix_dbdir']}/rate.db");
    //sqlite3 -> rate.db
    //actions
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case 'graph':
            $content = graphLinks($smarty, $module_name, $local_templates_dir);
            break;
        case 'imageTop10Salientes':
        case 'imageTop10Entrantes':
            // The following outputs image data directly and depends on rawmode=yes
            executeImage($module_name, $accion);
            $content = '';
            break;
        default:
            $content = reportReportCall($smarty, $module_name, $local_templates_dir, $pDB_cdr, $pDB_billing, $arrConf, $arrLang);
            break;
    }
    return $content;
}
Ejemplo n.º 4
0
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoEmaillist.class.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once "{$lang_file}";
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    //conexion resource
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //actions
    $action = getAction();
    $content = "";
    switch ($action) {
        case "new_emaillist":
            $content = viewFormEmaillist($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "save_newList":
            $content = saveNewList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "new_memberlist":
        case "remove_memberlist":
            $content = viewFormMemberList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "save_newMember":
        case "save_removeMember":
            $content = saveNewMember($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "delete":
            $content = deleteEmailList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "view_memberlist":
            $content = viewMemberList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "export":
            $content = exportMembers($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        default:
            $content = reportEmailList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}
Ejemplo n.º 5
0
function _moduleContent(&$smarty, $module_name)
{
    global $arrConf;
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]);
    //user credentials
    global $arrCredentials;
    //actions
    $action = getAction();
    $content = "";
    switch ($action) {
        case "save_new":
            $content = sendNewSendFax($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case 'checkFaxStatus':
            $content = checkFaxStatus();
            break;
        default:
            // view_form
            $content = viewFormSendFax($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}
Ejemplo n.º 6
0
    function writeToLog()
    {
        global $modx;
        if ($this->entry['internalKey'] == "") {
            $this->logError("internalKey not set.");
            return;
        }
        if ($this->entry['action'] == "") {
            $this->logError("action not set.");
            return;
        }
        if ($this->entry['msg'] == "") {
            include_once "actionlist.inc.php";
            $this->entry['msg'] = getAction($this->entry['action'], $this->entry['itemId']);
            if ($this->entry['msg'] == "") {
                $this->logError("couldn't find message to write to log.");
                return;
            }
        }
        $sql = 'INSERT INTO ' . $modx->getFullTableName('manager_log') . '
			(timestamp, internalKey, username, action, itemid, itemname, message) VALUES
			(\'' . time() . '\',
			 \'' . $modx->db->escape($this->entry['internalKey']) . '\',
			 \'' . $modx->db->escape($this->entry['username']) . '\',
			 \'' . $modx->db->escape($this->entry['action']) . '\',
			 \'' . $modx->db->escape($this->entry['itemId']) . '\',
			 \'' . $modx->db->escape($this->entry['itemName']) . '\',
			 \'' . $modx->db->escape($this->entry['msg']) . '\')';
        if (!($rs = $modx->db->query($sql))) {
            $this->logError("Couldn't save log to table! " . mysql_error());
            return true;
        }
    }
Ejemplo n.º 7
0
function _moduleContent(&$smarty, $module_name)
{
    global $arrConf;
    //include framework lib form
    include_once "libs/paloSantoForm.class.php";
    //include email configuration files
    include_once "configs/email.conf.php";
    include_once "libs/cyradm.php";
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]);
    //user credentials
    global $arrCredentials;
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case "update":
            $content = updateAntispam($smarty, $module_name, $local_templates_dir, $arrConf);
            break;
        default:
            $content = formAntispam($smarty, $module_name, $local_templates_dir, $arrConf);
            break;
    }
    return $content;
}
Ejemplo n.º 8
0
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoGroupPermission.class.php";
    load_language_module($module_name);
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    //folder path for custom templates
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    //conexion resource
    $pDB = "";
    //actions
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case "apply":
            $content = applyGroupPermission($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        default:
            $content = reportGroupPermission($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}
Ejemplo n.º 9
0
function _moduleContent(&$smarty, $module_name)
{
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //actions
    $action = getAction();
    $content = "";
    switch ($action) {
        //         case "save_dhcpclient":
        //             $content = saveNewDhcpClient($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
        //             break;
        case "new_dhcpclient":
            $content = viewFormDhcpClientlist($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "see_dhcpclient":
            $content = viewFormDhcpClientlist($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
            //         case "delete_list":
            //             $content = delete_emailList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            //             break;
        //         case "delete_list":
        //             $content = delete_emailList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
        //             break;
        default:
            $content = reportDhcpClientlist($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}
Ejemplo n.º 10
0
function _moduleContent($smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once "{$lang_file}";
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    $accion = getAction();
    switch ($accion) {
        case "checkFaxStatus":
            $contenidoModulo = checkFaxStatus("faxListStatus", $smarty, $module_name, $local_templates_dir, $arrConf, $arrLang);
            break;
        default:
            $contenidoModulo = listFax($smarty, $module_name, $local_templates_dir);
            break;
    }
    return $contenidoModulo;
}
Ejemplo n.º 11
0
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoReportedeTroncalesusadasporHoraeneldia.class.php";
    include_once "libs/paloSantoConfig.class.php";
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    load_language_module($module_name);
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    //conexion resource
    $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*");
    $arrConfig = $pConfig->leer_configuracion(false);
    $dsnAsteriskCdr = $arrConfig['AMPDBENGINE']['valor'] . "://" . $arrConfig['AMPDBUSER']['valor'] . ":" . $arrConfig['AMPDBPASS']['valor'] . "@" . $arrConfig['AMPDBHOST']['valor'] . "/asterisk";
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    $pDB_asterisk = new paloDB($dsnAsteriskCdr);
    //actions
    $accion = getAction();
    $content = "";
    switch ($accion) {
        default:
            $content = reportReportedeTroncalesusadasporHoraeneldia($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $pDB_asterisk);
            break;
    }
    return $content;
}
Ejemplo n.º 12
0
function _moduleContent(&$smarty, $module_name)
{
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoReportsBreak.class.php";
    global $arrConf;
    $arrConf = array_merge($arrConf, $arrConfModule);
    // Obtengo la ruta del template a utilizar para generar el filtro.
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    load_language_module($module_name);
    // Abrir conexión a la base de datos
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    if (!is_object($pDB->conn) || $pDB->errMsg != "") {
        $smarty->assign("mb_title", _tr("Error"));
        $smarty->assign("mb_message", _tr("Error when connecting to database") . " " . $pDB->errMsg);
        return NULL;
    }
    // Cadenas estáticas a asignar
    $smarty->assign(array("btn_consultar" => _tr('query'), "module_name" => $module_name));
    //actions
    $action = getAction();
    $content = "";
    switch ($action) {
        default:
            $content = reportReportsBreak($smarty, $module_name, $local_templates_dir, $pDB);
            break;
    }
    return $content;
}
Ejemplo n.º 13
0
function _moduleContent(&$smarty, $module_name)
{
    global $arrConf;
    //include module files
    include_once "libs/paloSantoOrganization.class.php";
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]);
    //user credentials
    global $arrCredentials;
    //solo el susperadmin puede acceder a este modulo
    if ($arrCredentials["userlevel"] != "superadmin") {
        header("Location: index.php");
    }
    //actions
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case "apply":
            $content = applyOrgPermission($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "getSelected":
            $content = getSelected($pDB, $arrCredentials["userlevel"]);
            break;
        default:
            $content = reportOrgPermission($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
    }
    return $content;
}
Ejemplo n.º 14
0
function _moduleContent(&$smarty, $module_name)
{
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    // se conecta a la base
    $pDB = new paloDB($arrConf['elastix_dsn']['elastix']);
    $pACL = new paloACL($pDB);
    $user = isset($_SESSION['elastix_user']) ? $_SESSION['elastix_user'] : "";
    $uid = $pACL->getIdUser($user);
    //actions
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case "save":
            $content = saveThemes($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $uid);
            break;
        default:
            $content = formThemes($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $uid);
            break;
    }
    return $content;
}
Ejemplo n.º 15
0
function _moduleContent(&$smarty, $module_name)
{
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //user credentials
    $arrCredentiasls = getUserCredentials($_SESSION['elastix_user']);
    //user permissions
    global $arrPermission;
    $arrPermission = getResourceActionsByUser($arrCredentiasls['idUser'], $module_name);
    if ($arrPermission == false) {
        header("Location: index.php");
    }
    //actions
    $action = getAction();
    $content = "";
    switch ($action) {
        case "save_new":
            $content = saveApplets_Admin($module_name);
            break;
        default:
            // view_form
            $content = showApplets_Admin($module_name);
            break;
    }
    return $content;
}
Ejemplo n.º 16
0
function _moduleContent(&$smarty, $module_name)
{
    include_once "libs/paloSantoGrid.class.php";
    include_once "libs/paloSantoEmail.class.php";
    include_once "libs/paloSantoConfig.class.php";
    include_once "libs/paloSantoForm.class.php";
    include_once "libs/cyradm.php";
    include_once "configs/email.conf.php";
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once "{$lang_file}";
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    if (!empty($pDB->errMsg)) {
        echo "ERROR DE DB: {$pDB->errMsg} <br>";
    }
    $virtual_postfix = FALSE;
    // indica si se debe escribir el archivo /etc/postfix/virtual
    $content = "";
    $accion = getAction();
    switch ($accion) {
        case "submit_create_domain":
            $content = newDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
        case "save":
            $content = saveDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
        case "delete":
            $content = deleteDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang, $virtual_postfix);
            break;
        case "edit":
            $content = newDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
        case "view":
            $content = newDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
        default:
            $content = viewFormDomain($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang);
            break;
    }
    return $content;
}
Ejemplo n.º 17
0
function _moduleContent(&$smarty, $module_name)
{
    global $arrConf;
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $dsn = generarDSNSistema('asteriskuser', 'asteriskcdrdb');
    $pDB = new paloDB($dsn);
    //user credentials
    global $arrCredentials;
    $action = getAction();
    $content = "";
    switch ($action) {
        case 'delete':
            $content = deleteRecord($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case 'download':
            $content = downloadFile($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "display_record":
            $content = display_record($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        default:
            $content = reportMonitoring($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
    }
    return $content;
}
Ejemplo n.º 18
0
function _moduleContent(&$smarty, $module_name)
{
    //global variables
    global $arrConf;
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']['elastix']);
    //return array("idUser"=>$idUser,"id_organization"=>$idOrganization,"userlevel"=>$userLevel1,"domain"=>$domain);
    global $arrCredentials;
    //actions
    $accion = getAction();
    switch ($accion) {
        case 'save':
            $content = saveExtensionSettings($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case 'checkFaxStatus':
            $content = checkFaxStatus('getFaxStatus', $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case 'showSendFax':
            $content = showSendFax($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case 'sendNewFax':
            $content = sendNewFax($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case 'faxAttachmentUpload':
            $content = faxAttachmentUpload($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        default:
            $content = showExtensionSettings($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}
Ejemplo n.º 19
0
 function writeToLog()
 {
     global $modx;
     $tbl_manager_log = $modx->getFullTableName('manager_log');
     if ($this->entry['internalKey'] == "") {
         $modx->webAlertAndQuit("Logging error: internalKey not set.");
     }
     if (empty($this->entry['action'])) {
         $modx->webAlertAndQuit("Logging error: action not set.");
     }
     if ($this->entry['msg'] == "") {
         include_once "actionlist.inc.php";
         $this->entry['msg'] = getAction($this->entry['action'], $this->entry['itemId']);
         if ($this->entry['msg'] == "") {
             $modx->webAlertAndQuit("Logging error: couldn't find message to write to log.");
         }
     }
     $fields['timestamp'] = time();
     $fields['internalKey'] = $modx->db->escape($this->entry['internalKey']);
     $fields['username'] = $modx->db->escape($this->entry['username']);
     $fields['action'] = $this->entry['action'];
     $fields['itemid'] = $this->entry['itemId'];
     $fields['itemname'] = $modx->db->escape($this->entry['itemName']);
     $fields['message'] = $modx->db->escape($this->entry['msg']);
     $insert_id = $modx->db->insert($fields, $tbl_manager_log);
     if (!$insert_id) {
         $modx->messageQuit("Logging error: couldn't save log to table! Error code: " . $modx->db->getLastError());
     } else {
         $limit = isset($modx->config['manager_log_limit']) ? intval($modx->config['manager_log_limit']) : 3000;
         $trim = isset($modx->config['manager_log_trim']) ? intval($modx->config['manager_log_trim']) : 100;
         if ($insert_id % $trim === 0) {
             $modx->rotate_log('manager_log', $limit, $trim);
         }
     }
 }
Ejemplo n.º 20
0
function _moduleContent(&$smarty, $module_name)
{
    global $arrConf;
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]);
    //user credentials
    global $arrCredentials;
    $action = getAction();
    $content = "";
    switch ($action) {
        case "reloadAasterisk":
            $content = reloadAasterisk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "apply":
            $content = applyChanges($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        default:
            // view
            $content = viewGeneralSetting($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
    }
    return $content;
}
Ejemplo n.º 21
0
 function writeToLog()
 {
     global $table_prefix;
     global $dbase;
     if ($this->internalKey == "") {
         $this->logError("internalKey not set.");
         return;
     }
     if ($this->action == "") {
         $this->logError("action not set.");
         return;
     }
     if ($this->msg == "") {
         include_once "actionlist.inc.php";
         $this->msg = getAction($this->action, $this->itemId);
         if ($this->msg == "") {
             $this->logError("couldn't find message to write to log.");
             return;
         }
     }
     $sql = "INSERT INTO {$dbase}." . $table_prefix . "manager_log(timestamp, internalKey, username, action, itemid, itemname, message) VALUES('" . time() . "', '" . $this->internalKey . "', '" . $this->username . "'";
     $sql .= ", '" . $this->action . "', '" . $this->itemId . "', '" . $this->itemName . "', '" . $this->msg . "')";
     if (!($rs = mysql_query($sql))) {
         $this->logError("couldn't save log to table!");
         return true;
     }
 }
Ejemplo n.º 22
0
function _moduleContent(&$smarty, $module_name)
{
    global $arrConf;
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]);
    //user credentials
    global $arrCredentials;
    $action = getAction();
    $content = "";
    switch ($action) {
        case "new_conference":
            $content = viewFormConference($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "view":
            $content = viewFormConference($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "view_edit":
            $content = viewFormConference($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "save_new":
            $content = saveNewConference($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "save_edit":
            $content = saveEditConference($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "delete":
            $content = deleteConference($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "getConferenceMemb":
            $content = conferenceStatus($smarty, $pDB, $module_name, $arrCredentials);
            break;
        case "inviteCaller":
            $content = inviteCaller($smarty, $pDB, $module_name, $arrCredentials);
            break;
        case "muteCallers":
            $content = muteCallers($smarty, $pDB, $module_name, $arrCredentials);
            break;
        case "kickCallers":
            $content = kickCallers($smarty, $pDB, $module_name, $arrCredentials);
            break;
        case "showCallers":
            $content = showCallers($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "updateShowCallers":
            $content = statusShowCallers($smarty, $pDB, $module_name, $arrCredentials, "updateShowCallers");
            break;
        case "reloadAasterisk":
            $content = reloadAasterisk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        default:
            // report
            $content = reportConference($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
    }
    return $content;
}
Ejemplo n.º 23
0
function _moduleContent(&$smarty, $module_name)
{
    //global variables
    global $arrConf;
    global $arrConfModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    $action = getAction();
    $content = "";
    switch ($action) {
        case "config_echol":
            $content = viewFormConfEchoCard($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            // para configurar echo canceler
            break;
        case "config_echo":
            $content = viewFormConfEchoCardParam($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            // para configurar echo canceler
            break;
        case 'config_span':
            $content = viewFormConfSpan($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            // para configurar span
            break;
        case 'config_param':
            $content = viewFormConfSpanParam($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            // para configurar span
            break;
        case "save_new":
            $content = saveNewConfEchoCard($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            // save conf echo canceler
            break;
        case "save_span":
            $content = saveNewConfSpan($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            // save conf span
            break;
            /*
                    case "setConfig":
                        $content = setConfigHardware($pDB); 
                        break;
            */
        /*
                case "setConfig":
                    $content = setConfigHardware($pDB); 
                    break;
        */
        case "detection":
            $content = hardwareDetect($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            // detection button
            break;
        default:
            $content = listPorts($smarty, $module_name, $local_templates_dir, $pDB);
            break;
    }
    return $content;
}
Ejemplo n.º 24
0
function _moduleContent(&$smarty, $module_name)
{
    include_once "libs/paloSantoGrid.class.php";
    include_once "libs/paloSantoForm.class.php";
    include_once "libs/paloSantoOrganization.class.php";
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]);
    global $arrCredentials;
    $action = getAction();
    $content = "";
    switch ($action) {
        case "new_user":
            $content = viewFormUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "view":
            $content = viewFormUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "edit":
            $content = viewFormUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "save_new":
            $content = saveNewUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "save_edit":
            $content = saveEditUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "delete":
            $content = deleteUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "getGroups":
            $content = getGroups($pDB, $arrCredentials);
            break;
        case "getImage":
            $content = getImage($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "reloadAasterisk":
            $content = reloadAasterisk($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "reconstruct_mailbox":
            $content = reconstruct_mailbox($pDB, $arrConf, $arrCredentials);
            break;
            /*case "changes_email_quota":
              $content = changes_email_quota($smarty, $module_name, $pDB, $arrConf, $arrCredentials);
              break;*/
        /*case "changes_email_quota":
          $content = changes_email_quota($smarty, $module_name, $pDB, $arrConf, $arrCredentials);
          break;*/
        default:
            // report
            $content = reportUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
    }
    return $content;
}
Ejemplo n.º 25
0
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoMyExtension.class.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once "{$lang_file}";
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    //conexion resource
    $arrConf['dsn_conn_database'] = generarDSNSistema('asteriskuser', 'asterisk');
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    $pDBACL = new paloDB($arrConf['elastix_dsn']['acl']);
    $pACL = new paloACL($pDBACL);
    $user = isset($_SESSION['elastix_user']) ? $_SESSION['elastix_user'] : "";
    $extension = $pACL->getUserExtension($user);
    $isAdministrator = $pACL->isUserAdministratorGroup($user);
    if ($extension == "" || is_null($extension)) {
        if ($isAdministrator) {
            $smarty->assign("mb_message", "<b>" . $arrLang["no_extension"] . "</b>");
        } else {
            $smarty->assign("mb_message", "<b>" . $arrLang["contact_admin"] . "</b>");
        }
        return "";
    }
    //actions
    $action = getAction();
    $content = "";
    switch ($action) {
        case "save_new":
            $content = saveNewMyExtension($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang, $extension, $isAdministrator);
            break;
        default:
            // view_form
            $content = viewFormMyExtension($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrLang, $extension);
            break;
    }
    return $content;
}
Ejemplo n.º 26
0
function _moduleContent(&$smarty, $module_name)
{
    //include elastix framework
    include_once "libs/paloSantoGrid.class.php";
    include_once "libs/paloSantoForm.class.php";
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoLanguageAdmin.class.php";
    //include lang local module
    $lang = get_language();
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once $lang_file;
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    global $arrConf;
    global $arrLang;
    global $arrLangModule;
    //folder path for custom templates
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $templates_dir = isset($arrConfig['templates_dir']) ? $arrConfig['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    $accion = getAction();
    $content = "";
    $arrFormConference = createFieldForm($arrLangModule);
    $oForm = new paloForm($smarty, $arrFormConference);
    switch ($accion) {
        case "show":
            $_POST['nav'] = null;
            $_POST['start'] = null;
            $content = showLanguages($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule);
            break;
        case "new":
            $content = newLanguage($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule);
            break;
        case "save_language":
            $content = saveLanguage($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule, $oForm);
            break;
        case "cancel_language":
            $content = showLanguages($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule);
            break;
        case "save_all":
            $content = saveAll($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule, $oForm);
            break;
        default:
            //report_Languages
            $content = showLanguages($smarty, $module_name, $local_templates_dir, $arrLang, $arrLangModule);
            break;
    }
    return $content;
}
Ejemplo n.º 27
0
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoReportCall.class.php";
    include_once "libs/paloSantoConfig.class.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once "{$lang_file}";
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    //conexion resource
    $pConfig = new paloConfig("/etc", "amportal.conf", "=", "[[:space:]]*=[[:space:]]*");
    $arrConfig = $pConfig->leer_configuracion(false);
    $dsnAsteriskCdr = $arrConfig['AMPDBENGINE']['valor'] . "://" . $arrConfig['AMPDBUSER']['valor'] . ":" . $arrConfig['AMPDBPASS']['valor'] . "@" . $arrConfig['AMPDBHOST']['valor'] . "/asteriskcdrdb";
    $pDB_cdr = new paloDB($dsnAsteriskCdr);
    //asteriskcdrdb -> CDR
    $pDB_billing = new paloDB("sqlite3:///{$arrConf['elastix_dbdir']}/rate.db");
    //sqlite3 -> rate.db
    //actions
    $accion = getAction();
    $content = "";
    switch ($accion) {
        case 'graph':
            $content = graphLinks($smarty, $module_name, $local_templates_dir);
            break;
        case 'imageTop10Salientes':
        case 'imageTop10Entrantes':
            // The following outputs image data directly and depends on rawmode=yes
            executeImage($module_name, $accion);
            $content = '';
            break;
        default:
            $content = reportReportCall($smarty, $module_name, $local_templates_dir, $pDB_cdr, $pDB_billing, $arrConf, $arrLang);
            break;
    }
    return $content;
}
Ejemplo n.º 28
0
function _moduleContent(&$smarty, $module_name)
{
    global $arrConf;
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]);
    //user credentials
    global $arrCredentials;
    //actions
    $action = getAction();
    $content = "";
    switch ($action) {
        case "view_list":
            $content = viewFormEmaillist($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "new_emaillist":
            $content = viewFormEmaillist($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "save_newList":
            $content = saveNewList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "mailman_settings":
            $content = viewFormEmaillist($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "saveMailmanSettings":
            $content = saveMailmanSettings($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "delete":
            $content = deleteEmailList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "export":
            $content = exportMembers($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "view_memberlist":
            $content = reportMemberList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "new_memberlist":
            $content = viewFormMemberList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "save_newMember":
            $content = saveNewMember($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        case "remove_memberlist":
            $content = removeMemberList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
        default:
            $content = reportEmailList($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentials);
            break;
    }
    return $content;
}
Ejemplo n.º 29
0
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoOverall_setting.class.php";
    require_once "modules/{$module_name}/libs/JSON.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once "{$lang_file}";
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    //conexion resource
    $pDB = new paloDB($arrConf['cadena_dsn']);
    $pACL = new paloACL($arrConf['elastix_dsn']['acl']);
    //actions
    $action = getAction();
    switch ($action) {
        case "update":
            $content = updateNotification($pDB);
            break;
        case 'refresh':
            $content = refreshNotification($pDB);
            break;
        case "update_rate":
            $content = updateRate($pDB, $pACL);
            break;
        case 'refresh_rate':
            $content = refreshRate($pDB, $pACL);
            break;
        default:
            // view_form
            $content = viewFormOverall_setting($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}
Ejemplo n.º 30
0
function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoRegestion.class.php";
    include_once "modules/{$module_name}/libs/paloSantoCrearcampania.class.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once "{$lang_file}";
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    //conexion resource
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //actions
    $action = getAction();
    $content = "";
    switch ($action) {
        // Ver form con información de la campaña padre para proceder a armar la regestión
        case 'view_edit':
            $content = viewFormCrearcampaña($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf);
            break;
            // Grabar la regestión
        // Grabar la regestión
        case 'save_edit':
        case 'save_new':
            saveNewRegestion($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            $content = reportRegestion($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
            // Reporte de campañas padres
        // Reporte de campañas padres
        default:
            $content = reportRegestion($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}