Ejemplo n.º 1
0
<?php

#OOB/N1 Framework [2008 - Nutus] - PM
// CODIGO POR JPCOSEANI
// Script que genera el FORM LISTADO DE PERMISOS
if (!seguridad::isAllowed(seguridad_action::nameConstructor('list', 'impuesto', 'impuestos'))) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!", true);
}
//LIBRERIAS
PhpExt_Javascript::sendContentType();
global $ari;
$ari->popup = 1;
// no mostrar el main_frame
$page_size = PAGE_SIZE;
//STORE PARA TRAER LOS DATOS
$store = new PhpExt_Data_JsonStore();
$store->setUrl("/seguridad/permission/get_permissions")->setRoot("topics")->setTotalProperty("totalCount");
//DEFINICION DE LOS CAMPOS DEL STORE
$store->addField(new PhpExt_Data_FieldConfigObject("id"));
$store->addField(new PhpExt_Data_FieldConfigObject("nombre"));
$store->addField(new PhpExt_Data_FieldConfigObject("descripcion"));
$store->addField(new PhpExt_Data_FieldConfigObject("modulo"));
$store->addField(new PhpExt_Data_FieldConfigObject("contacto"));
$store->addField(new PhpExt_Data_FieldConfigObject("sucursal::nombre"));
$store->addField(new PhpExt_Data_FieldConfigObject("sucursal"));
$filter_plugin = new PhpExtUx_Grid_GridFilters();
$filter_plugin->addFilter(PhpExt_Grid_FilterConfigObject::createFilter("numeric", "id"));
$filter_plugin->addFilter(PhpExt_Grid_FilterConfigObject::createFilter("string", "nombre"));
$filter_plugin->addFilter(PhpExt_Grid_FilterConfigObject::createFilter("string", "contacto::apellido"));
$filter_plugin->addFilter(PhpExt_Grid_FilterConfigObject::createFilter("string", "sucursal::nombre"));
$paging = new PhpExt_Toolbar_PagingToolbar();
Ejemplo n.º 2
0
<?php

/**
########################################
#OOB/N1 Framework [©2004,2006]
#
#  @copyright Pablo Micolini
#  @license BSD
######################################## 
*/
if (!seguridad::isAllowed(seguridad_action::nameConstructor('phpinfo', 'info', 'about'))) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!", true);
}
global $ari;
$ari->popup = 1;
// no mostrar el main_frame
ob_start();
phpinfo();
preg_match('%<style type="text/css">(.*?)</style>.*?(<body>.*</body>)%s', ob_get_clean(), $matches);
//esto para sacar los estilos del body
echo "<br/><div class='phpinfodisplay'><style type='text/css'>\n", join("\n", array_map(create_function('$i', 'return ".phpinfodisplay " . preg_replace( "/,/", ",.phpinfodisplay ", $i );'), preg_split('/\\n/', $matches[1]))), "</style>\n", $matches[2], "\n</div>\n";
$ari->t->display($ari->module->admintpldir() . "/phpinfo.tpl");
Ejemplo n.º 3
0
<?php

#OOB/N1 Framework [�2004,2005 - Nutus]
/*
 * Created on 22-jun-2005
 * @author Victor Stornati (victor.stornati@nutus.com.ar)
 */
