<?php
//Created by ARDORA www.webardora.net
//ardoraPoster - openPoster.php
session_start(); $slogin_noauthpage = 0; $slogin_pagetitle = "";
include_once ("para.php");
include_once (profUname.uName."/".uName."_lib.php");
session_cache_limiter("nocache,private"); $nId=$_GET["num"];
if (empty($nId)){ $last=$_SERVER["HTTP_REFERER"]; header ("Location:".$last);} else{
$tipo=dameValor($slogin_Username, "TIP"); $adiante=false;
$xml = new DOMDocument("1.0", "utf-8"); $xml->formatOutput = true; $xml->preserveWhiteSpace = false;
$xml->load("../".folderWork."/foldersWork.xml");
$nodes=$xml->getElementsByTagName("folder");
for ($i = 0; $i < $nodes->length; $i++) {
   $back=$xml->getElementsByTagName("folder")->item($i);
   $num=$back->getElementsByTagName("id")->item(0);
   $numId=intval($num->nodeValue);
   if ($numId==$nId){
      $folderName=$back->getElementsByTagName("folderName")->item(0);
      $fold=$folderName->nodeValue;}
}
if ($tipo=="profe"){$adiante=true;}
else{for ($i = 0; $i < $nodes->length; $i++) {
   $back=$xml->getElementsByTagName("folder")->item($i);
   $us=$back->getElementsByTagName("folderUsu")->item(0);
   if (trim((string)$us->nodeValue)==trim($slogin_Username)){
      $fName=$back->getElementsByTagName("folderName")->item(0);
      if (trim((string)$fName->nodeValue)==trim((string)$fold)){
         $adiante=true;}}}};
if ($adiante){$fg = explode("/",$fold);end($fg);$fgr=$fg[count($fg)-1];
   header ("Location: introDatos.php?folderGroup=".$fgr);}
else{header ("Location:errorFolder.php");}}?>
