Login   Register  
PHP Classes
elePHPant
Icontem

File: partnerpages.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Voznyak Nazar  >  MVC Membership System  >  partnerpages.php  >  Download  
File: partnerpages.php
Role: Application script
Content type: text/plain
Description: partner controller
Class: MVC Membership System
Membership system using the MVC design pattern
Author: By
Last change:
Date: 2003-12-30 00:38
Size: 1,439 bytes
 

Contents

Class file image Download
<?

/*** required inclusions */
require_once '../setup.php';
require_once 
ROOT.'cpartner.inc';
require_once 
ROOT.'functions.inc';

if (
isPartnerLogged()) {
  
$user = new CPartner($_SESSION['username'], $_SESSION['password']);
  if (
$user->check()) {
     
$smarty = new Smarty;
     
$smarty->compile_check true;
     switch (
$page) {
     case 
'partner_logout'
        
$user->logout();
      break;
     case 
'partner_start'
      
$smarty->assign("username",$_SESSION['username']);
      break;
     case 
'partner_next':   
      
$smarty->assign("username",$_SESSION['username']);
      break;
    default: 
$page 'unknownPage';
     }
    
$smarty->display($actions[$page]);
  }
} else {
    
$smarty = new Smarty;
      
$smarty->compile_check true;
    switch (
$page) {
      case 
'partner_login_try':
        
$m = new CPartner($_GET['username'], $_GET['password']);
        if (
$m->login()) 
            
Header("Location: partnerpages.php?page=partner_next");
            else 
$smarty->display($actions['partner_login_failed']);
          break;
      case 
'partner_registrate_form':
            
$smarty->display($actions[$page]);
          break;
      case 
'partner_registrate':
        
$m = new CPartner($_GET['username'], $_GET['password']);
        if (
$m->store()) 
            
Header("Location: partnerpages.php?page=partner_login");
            else 
$smarty->display($actions['partner_login_failed']);
          break;
      default:
            
$smarty->display($actions['partner_login']);
        break;
    }
}


?>