if (!seguridad::isAllowed(seguridad_action::nameConstructor('perspectives', 'config', 'admin'))) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!", true);
}
// get perspectives
global $ari;
$handle = $ari->url->getVars();
$ari->t->caching = 0;
// dynamic content
//// check the delete selector, and delete if selected
if (isset($_POST['delete_submit']) && isset($_POST['selected_perspectives'])) {
    foreach ($_POST['selected_perspectives'] as $name_perspective) {
        //		$perspective = new seguridad_perspective($name_perspective);
        //		$perspective->delete();
    }
}
// finally get the data
$return = array();
if ($perspectivas = oob_perspective::listPerspectives()) {
    // show time
    $i = 0;
    foreach ($perspectivas as $p) {
        $return[$i]['name'] = $p;
        $return[$i]['path'] = $ari->get('filesdir') . DIRECTORY_SEPARATOR . 'perspectives' . DIRECTORY_SEPARATOR . $p;
        $return[$i]['path2'] = str_replace(DIRECTORY_SEPARATOR, "/", $return[$i]['path']);
Ejemplo n.º 4
0
<?php

/**
########################################
#OOB/N1 Framework [©2004,2006]
#
#  @copyright Pablo Micolini
#  @license BSD
######################################## 
*/
OOB_module::includeClass('seguridad', 'seguridad_permission');
if (!seguridad::isAllowed(seguridad_action::nameConstructor('new', 'permission', 'seguridad'))) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!", true);
}
global $ari;
$ari->t->assign("form", true);
$sp = new oob_safepost("form");
$modSelect = '';
$arrModulo = array();
$arrIdModulo = array();
if ($objModulo = OOB_module::listModules()) {
    foreach ($objModulo as $m) {
        $arrModulo[] = $m->nicename();
        $arrIdModulo[] = $m->name();
        if (isset($_POST['cboModulo'])) {
            //echo $_POST['cboModulo']."<br>";
            if ($_POST['cboModulo'] == $m->name()) {
                $modSelect = $m->name();
            }
        }
    }
Ejemplo n.º 5
0
<?php

#OOB/N1 Framework [2008 - Nutus] - PM
// Código por JPCOSEANI
// SCRIPT QUE GENERA EL FORM LISTADO DE MODULOS
if (!seguridad::isAllowed(seguridad_action::nameConstructor('update', 'user', 'seguridad'))) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!", true);
}
PhpExt_Javascript::sendContentType();
global $ari;
$ari->popup = 1;
// no mostrar el main_frame
//STORE PARA TRAER EL LISTADO DE MODULOS
$store = new PhpExt_Data_JsonStore();
$store->setUrl("/admin/module/get_modules")->setRoot("topics")->setAutoLoad(true)->setTotalProperty("totalCount");
//AGREGO LOS CAMPOS AL STORE
$store->addField(new PhpExt_Data_FieldConfigObject("nicename"));
$store->addField(new PhpExt_Data_FieldConfigObject("modulename"));
$store->addField(new PhpExt_Data_FieldConfigObject("description"));
$store->addField(new PhpExt_Data_FieldConfigObject("checked"));
$store->addField(new PhpExt_Data_FieldConfigObject("optional"));
//CHECKBOX PARA SELECCIONAR LOS MODULOS
$checkColumn = new PhpExtUx_Grid_CheckColumn("Habilitado");
$checkColumn->setDataIndex("checked")->setId("check")->setWidth(55);
//AGREGO LAS COLUMNAS A LA GRILLA
$col_model = new PhpExt_Grid_ColumnModel();
$col_model->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Nombre del M&oacute;dulo", "nicename", null, 150));
$col_model->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Descripci&oacute;n", "description", null, 340));
$col_model->addColumn($checkColumn);
//GRILLA
$grid = new PhpExt_Grid_GridPanel();
Ejemplo n.º 6
0
<?php

#OOB/N1 Framework [�2004,2005 - Nutus]
/*
 * Created on 22-jun-2005
 * @author Victor Stornati (victor.stornati@nutus.com.ar)
 */
global $ari;
$ari->t->caching = 0;
// dynamic content
if (!seguridad::isAllowed(seguridad_action::nameConstructor('cache', 'config', 'admin'))) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!", true);
}
$delete = false;
if (isset($_POST['delete_button'])) {
    $delete = true;
    $ari->clearCache();
}
$ari->t->assign("delete", $delete);
//display
$ari->t->display($ari->module->admintpldir() . "/cache.tpl");
Ejemplo n.º 7
0
 /** metodo privado que hace la busqueda de permiso en el arbol */
 private static function isObjectAllowedByInheritance($action, &$currentUserRoles, &$tree)
 {
     if (!is_array($tree)) {
         return false;
     }
     $tree = array_reverse($tree);
     foreach ($tree as $elemento) {
         // veamos q no tenga permisos propios, y si tiene cortamos ahi
         if ($roles = seguridad_role::listRoles(USED, 'name', OPERATOR_EQUAL)) {
             $arrayRoles = array();
             foreach ($roles as $r) {
                 //verifico si tiene permiso de ver
                 if (seguridad::getObjectPermission($action, $r, $elemento->object())) {
                     $arrayRoles[] = true;
                 }
             }
         }
         //end if reload de seguridad
         if (seguridad::getPermissionForAnyObject($action, $currentUserRoles, $elemento->object())) {
             return true;
         } else {
             if (count($arrayRoles) > 0) {
                 return false;
             }
         }
     }
     return false;
 }
