<?php
//   unSusspend a session    (602)
//       name=sessname


require("phpVars.php");

  $sessName='';
  foreach ($_REQUEST as $vname=>$oof) {
     $avar=strtoupper(trim($vname)) ;
     if ($avar=='SESSION' || $avar=='NAME' ) $sessName=trim($oof) ;
  }

header("Content-Type: text/plain");

if ($sessName=='') {
  print '- ERROR: No SESSION=  in call to   unSuspendSession.php ';
  exit ;
}

$idate =time();
header('Content-type: text/plain ');

$oldfile=$sessions_dir . $sessName . '.suspend_xml' ;
$newfile=$sessions_dir . $sessName . '.xml' ;

$astat=file_exists($oldfile);
if (!$astat) {
   print 'Error: no suspend_xml file for session $sessName ';
   exit;
}

$astat=rename($oldfile,$newfile)   ;
 if ($astat) {
        $stuff='Session sucessfully UNsuspended.  Session descriptor file renamed to ' . $newfile ;
 }   else {
        $stuff='- ERROR: unable to UNsuspend session. Not able to rename ' . $oldfile ;
 }
 print $stuff ;
 exit; 


?>

