function avSelectWPrintTree($name, $module, $class, $cclass, $show, $current, $method = '') { global $SYS; $cdata = newObject("{$class}", $current); $dsize = strlen($cdata->{$show}) * 1.5 + 5; return "\n\t\t\n\t\t<input type=\"hidden\" size=\"11\" maxlength=\"11\" name=\"{$name}\" id=\"Target{$class}{$name}\" value=\"{$current}\">\n\t\t<input type=\"text\" size=\"{$dsize}\" name=\"_t_{$name}\" id=\"wTarget{$class}{$name}\" value=\"" . $cdata->{$show} . "\" readonly>\n\t\t<span onclick='window.open(\"{$SYS["ROOT"]}/Framework/Extensions/Tree/TreeW.php?module={$module}&class={$class}&show={$show}¤t={$current}&name={$name}&cclass={$cclass}&method={$method}\",\"wFrame{$class}{$name}\",\"width=400,height=300,toolbar=0,scrollbar=0\")'\n\t\tstyle=\"cursor:pointer;background-color:white;border:1px solid gray\"> + </span>\n\t\t"; }
function run() { set_time_limit(0); /* Accion */ $con = newObject("ghost", $this->host); $connection = $con->makeConnection(); if ($connection) { // <tipo type="list" option="Ejecución|Espera">Tipo</tipo> switch ($this->tipo) { case 'Ejecución': return $this->_run_command($connection); break; case 'Espera': while (!$this->_waitfor($connection)) { sleep(30); } break; case 'Crear Script': return $this->_scripting($connection); break; } } else { $this->ERROR = "Error al ejecutar el comando"; return false; } return true; }
function Save() { //$this->fecha_pub=time(); $f = newObject("fileh"); $f->CaptureFile = 'foto'; $par = new Ente($this->name); $par = typecast($this, "Ente"); return $par->save(); }
function listUsersInGroupId() { $o = newObject("user"); $res = $o->select("(grupos&{$this->code}={$this->code})"); foreach ($res as $k => $v) { $r[$v->ID] = $v->apellidos . ", " . $v->nombre; } return $r; }
function save() { $f = newObject("fileh"); $f->CaptureFile = 'foto'; //dataDump($this); $par = new Ente($this->name); $par = typecast($this, "Ente"); //dataDump($par); return $par->save(); }
function ART_block_biblio() { global $SYS; $c = newObject("categoria"); $c->searchResults = $c->select("cat_id=0 AND nombre <> 'faqs'", $offset, $sort); ob_start(); listList($c, array(), "Articulus/biblio"); //plantHTML($SYS,"Articulus/biblio"); $data = ob_get_contents(); ob_end_clean(); return $data; }
function FORUS_block_forus() { global $SYS; $c = newObject("categoria"); $c->searchResults = $c->select("nombre='faqs'", $offset, $sort); if ($c->nRes > 0) { $faq = $c->searchResults[0]->ID; } if (BILO_isLogged()) { $clase = "login"; } else { $clase = "logoff"; } return "<table border=\"0\" width=\"127\" cellspacing=\"0\" class=\"block\"><tr><th class=\"{$clase}\">Soporte Linux\n\t</td></tr><tr><td class=\"boton\"><a style=\"text-decoration:none;\" href=\"{$SYS["ROOT"]}/Forus/Lista_Foros/\">Foros</a></td></tr><td class=\"boton\"><a style=\"text-decoration:none;\" href=\"{$SYS["ROOT"]}/Articulus/Lista/cat_id={$faq}/\">Faqs</a></td></tr></table>"; }
function PublicMdP(&$res, $link = "", $max = 0) { if ($max > 4) { return true; } $p = newObject("departamento", $this->cat_id, $max++); if ($p->ID < 2) { $res .= " -> <a class=\"minimal\" href=\"{$link}/ID={$this->ID}/\">{$this->nombre}</a>"; return true; } else { $p->PublicMdP(&$res, $link, $max); $res .= "-><a class=\"minimal\" href=\"{$link}/ID={$this->ID}/\">{$this->nombre}</a>"; } return true; }
function disminuirVisitas($source, $event, $formData) { global $GSPAnel; $objResponse = new xajaxResponse(); $task = newObject("example", $formData["ID"]); if ($task->ID < 2) { $objResponse->script("alert('Selecciona un ejemplo primero')"); } else { $valorvisitas = $task->visita - 1; $task->visita = $valorvisitas; $task->save(); $objResponse->script("alert('Visitas: {$task->visita}')"); $objResponse->script("tableGrid_{$GSPAnel->dGrid->id}.refresh()"); $objResponse->script("xajax_wForm.requestloadFromId({$task->ID},'{$GSPAnel->aForms[0]->id}','example')"); } return $objResponse; }
function GetCategoryTree() { $a = newObject('b_categoria'); $a->searchResults = $a->selectAll($offset, $sort); $this->b_categoria_id = array(); //$this->nombre_cat = array(); $i = 0; echo '<br>'; foreach ($a->searchResults as $key) { $this->b_categoria_id['ID'][$i] = $key->ID; echo $this->b_categoria_id['ID'][$i] . '|'; $this->b_categoria_id['nombre_cat'][$i] = $key->nombre_cat; echo $this->b_categoria_id['nombre_cat'][$i] . '|'; $b = newObject('b_libro_categoria'); $b->searchResults = $b->select("b_libro_id=" . $this->ID . " AND b_categoria_id=" . $key->ID); if ($b->searchResults) { $this->b_categoria_id['selected'][$i] = 1; } else { $this->b_categoria_id['selected'][$i] = 0; } echo 'selected: ' . $this->b_categoria_id['selected'][$i] . '<br>'; $i++; } /* $a=newObject('b_libro_categoria'); $a->searchResults=$a->select("b_libro_id=".$this->ID); $i = 0; $e=newObject("b_categoria"); $d=array( "b_cat_padre_id"=>$e->listAll("nombre_cat") ); plantHTML($c,'add_cat',$d); foreach($a->searchResults as $key) { $this->b_categoria_id = array(); $this->nombre_cat = array(); $this->b_categoria_id[$i] = $key->b_categoria_id; $b=newObject('b_categoria',$key->b_categoria_id); $this->nombre_cat[$i] = $b->nombre_cat; $i++; } */ return true; }
function BILO_block_user() { global $SYS; ob_start(); if (BILO_isLogged()) { $u = newObject("user", BILO_uid()); $u->username = BILO_username(); $u->clase = "login"; plantHTML($u, "Public/block_ok_login"); } else { $u = newObject("user"); debug(BILO_username(), "blue"); $u->clase = "logoff"; plantHTML($u, "Public/block_no_login"); } $data = ob_get_contents(); ob_end_clean(); return $data; }
function checkSecurity($p) { $current_user = $_SESSION["__auth"]["userId"]; if (BILO_isAdmin()) { debug("Sec passed by Group Administrador Is God(TM)", 'red'); return True; } if ($p->ID < 2) { // We are creating a new file or new folder // Check if directory has write access for all $dir = newObject("data_object", $p->inode); if (strpos($dir->p_other, 'w') !== False) { debug("Sec passed by Other:w", 'red'); return True; } // Check if directory has write access for group if (BILO_checkGroup($dir->gid)) { if (strpos($dir->p_group, 'w') !== False) { debug("Sec passed by Group:w", 'red'); return True; } } // Check if directory has write access for user if (BILO_uid() == $dir->uid) { if (strpos($dir->p_owner, 'w') !== False) { debug("Sec passed by Owner:w " . BILO_uid() . "|" . $dir->uid, 'red'); return True; } } } else { // We are modyfing a file or new folder // Check if element has write access for all // Check if element has write access for user if (BILO_uid() == $p->uid) { if (strpos($p->p_owner, 'w') !== False) { debug("Sec passed by Owner:w " . BILO_uid() . "|" . $p->uid, 'red'); return True; } } } return false; }
function save() { global $prefix; debug("Info: Calling Extended save"); if ($this->ID > 1 && $this->md5 != $this->md5calc()) { $o = newObject("gtasklog"); $res = $o->selectA("schedule_id=" . $this->ID . " AND inicio>" . time()); foreach ($res as $row) { $IDS[] = $row["ID"]; } if ($IDS) { debug("Purgando programaciones", "green"); _query("DELETE FROM {$prefix}_gtasklog WHERE estado='No Iniciada' AND ID IN (" . implode(",", $IDS) . ")"); } } $this->md5 = $this->md5calc(); $par = new Ente($this->name); $par = typecast($this, "Ente"); //dataDump($par); return $par->save(); }
function generateJobsToday() { setlimitRows(150000); $d = newObject("gtasklog"); $d->deletes("estado='No iniciada' AND inicio>" . dateTodayStamp()); $u = newObject("gtask"); $ids = $u->allID(); $d = array(); $tasks = array(1); foreach ($ids as $id) { $o = newObject("gtask", $id); $cron = new Parser($o->getCronString()); $RunsToday = $cron->getRuns(time()); foreach ($RunsToday as $timeStampOfRun) { //echo strftime("%d/%m/%Y %H:%M",$cron_ran)." # ".$cron_ran; $tl = newObject("gtasklog"); $tasklog = $tl->getByTaskDate($o, $timeStampOfRun); if ($tasklog) { $tasks[] = $tasklog->ID; //print_r($tasklog); } else { // $tl = newObject("gtasklog"); $tl->etiqueta = $o->titulo . "@" . strftime("%Y%m%d"); $tl->tipo = 'Desde Definición'; $tl->gtask_id = $id; $tl->schedule_id = $o->schedule_id; $tl->inicio = $timeStampOfRun; $tl->estado = 'No iniciada'; $tl->automatica = $o->automatica; $tl->emailconfirmacion = $o->emailconfirmacion; $tl->departamento = $o->departamento; $tl->diasderetraso = $o->diasderetraso; $tasks[] = $tl->save(); } } } resetlimitRows(); }
function save() { $obj = newObject($this->campos["entity"]); $this->usuario_id = BILO_uid(); $this->vista = $this->campos['entity']; foreach ($this->campos as $key => $value) { if (!in_array($key, array_keys($obj->properties))) { unset($this->campos[$key]); } } $this->campos_ser = serialize($this->campos); setLimitRows(15000); $this->searchResults = $this->select("usuario_id={$this->usuario_id} AND vista='{$this->vista}'"); resetLimitRows(); if ($this->nRes > 0) { $this->ID = $this->searchResults[0]->ID; } else { $this->ID = 1; } $par = new Ente($this->name); $par = typecast($this, "Ente"); return $par->save(); }
<?php require_once "Memo.php"; require_once "security.php"; $dir = newObject("data_object"); if (!isset($inode)) { $inode = 0; } else { $inode = $inode + 0; } if (!isset($sort)) { $sort = "type DESC"; } $aux = newObject("data_object", $inode); $aux2 = newObject("data_object", 0); $mdptext = ""; $aux->mdp(&$mdptext); $dir->path = $mdptext; $dir->current_inode = $inode; if (checkReadSecurity($aux)) { $dir->searchResults = $dir->select("inode={$inode}", $offset, $sort); $safe_list = array(); do { $ele = current($dir->searchResults); if (checkReadSecurity($ele)) { $safe_list[] = $ele; } } while (next($dir->searchResults)); $dir->searchResults = $safe_list; if (sizeof($safe_list) < 1 || $safe_list[0] == false) { unset($dir->searchResults);
<?php require_once "coreg2.php"; HTML("action_header"); $url = urldecode($params); $b = newObject("bookmark"); $b->url = $url; $b->nombre = $name; $b->user_id = BILO_uid(); if (!$b->save()) { echo $b->ERROR; } else { echo "Guardado correctamente [{$name}]"; } HTML("action_footer");
function resetPassword($hash) { global $SYS; if ($hash != "") { $action = newObject("reset_psw"); $action->searchResults = $action->select("hash='{$hash}' AND completed='No'", $offset, $sort); if ($action->nRes > 0) { $temp = $action->searchResults[0]; $user = newObject("user", $temp->user_id); $exp_reg = "[^A-Z0-9]"; $longitud = 5; $pass = substr(eregi_replace($exp_reg, "", md5(rand())) . eregi_replace($exp_reg, "", md5(rand())) . eregi_replace($exp_reg, "", md5(rand())), 0, $longitud); $user->password = md5($pass); //dataDump($user); if ($user->save()) { $temp->completed = 'Si'; $temp->save(); $link = "Se ha generado una nueva contraseña para su usuario, a continuación le informamos de sus nuevos datos para conectarse:<br><br>\n Usuario: {$user->username}<br><br>\n Contraseña: {$pass}"; require_once "Lib/lib_phpmailer.php"; $mail = new PHPMailer(); $mail->AddAddress($user->email); $mail->IsHTML(true); $mail->From = $SYS["admin_email"]; $mail->FromName = $SYS["admin_realm"]; $mail->Attached = $mail->AddAttachment($path, $name = "", $encoding = "base64", $type = "application/octet-stream"); $mail->Subject = $SYS["SITENAME"] . _("::Nueva contraseña de usuario"); $mail->Body = $link; if (!$mail->Send()) { $this->ERROR = $mail->ErrorInfo(); return false; } else { return true; } } } else { $this->ERROR = _("No se encuentra la solicitud"); return false; } } $this->ERROR = _("Hash invalido"); return false; }
<?php require_once "Articulus.php"; plantHTML($_GET, "menu_cat"); $cat_id = isset($cat_id) ? $cat_id : 1; setNavVars(array("ID", "cat_id")); $u = newObject("categoria", $cat_id); $cat = "Categoria: <b>{$u->nombre}</b><br>"; echo $cat; $u->searchResults = $u->select("cat_id={$cat_id}", $offset, $sort); $filas = _affected_rows(); if ($filas > 0) { listList($u, array(), "list_cat"); } else { echo "No hay subcategorias<br>"; } $v = newObject("documento"); $v->searchResults = $v->select("cat_id={$cat_id}", $offset, $sort); $filas = _affected_rows(); if ($filas > 0) { listList($v, array(), "list_doc"); } else { echo "No hay documentos<br>"; } if ($u->cat_id > 1) { plantHTML($u, "view_cat"); } else { plantHTML($u, "menu_todo"); }
<?php require_once "Biblio.php"; require_once "Lib/lib_tree.php"; $libro = newObject("b_libro", $ID); //$wRes=new avSelectTree(); /* $libro->b_categoria_id=$wRes->avSelectPrintTree("b_categoria_id","Biblio","b_categoria","b_cat_padre_id","nombre_cat",$p->b_categoria_padre_id); */ //$libro->b_categoria_id=$wRes->avSelectPrintTree("b_categoria_id","Biblio","b_categoria","b_cat_padre_id","nombre_cat",$libro->b_categoria_id); formAction("action_save_libro.php", "footer", "editForm"); $libro->boton0 = gfxBotonAction("Guardar", "getElementById('editForm').submit()", True); $c = newObject("b_categoria"); $libro->b_categoria = $libro->get_selected_options("b_categoria"); $d = array("b_categoria" => $c->listAll("nombre_cat")); plantHTML($libro, "fichalibro", $d); formClose();
<?php require_once "JasperReports.php"; //require_once("modificacion.php"); plantHTML(array(), 'action_header'); $ID = isset($ID) ? $ID : 1; if ($ID > 1) { $mod = newObject("reportparams", $ID); } else { $mod = newObject("reportparams"); } $mod->setAll($_POST); $pos = strpos($mod->body, "<br />"); echo $pos; $mod->resumen = substr($mod->body, 0, $pos); if ($mod->save()) { echo "Informe '{$titulo}' guardado correctamente"; frameGo("fbody", 'listadoreportparams.php'); } else { echo "Error: {$mod->error}"; } HTML('action_footer');
<?php require_once "Articulus.php"; HTML("menu"); $u = newObject("categoria"); setNavVars(array("ID", "cat_id")); $u->searchResults = $u->select("cat_id<2"); $filas = _affected_rows(); if ($filas > 0) { listList($u, array(), "index"); } else { echo "No hay ninguna categoría disponible"; }
<?php require_once "GlobalSche/GlobalSche.php"; HTML("action_header"); $libro = newObject("gsteplog", $ID); if ($libro->delete()) { echo _("Borrado correctamente"); frameGo("fbody", "steplog_list.php"); } else { echo _("No borrado"); }
<?php require_once "JasperReports.php"; //require_once("modificacion.php"); plantHTML(array(), 'action_header'); $ID = isset($ID) ? $ID : 1; if ($ID > 1) { $mod = newObject("jasperreport", $ID); } else { $mod = newObject("jasperreport"); } $mod->setAll($_POST); $pos = strpos($mod->body, "<br />"); echo $pos; $mod->resumen = substr($mod->body, 0, $pos); if ($mod->save()) { echo "Informe '{$titulo}' guardado correctamente"; frameGo("fbody", 'listadojasperreport.php'); } else { echo "Error: {$mod->error}"; } HTML('action_footer');
<?php $ORIGPATH = ini_get("include_path"); $PATH = dirname(__FILE__) . "/../../"; ini_set("include_path", "{$ORIGPATH}:{$PATH}:{$PATH}/Framework:{$PATH}/Apps"); $TrazaStatus = false; error_reporting(E_ALL); require "GlobalSche.php"; require_once "../JasperReports/JasperReports.php"; require_once "../JasperReports/util_jasperreport.php"; $parms = array(array("type" => "date", "value" => time())); $filename = callReport(dirname(__FILE__) . "/local/Reports/InformeSemanal.jrxml", $parms, false); require_once "Lib/lib_phpmailer.php"; $mail = new PHPMailer(); $g = newObject("group", 4); foreach ($g->listUsersInGroup() as $user) { if (empty($user->email)) { continue; } else { $mail->AddAddress($user->email); } } $mail->IsHTML(true); $mail->From = $SYS["admin_email"]; $mail->FromName = utf8_decode($SYS["admin_realm"]); $mail->Subject = utf8_decode("Informe Semanal"); if (!$mail->AddAttachment($filename, basename($filename), "base64", "application/pdf")) { die($mail->ErrorInfo . " ({$filename}) \n"); } if (!$mail->Send()) { die("Error sending" . $mail->ErrorInfo . "\n");
<?php require_once "Biblio.php"; $libro = newObject("b_libro"); setLimitRows(15); $libro->searchResults = $libro->selectAll($offset, $sort); $extk = array(); listList($libro, $extk, "listadolibro"); resetLimitRows();
<?php $ORIGPATH = ini_get("include_path"); $PATH = dirname(__FILE__) . "/../../"; ini_set("include_path", "{$ORIGPATH}:{$PATH}:{$PATH}/Framework:{$PATH}/Apps"); $TrazaStatus = false; error_reporting(E_ERROR); require "GlobalSche.php"; setlimitRows(150); $t = newObject("gtasklog", $argv[1]); $s = newObject("gsteplog"); $s->searchResults = $s->select("gtasklog_id={$argv[1]}", 0, "secuencia ASC"); foreach ($s->searchResults as $step) { echo "#####################################################################################\n\n"; echo strftime("%d-%m-%Y %H:%M:%S\t") . $step->resolve("gtasklog_id") . "\tPaso: " . $step->resolve("gstep_id") . "\t{$step->estado}\n"; flush(); $step->run(); echo strftime("%d-%m-%Y %H:%M:%S\t") . $step->resolve("gtasklog_id") . "\tPaso: " . $step->resolve("gstep_id") . "\t{$step->estado}\n"; if ($step->estado == 'Cancelada') { $t->anotaciones = $step->ERROR . " " . $step->TMPOUT; $t->setStatus("can"); break; } }
<?php require_once "Reports.php"; HTML("action_header"); $u = newObject("report", $ID); if ($u->delete()) { echo _("Borrado correctamente"); frameReload("fbody"); } else { echo _("Error Borrando: ") . $u->ERROR; } HTML("action_footer");
<?php require_once "Forus.php"; $ID = isset($ID) ? $ID : 1; $s = newObject("post", $p_id); $foro_id = isset($foro_id) ? $foro_id : 1; $p = newObject("post", $ID); $leido = isset($leido) ? $leido : 1; $a = newObject("post", $leido); $p->title = $s->title; $p->user = BILO_username(); if ($p->title != "") { $p->resp = "readonly=\"true\""; } $p->p_id = isset($p_id) ? $p_id : 0; $p->foro_id = $foro_id; formAction("action_save.php?ID={$ID}&foro_id={$p->foro_id}&leido=", "footer", "editForm"); $p->boton0 = gfxBotonAction("Guardar", "getElementById('editForm').submit()", True); plantHTML($p, "post"); formClose(); ?>
function addTab($name, $class, $relationWithParentField = null) { global $SYS; $instancedObject = newObject("{$class}"); $LayOut = new wLayoutTable("{$name}", $this->tabPane); $LayOut->setHorizontal(); $LayOut->fixedSizes = array("", ""); /* Grid */ $grid = new wGrid("grid{$class}{$this->id}", $LayOut); $grid->DataURL = "?oDataRequest=" . get_class($this) . "&instance={$class}"; $grid->setWidth(595); $grid->actionOnSelectID = "xajax_wForm.requestloadFromId(value,'form{$class}{$this->id}','{$class}')"; /* Form */ $form = new wForm("form{$class}{$this->id}", $LayOut); $form->setCSS("margin", "5px"); /* Data */ $grid->setDataModelFromCore($instancedObject); /* VNH */ $form->setDataModelFromCore($instancedObject); $form->createDefaultButtons(); $form->setCSS("width", "95%"); $form->doAfterSave("aj_ReloadGrid"); $form->doAfterDelete("aj_GridDelete"); if ($relationWithParentField) { $this->hierarchyClass["{$class}"] = "{$relationWithParentField}"; $this->grids["{$class}"] = $grid; $label = new wHidden("{$this->MainClass}_driver", $this, false); //$form->components["$relationWithParentField"]->setReadOnly(); } $this->aForms[sizeof($this->aForms)] = $form; }