<?php

add_action('body', 'shopos_warning');

function shopos_warning()
{
    if (  file_exists( dir_path('catalog') . 'install' ) )
	{
         shopos_output_warning(WARNING_INSTALL_DIRECTORY_EXISTS);
    }

    if (STORE_SESSIONS == '') 
    {
        if (!is_dir(os_session_save_path())) 
	    {
             shopos_output_warning(WARNING_SESSION_DIRECTORY_NON_EXISTENT);
        } 
		elseif (!is_writeable(os_session_save_path())) 
		{
             shopos_output_warning(WARNING_SESSION_DIRECTORY_NOT_WRITEABLE);
        }
    }
  
    if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) 
    {
        if (ini_get('session.auto_start') == '1') 
		{
            shopos_output_warning(WARNING_SESSION_AUTO_START);
        }
    }

    if ( DOWNLOAD_ENABLED == 'true' ) 
    {
        if (!is_dir(_DOWNLOAD)) 
	    {
            shopos_output_warning(WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT);
        }
    }
}

function shopos_output_warning($warning) 
{ 
   if (!empty($warning))
   {
        _e ('<div class="messageStack">' . $warning .'</div>');
   }
}

?>