File: WIAdmin/WICore/WIClass/WIFunction.php

Recommend this page to a friend!
  Classes of Jules Warner  >  WICMS  >  WIAdmin/WICore/WIClass/WIFunction.php  >  Download  
File: WIAdmin/WICore/WIClass/WIFunction.php
Role: Example script
Content type: text/plain
Description: Example script
Class: WICMS
Database driven content management system with PDO
Author: By
Last change: WI CMS

I am in process of building up my own cms system, its not quiet complete
yet.
There are multiple PDO classes, database driven, in process of making an
installer package for it.
The back end is being built UI with drag and drop, for a simple set up
Date: 3 years ago
Size: 1,135 bytes
 

Contents

Class file image Download
<?php

function redirect($url)
{
   
$url = rtrim(SCRIPT_URL, '/') . '/' . ltrim($url, '/');

    if ( !
headers_sent() )
    {
       
header('Location: '.$url, TRUE, 302);
        exit;
    }
    else
    {
        echo
'<script type="text/javascript">';
        echo
'window.location.href="'.$url.'";';
        echo
'</script>';
        echo
'<noscript>';
        echo
'<meta http-equiv="refresh" content="0;url='.$url.'" />';
        echo
'</noscript>';
        exit;
    }
}

function
get_redirect_page()
{
   
$login = new WILogin();

    if (
$login->isLoggedIn() )
    {
       
spl_autoload_register(function($class)
        {
            require_once
$class . '.php';
        });
       
$admin = new WIAdmin(WISession::get("user_id"));
       
$role = $admin->getRole();
    }
    else
       
$role = 'default';

   
$redirect = unserialize(SUCCESS_LOGIN_REDIRECT);

    if ( ! isset(
$redirect['default']) )
       
$redirect['default'] = 'index.php';

    return isset(
$redirect[$role]) ? $redirect[$role] : $redirect['default'];
}


function
e($value)
{
    return
htmlentities($value, ENT_QUOTES, 'UTF-8', false);
}


For more information send a message to info at phpclasses dot org.