<?php
//   Susspend a session    (601)
//       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   suspendSession.php ';
  exit ;
}

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

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

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

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



?>

