<?php
require_once "../config/config.php";
$users=new users_class();
if($users->IsAdminhavePermission($_SESSION[SESSION_PREFIX.'Admin_UserID'],'Can manage Rotating Login Pages')==false)
{
Redirect('admin_nopermission.php',true);
}
$lspath=PHYSICAL_DIR."/member/rotating_login_pages/";
$lspath1=PHYSICAL_DIR."/member/rotating_login_pages";
switch($_action)
{
case 'rename':
if(trim($_GET['filename'])!='')
{ $lsfilename= trim($_GET['filename']);
if(file_exists($lspath."/".$lsfilename))
{
$lReverseFileName = strrev($lsfilename);
if(strpos(' '.trim($lReverseFileName),'dedulcxe.')==1)
{
$lsfilenamenew=trim(str_replace('.excluded','',$lsfilename));
if(file_exists($lspath."/".$lsfilenamenew))
{
$smarty->assign('msg',"File ".$lsfilenamenew." is alerady exist");
}
else
{
rename($lspath.$lsfilename,$lspath."/".$lsfilenamenew);
$smarty->assign('smsg','File is Successfully included');
}
}
else
{
if(file_exists($lspath.$lsfilename.".excluded"))
{
$smarty->assign('msg',"File ".$lsfilename.".excluded"." is alerady exist");
}
else
{
rename($lspath.$lsfilename,$lspath.$lsfilename.".excluded");
$smarty->assign('smsg','File is Successfully Excluded');
}
}
}
}
// rename(PHYSICAL_DIR."/rotating_login_pages".$_GET['filename'],PHYSICAL_DIR."/demo1.php.excluded");
default:
$flag=true;
if($message->IsMessageExists())
{
$lsmsg=$message->GetMessage();
$smarty->assign('smsg',$lsmsg);
}
if(!(file_exists($lspath1)))
{
$msgnodata="\"rotating_login_pages\" folder is not Found.<BR>so, please create it in ".WEB_URL."/member/ with read and write permission.";
$smarty->assign('msgnodata1',$msgnodata);
}
else
{
$myFile = $lspath1."/";
if(!is__writable($myFile))
{
$msgnodata="\"rotating_login_pages\" folder doesn't have read and write permission.<br>Please allow read and write permission on it.";
$smarty->assign('msgnodata1',$msgnodata);
}
else
{ $lapageinfo=GetRotatingpagesinfo($lspath1);
if(is_array($lapageinfo) && sizeof($lapageinfo)>0)
{
//print_r($lapageinfo);
$smarty->assign('lapageinfo',$lapageinfo);
}
else
{
$msgnodata="No Files Found";
$smarty->assign('msgnodata',$msgnodata);
}
}
}
$smarty->display('admin_login_rotate_v.tpl');
}
?>