Ejemplo n.º 8
0
<?php

global $ari;
$ari->t->force_compile = true;
$ari->t->cache = false;
$ct = new OOB_cleantext();
$limit = 20;
if (!isset($_GET['pos']) || !oob_validatetext::isNumeric($_GET['pos'])) {
    $_GET['pos'] = 0;
}
// check user permissions
if (is_a($ari->user, 'oob_user')) {
    $usuario = $ari->user;
    // asignamos datos del usuario
    if ($perfil_existente = perfil_perfil::existe_usuario($ari->user)) {
        $perfil = $perfil_existente[0];
    }
} else {
    seguridad::requireLogin();
}
// mostramos los datos en la pantalla
$ari->t->assign("nombre", $perfil->name());
$ari->t->assign("telefono", $ct->dropHTML($perfil->get('telefono')));
$ari->t->assign("bio", $ct->dropHTML($perfil->get('bio')));
$ari->t->assign("url", $ct->dropHTML($perfil->get('url')));
$ari->t->assign("foto", $perfil->foto());
$ari->t->assign("mensajes", perfil_mensaje::get_actualizaciones_usuario($_GET['pos']));
$ari->t->assign("mensajes_count", perfil_mensaje::get_actualizaciones_usuario_count());
$ari->t->assign("limit", $limit);
$ari->t->display($ari->module->usertpldir() . DIRECTORY_SEPARATOR . "perfil_actualizaciones.tpl");
Ejemplo n.º 9
0
<?php

