/** extract the url data that is within slashes. */ public function __construct($newurl = false) { global $ari; // mode name differs from real file name in user mode $mode = 'index'; if ($ari->mode == 'admin') { $mode = 'admin'; } if (!$newurl) { // IIS not providing REQUEST_URI if (!isset($_SERVER['REQUEST_URI'])) { $this->realuri = substr($_SERVER['argv'][0], strpos($_SERVER['argv'][0], ';') + 1); } else { $this->realuri = $_SERVER['REQUEST_URI']; } $script = $_SERVER['SCRIPT_NAME']; /* remove all the stuff that is before the vars*/ if (strstr($this->realuri, $mode . '.php')) { $uri = explode(".php", $this->realuri); $newuri = $uri[1]; } else { // no me queda mas que pensar que tiene el mod-rewrite bien andando :P $newuri = $this->realuri; } } else { $newuri = $newurl; } // extract the trailing stuff with the "?" $newuri = explode("?", $newuri); $this->uri = $newuri[0]; // extracts the trailing slash.. avoids misinterpretation if (substr($this->uri, -1) == '/') { $this->uri = substr($this->uri, 0, strlen($this->uri) - 1); } // explode the uri $exp = explode("/", $this->uri); $vacio = array_shift($exp); // first is always empty if (count($exp) > 0) { if (in_array($exp[0], OOB_perspective::listPerspectives()) && $mode == 'index') { $this->perspective = array_shift($exp); // $this->module = array_shift($exp); } //else // { $this->module = array_shift($exp); // } $this->vars = $exp; } }
//SE AGREGAN LOS ROLES QUE PASARON A SER MIEMBROS for ($i = 0; $i < count($miebros_roles); $i++) { if (!in_array($miebros_roles[$i], $real_members_roles)) { $tmpRole = new seguridad_role($miebros_roles[$i]); $perspective->addRole($tmpRole); } } } //*****************************FIN ACTUALIZACION ROLES************************************************* //*****************************ACTUALIZAR MODULOS (MIEMBROS Y NO MIEMBROS)***************************** if (isset($_POST['modulos'])) { //SE CREA UN ARRAY CON LOS MODULOS MIEMBROS DEVUELTOS POR EL CONTROL 'SELECT' $miebros_modulos = split(",", $_POST['modulos']); $real_members_modules = array(); //SE CREA UN ARRAY CON LOS MODULOS MIEMBROS QUE ESTAN EN LA BASE DE DATOS if ($modules = OOB_perspective::listModulesFor($perspective)) { foreach ($modules as $m) { $real_members_modules[] = $m->name(); } } //SE ELIMINAN LOS MODULOS QUE YA NO SON MIEMBROS for ($i = 0; $i < count($real_members_modules); $i++) { if (!in_array($real_members_modules[$i], $miebros_modulos)) { $tmpModule = new OOB_module($real_members_modules[$i]); $perspective->removeModule($tmpModule); } } //SE AGREGAN LOS MODULOS QUE PASARON A SER MIEMBROS for ($i = 0; $i < count($miebros_modulos); $i++) { if (!in_array($miebros_modulos[$i], $real_members_modules)) { $tmpModule = new OOB_module($miebros_modulos[$i]);
<?php global $ari; $ari->popup = 1; // no mostrar el main_frame if (isset($_POST['id'])) { $perspective = new oob_perspective($_POST['id']); $i = 0; if ($roles = OOB_perspective::searchNoMembers("", DELETED, OPERATOR_DISTINCT, $perspective, ROLE)) { $return = array(); foreach ($roles as $r) { $return[$i]['id'] = $r->get('role'); $return[$i]['name'] = $r->get('name'); ++$i; } } //end if $result = array(); $result["totalCount"] = $i; $result["topics"] = $return; //RESULTADO $obj_comunication = new OOB_ext_comunication(); $obj_comunication->set_data($result); $obj_comunication->send(true, true); } else { throw new OOB_Exception_400("La variable [id] no esta definida"); }
<?php global $ari; $ari->popup = 1; // no mostrar el main_frame if (isset($_POST['id'])) { $perspective = new oob_perspective($_POST['id']); $i = 0; if ($modules = OOB_perspective::searchNoMembers("", DELETED, OPERATOR_DISTINCT, $perspective, MODULE)) { foreach ($modules as $m) { $return[$i]['id'] = $m->name(); $return[$i]['name'] = $m->nicename(); ++$i; } } $result = array(); $result["totalCount"] = $i; $result["topics"] = $return; //RESULTADO $obj_comunication = new OOB_ext_comunication(); $obj_comunication->set_data($result); $obj_comunication->send(true, true); } else { throw new OOB_Exception_400("La variable [id] no esta definida"); }
//Adds the selected modules if (isset($_POST['AddModule']) && isset($_POST['modules_select'])) { foreach ($_POST['modules_select'] as $name_module) { $perspective->addModule($name_module); } } // end if isset //Removes the selected modules if (isset($_POST['DelModule']) && isset($_POST['modules_members_select'])) { foreach ($_POST['modules_members_select'] as $name_module) { $perspective->removeModule($name_module); } } // end if isset //list modules members if ($modules_miembros = OOB_perspective::listModulesFor($perspective->name())) { $i = 0; $return = array(); foreach ($modules_miembros as $m) { $m = new oob_module($m); $return[$i]['id'] = $m->name(); $return[$i]['name'] = $m->nicename(); ++$i; } $ari->t->assign("modules_miembros", $return); } //end if //search modules no members if ($modules = oob_perspective::searchNoMembers("", DELETED, OPERATOR_DISTINCT, $perspective->name(), MODULE)) { $i = 0; $return = array();
<?php global $ari; $ari->popup = 1; // no mostrar el main_frame if (isset($_POST['id'])) { $perspective = new oob_perspective($_POST['id']); $i = 0; if ($roles = OOB_perspective::listRolesFor($perspective)) { foreach ($roles as $r) { $return[$i]['id'] = $r->get('role'); $return[$i]['name'] = $r->get('name'); ++$i; } } //end if $result = array(); $result["totalCount"] = $i; $result["topics"] = $return; //RESULTADO $obj_comunication = new OOB_ext_comunication(); $obj_comunication->set_data($result); $obj_comunication->send(true, true); } else { throw new OOB_Exception_400("La variable [id] no esta definida"); }