/**
########################################
#OOB/N1 Framework [©2004,2006]
#
#  @copyright Pablo Micolini
#  @license BSD
######################################## 
*/
global $ari;
seguridad::RequireLogin();
$ari->t->caching = false;
$usuario = $ari->user;
$ari->t->assign("user", $usuario);
// no butto get, standard action
if (!isset($_POST['update'])) {
    $ari->t->assign("error", false);
    $ari->t->assign("uname", $usuario->get("uname"));
    $ari->t->assign("id", $usuario->id());
    $ari->t->assign("email", $usuario->get("email"));
    $ari->t->display($ari->module->usertpldir() . "/update.tpl");
} else {
    // $usuario->set ('uname', $_POST['uname']);
    if ($_POST['pass'] != "" && $_POST['passtwo'] != "") {
        $usuario->set('password', $_POST['pass']);
    }
    $usuario->set('email', $_POST['email']);
    // stores?
    if ($_POST['pass'] === $_POST['passtwo']) {
        if ($usuario->store()) {
Ejemplo n.º 10
0
<?php

#OOB/N1 Framework [2008 - Nutus] - PM
// Código por JPCOSEANI
// Script que genera el FORM NUEVO ROL
if (!seguridad::isAllowed(seguridad_action::nameConstructor('new', 'role', 'seguridad'))) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!", true);
}
PhpExt_Javascript::sendContentType();
global $ari;
$ari->popup = 1;
// no mostrar el main_frame
$field_width = 180;
//ancho de los controles
$grid_id = '';
if (isset($_POST['gid'])) {
    $grid_id = $_POST['gid'];
}
//creacion de controles
$txt_nombre = PhpExt_Form_TextField::createTextField("txt_nombre", "Nombre")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
$txt_descripcion = PhpExt_Form_TextArea::createTextArea("txt_descripcion", "Descripci&oacute;n")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
$chk_anonimo = PhpExt_Form_Checkbox::createCheckbox("chk_anonimo", "An&oacute;nimo")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
$chk_confiados = PhpExt_Form_Checkbox::createCheckbox("chk_confiados", "Confiado")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
//Boton grabar OnClick
$handler_grabar = " \nfunction(){\nthis.findParentByType('form').getForm().submit(\n\t{    \t       \n\t\t\t\t\t\t reset : true,\n\t\t\t\t\t   waitMsg : 'Enviando Datos',\n\t\t\t\t\t waitTitle : 'Emporika',\t\t\t\t   \n\t\t\t   grid_reload_id  : '{$grid_id}',\n\t\t\t\t   new_tab_dir : '/seguridad/role/update',\n\t\t\t\t new_tab_title : 'Modificar Rol',\n  new_tab_pass_response_params : { id : 'id'},  \n\t\t\t\t load_tab_here : true\t   \n\t}\n\t\n\t);\t\t\t\t\n\t\n}";
$btn_grabar = PhpExt_Button::createTextButton("Grabar", new PhpExt_JavascriptStm($handler_grabar));
//Data_Reader para leer los resultados devueltos
$error_reader = new PhpExt_Data_JsonReader();
$error_reader->setRoot("errors");
$error_reader->setSuccessProperty("success");
$error_reader->addField(new PhpExt_Data_FieldConfigObject("id"));
Ejemplo n.º 11
0
<?php

/* Nutus, Todos los derechos reservados 2005
 * Creado: 28-nov-2005
 *
 */
if (!seguridad::isAllowed(seguridad_action::nameConstructor('selectforemployee', 'user', 'seguridad'))) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!", true);
}
global $ari;
$handle = $ari->url->getVars();
$ari->t->caching = 0;
$ari->popup = true;
// valida pos
$pos = 0;
if (isset($_GET['pos']) && OOB_validatetext::isNumeric($_GET['pos']) && $_GET['pos'] > 0) {
    $pos = $_GET['pos'];
}
//levanta el limit
$modulo = new oob_module("personnel");
$limit = $modulo->config()->get('limit', 'employee');
$ari->t->assign('limit', $limit);
$ari->t->assign('total', oob_user::userCountNoAsigned());
$users = array();
if ($return = oob_user::listNoAssigned('uname', $pos, $limit)) {
    // show time
    $i = 0;
    foreach ($return as $u) {
        $users[$i]['id'] = $u->get('user');
        $users[$i]['uname'] = $u->name();
        $users[$i]['unameClean'] = OOB_validatetext::cleanToScript($u->name());
Ejemplo n.º 12
0
<?php

# Nutus [2006 - Nutus, Todos los derechos reservados]
/*
 * Created on 13/08/2005
 * @author Flavio Robles (flavio.robles@nutus.com.ar)
 */
if (!seguridad::isAllowed(seguridad_action::nameConstructor('union', 'state', 'address'))) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!", true);
}
global $ari;
$ari->t->caching = false;
$ari->t->assign("error", false);
$handle = $ari->url->getVars();
//selector de pais
if ($countries = address_country::listCountries(USED, 'name', OPERATOR_EQUAL)) {
    foreach ($countries as $c) {
        $array_countries[$c->get('id')] = $c->get('name');
    }
}
$ari->t->assign("countries", $array_countries);
//ciudades
if ($cities = address_city::listCitiesByStates()) {
    // show time
    $i = 0;
    foreach ($cities as $s) {
        $array_cities[$i]['id'] = $s->get('id');
        $array_cities[$i]['name'] = $s->get('name');
        $array_cities[$i]['stateName'] = $s->get('state')->get("name");
        $array_cities[$i]['countryName'] = $s->get('state')->get("country")->get("name");
        //verifico origenes seleccionados
Ejemplo n.º 13
0
<?php

#OOB/N1 Framework [2008 - Nutus] - PM
// Código por JPCOSEANI
// Script que genera el FORM NUEVA MONEDA
if (!seguridad::isAllowed(seguridad_action::nameConstructor('new', 'currency', 'currency'))) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!", true);
}
PhpExt_Javascript::sendContentType();
include_once 'PhpExtUx/Multiselect/Itemselector.php';
global $ari;
$ari->popup = 1;
// no mostrar el main_frame
$field_width = 180;
//ancho de los controles
$separador_decimal = trim($ari->locale->get('decimal', 'numbers'));
$grid_id = '';
if (isset($_POST['gid'])) {
    $grid_id = $_POST['gid'];
}
//CREACION DE LOS CONTROLES
//MONEDA
$txt_moneda = PhpExt_Form_TextField::createTextField("txt_moneda", "Moneda")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
//SIGNO
$txt_signo = PhpExt_Form_TextField::createTextField("txt_signo", "Signo")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width);
//TIPO DE CAMBIO
$opt_tipo_fijo = new PhpExt_Form_Radio();
$opt_tipo_fijo->setBoxLabel("Fijo")->setValue("fixed")->setName("opt-tipo-cambio");
$opt_tipo_flotante = new PhpExt_Form_Radio();
$opt_tipo_flotante->setBoxLabel("Flotante")->setValue("float")->setName("opt-tipo-cambio");
$opt_tipo_flotante->setChecked(true);
Ejemplo n.º 14
0
<?php

# Eumafes v2 [�2005 - Nutus, Todos los derechos reservados]
/*
 * Created on 04-ago-2005
 * @author Victor Stornati (victor.stornati@nutus.com.ar)
 */
OOB_module::includeClass('currency', 'currency_currency');
if (!seguridad::isAllowed(seguridad_action::nameConstructor('view', 'currency', 'currency')) && !seguridad::RequireLogin()) {
    throw new OOB_exception("Acceso Denegado", "403", "Acceso Denegado. Consulte con su Administrador!");
}
global $ari;
$handle = $ari->url->getVars();
$ari->t->caching = 0;
// dynamic content
$sp = new oob_safepost("view");
$ari->t->assign("mostrar", false);
//------ Refrescar valores ------
//fecha desde
if (!isset($_POST['desdeCheck'])) {
    $ari->t->assign("desdeChecked", '');
    //fecha desde
    if (isset($_POST['desdeYear']) && isset($_POST['desdeMonth']) && isset($_POST['desdeDay'])) {
        //begin if
        $ari->t->assign("desde", $_POST['desdeYear'] . "-" . $_POST['desdeMonth'] . "-" . $_POST['desdeDay']);
        $ari->t->assign("desdeDisabled", "");
    }
} else {
    $ari->t->assign("desdeChecked", 'checked');
    $ari->t->assign("desdeDisabled", "disabled");
}
Ejemplo n.º 15
0
 /** returns the module admin menu */
 public function adminMenu()
 {
     global $ari;
     if ($ari->get('user') == false || is_a($ari->module, 'OOB_module') == false) {
         return false;
     }
     $menu = "";
     $array_menu = array();
     // loads localized array
     @(include $this->admindir() . DIRECTORY_SEPARATOR . 'menu' . DIRECTORY_SEPARATOR . $ari->agent->getLang() . '.php');
     // cache del menu para cada modulo en cada usuario
     // Set a id for this cache
     $id = 'menu__' . $ari->agent->getLang() . '__' . $ari->user->get('user') . '-' . $this->name() . '.php';
     //Set cache options
     $options = array('cacheDir' => $ari->cachedir . DIRECTORY_SEPARATOR, 'lifeTime' => SQL_CACHE, 'fileNameProtection' => false, 'automaticSerialization' => true);
     // Create a Cache_Lite object
     $Cache_Lite = new Cache_Lite($options);
     // Test if thereis a valide cache for this id
     if ($menu = $Cache_Lite->get($id)) {
         return $menu;
     } else {
         // No valid cache found
         if ($permissions = seguridad_permission::listPermissionsFor($this)) {
             $menu = array();
             $i = 0;
             foreach ($permissions as $p) {
                 if ($actions = seguridad_action::listActionsFor($p, IN_MENU)) {
                     foreach ($actions as $a) {
                         if (seguridad::isAllowed($a, $ari->perspective)) {
                             if (!count($array_menu) == 0) {
                                 $menu[$i]['name'] = $array_menu[$p->get("name") . $a->get("name")];
                             } else {
                                 $menu[$i]['name'] = $a->get("nicename");
                             }
                             $menu[$i]['link'] = $this->name() . "/" . $p->get("name") . "/" . $a->get("name");
                             $i++;
                         }
                     }
                     //end foreach $actions
                 }
             }
             //end foreach $permissions
         }
         if (count($menu) == 0) {
             $menu = false;
         }
         $Cache_Lite->save($menu);
         return $menu;
     }
     // end cache
 }